diff options
Diffstat (limited to 'src/app')
-rw-r--r-- | src/app/main.css | 16 | ||||
-rw-r--r-- | src/app/main.js | 15 |
2 files changed, 23 insertions, 8 deletions
diff --git a/src/app/main.css b/src/app/main.css index 8776ec9..60a05c6 100644 --- a/src/app/main.css +++ b/src/app/main.css @@ -6,6 +6,10 @@ --boxbackground: #666E7F; --subforeground: #AFAFAF; --btnforeground: var(--foreground); + + --red: #C7777F; + --blue: #81A1C1; + --yellow: #ECD19A; } @media (prefers-color-scheme: light) { @@ -60,6 +64,12 @@ nobr {white-space: nowrap} .mod.selected {background: var(--background)} +.mod .disabled { + color: var(--red); + position: absolute; + right: calc(var(--padding) * 2.5); +} + .buttons { text-align: right; margin-left: auto; @@ -96,7 +106,7 @@ button:active { #setpath {background: #5E81AC} #vanilla, #exit {background: #656E7F} -#update, #installmod {background: #81A1C1} -#togglemod, #toggleall {background: #ECD19A} -#northstar, #removeall, #removemod {background: #C7777F} +#update, #installmod {background: var(--blue)} +#togglemod, #toggleall {background: var(--yellow)} +#northstar, #removeall, #removemod {background: var(--red)} button:disabled {background: var(--disabled) !important; opacity: 0.5} diff --git a/src/app/main.js b/src/app/main.js index f903c29..897c82c 100644 --- a/src/app/main.js +++ b/src/app/main.js @@ -47,7 +47,7 @@ function setButtons(state) { let lastselected = ""; function select(entry) { - let entries = document.querySelectorAll("#modsdiv .mod span"); + let entries = document.querySelectorAll("#modsdiv .mod .modtext"); for (let i = 0; i < entries.length; i++) { if (entries[i].innerHTML == entry) { @@ -64,7 +64,7 @@ function selected(all) { if (all) { selected = "allmods" } else { - selected = document.querySelector(".mod.selected span"); + selected = document.querySelector(".mod.selected .modtext"); if (selected != null) { selected = selected.innerHTML; } else { @@ -110,9 +110,14 @@ ipcRenderer.on("mods", (event, mods) => { modcount.innerHTML = `${lang("gui.mods.count")} ${mods.all.length}`; modsdiv.innerHTML = ""; - let newmod = (name, extra) => { - if (! extra) {extra = ""} - modsdiv.innerHTML += `<div onclick="select('${name}')" class="mod"><span>${name}</span>${extra}</div>`; + let newmod = (name, disabled) => { + if (disabled) { + disabled = `<span class="disabled">${lang("gui.mods.disabledtag")}</span>` + } else { + disabled = "" + } + + modsdiv.innerHTML += `<div onclick="select('${name}')" class="mod"><span class="modtext">${name}</span>${disabled}</div>`; } for (let i = 0; i < mods.enabled.length; i++) {newmod(mods.enabled[i].Name)} |