aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author0neGal <mail@0negal.com>2022-01-03 02:43:10 +0100
committer0neGal <mail@0negal.com>2022-01-03 02:43:33 +0100
commite77ac64018bec2ca98e2264fafd6db02990ef741 (patch)
tree84365f9f1bd1407d19b95b7c0ceed2187c61f0e4
parent34c93e9e7714322aa67fc427e3b9f03fea827229 (diff)
downloadViper-e77ac64018bec2ca98e2264fafd6db02990ef741.tar.gz
Viper-e77ac64018bec2ca98e2264fafd6db02990ef741.zip
mod buttons are now disabled if NS isn't installed
-rw-r--r--src/app/index.html2
-rw-r--r--src/app/main.js8
2 files changed, 9 insertions, 1 deletions
diff --git a/src/app/index.html b/src/app/index.html
index 88cfbb5..88d5a17 100644
--- a/src/app/index.html
+++ b/src/app/index.html
@@ -30,7 +30,7 @@
</div>
<div class="line">
<div class="text" id="modcount">%%gui.mods%%</div>
- <div class="buttons">
+ <div class="buttons modbtns">
<button id="removemod" onclick="selected().remove()">%%gui.mods.remove%%</button>
<button id="removeall" onclick="selected(true).remove()">%%gui.mods.removeall%%</button>
<button id="togglemod" onclick="selected().toggle()">%%gui.mods.toggle%%</button>
diff --git a/src/app/main.js b/src/app/main.js
index 8db6561..6f2493a 100644
--- a/src/app/main.js
+++ b/src/app/main.js
@@ -129,6 +129,14 @@ ipcRenderer.on("mods", (event, mods) => {
ipcRenderer.on("version", (event, versions) => {
vpversion.innerText = lang("gui.versions.viper") + ": " + versions.vp;
nsversion.innerText = lang("gui.versions.northstar") + ": " + versions.ns;
+
+ if (versions.ns == "unknown") {
+ let buttons = document.querySelectorAll(".modbtns button");
+
+ for (let i = 0; i < buttons.length; i++) {
+ buttons[i].disabled = true;
+ }
+ }
}); ipcRenderer.send("getversion");
ipcRenderer.on("updateavailable", () => {