diff --git a/resources/report/html/loot-plugin-card.html b/resources/report/html/loot-plugin-card.html index 73b382df..3723045e 100644 --- a/resources/report/html/loot-plugin-card.html +++ b/resources/report/html/loot-plugin-card.html @@ -163,15 +163,15 @@ loot-clear-metadata - + Edit Metadata - + Copy Metadata - + Clear User Metadata diff --git a/resources/report/html/loot-plugin-item.html b/resources/report/html/loot-plugin-item.html index 7cf67521..c954a4f0 100644 --- a/resources/report/html/loot-plugin-item.html +++ b/resources/report/html/loot-plugin-item.html @@ -15,13 +15,76 @@ display: block; margin-right: 0; } - core-tooltip { + paper-item > core-tooltip { margin-left: 16px; } + + /* paper-item (two-line) */ + paper-item.two-line { + /* Two-line items should be 72px high according to Material Design. + Squeeze the height to fit more items in. */ + /*height: 72px;*/ + } + #primary, + #secondary, + #secondary core-icon, + paper-item.two-line::shadow .button-content { + transition: 0.6s; + } + paper-item.two-line::shadow .button-content { + padding: 14px 16px; + } + :host-context(body[data-editors]) paper-item.two-line::shadow .button-content { + padding: 7.5px 16px; + } + #text { + /* Padding is disabled as otherwise text won't fit in correctly. */ + /*padding: 4px 0;*/ + line-height: normal; + overflow: visible; + } + :host-context(body[data-editors]) #primary { + /* MD spec says 16sp, but that doesn't fit, so use 14sp. */ + /*font-size: 1.143rem;*/ + font-size: 1rem; + } + #secondary { + /* MD spec says 14sp, but that doesn't fit, so use 12sp. */ + /*font-size: 1rem; */ + font-size: 0.857rem; + color: rgba(0, 0, 0, 0.54); + height: 13px; + overflow: visible; + } + #secondary core-icon { + margin-right: 0; + height: 13px; + } + + /* When not in edit mode, hide secondary text. */ + #secondary.hidden, + :host-context(body:not([data-editors])) #secondary { + height: 0; + overflow: hidden; + } + + core-tooltip.hidden { + opacity: 0; + pointer-events: none; + overflow: hidden; + } - -
+ +
+
+
+ + + + +
+
@@ -35,11 +98,14 @@ data: undefined, observe: { - 'data.userlist': 'onUserlistChange' + 'data.userlist': 'onUserlistChange', + 'data.modPriority': 'onPriorityChange', + 'data.isGlobalPriority': 'onPriorityChange' }, dataChanged: function(oldValue, newValue) { this.onUserlistChange(); + this.onPriorityChange(); }, onUserlistChange: function(oldValue, newValue) { @@ -52,8 +118,26 @@ } }, + onPriorityChange: function(oldValue, newValue) { + if (this.data) { + if (this.data.modPriority != 0) { + this.shadowRoot.getElementById('secondary').classList.remove('hidden'); + } else { + this.shadowRoot.getElementById('secondary').classList.add('hidden'); + } + if (this.data.isGlobalPriority) { + this.shadowRoot.getElementById('secondary').firstElementChild.classList.remove('hidden'); + } else { + this.shadowRoot.getElementById('secondary').firstElementChild.classList.add('hidden'); + } + } else { + this.shadowRoot.getElementById('secondary').classList.add('hidden'); + this.shadowRoot.getElementById('secondary').firstElementChild.classList.add('hidden'); + } + }, + getName: function() { - return this.textContent.trim(); + return this.querySelector('.name').textContent.trim(); }, handleDragStart: function(evt) { diff --git a/resources/report/js/script.js b/resources/report/js/script.js index 774777ee..65003f89 100644 --- a/resources/report/js/script.js +++ b/resources/report/js/script.js @@ -904,6 +904,7 @@ function handleEditorClose(evt) { --numEditors; if (numEditors == 0) { + document.body.removeAttribute('data-editors'); /* Re-enable toolbar elements. */ document.getElementById('wipeUserlistButton').removeAttribute('disabled'); document.getElementById('copyContentButton').removeAttribute('disabled'); @@ -912,8 +913,9 @@ function handleEditorClose(evt) { document.getElementById('gameMenu').removeAttribute('disabled'); document.getElementById('updateMasterlistButton').removeAttribute('disabled'); document.getElementById('sortButton').removeAttribute('disabled'); + } else { + document.body.setAttribute('data-editors', numEditors); } - document.body.setAttribute('data-editors', numEditors); } function handleConflictsFilter(evt) { /* evt.detail is true if the filter has been activated. */ diff --git a/resources/report/report.html b/resources/report/report.html index 733a7a16..2adce966 100644 --- a/resources/report/report.html +++ b/resources/report/report.html @@ -54,7 +54,8 @@ diff --git a/src/gui/handler.cpp b/src/gui/handler.cpp index df2841c2..8455def7 100644 --- a/src/gui/handler.cpp +++ b/src/gui/handler.cpp @@ -429,11 +429,13 @@ namespace loot { // Priority value was changed, so add it to the userlist data. int priority = pluginMetadata["modPriority"].as(); - if (priority >= 0) { - priority += max_priority; - } - else { - priority -= max_priority; + if (pluginMetadata["isGlobalPriority"].as()) { + if (priority >= 0) { + priority += max_priority; + } + else { + priority -= max_priority; + } } newUserlistEntry.Priority(priority); newUserlistEntry.SetPriorityExplicit(true);