aboutsummaryrefslogtreecommitdiff
path: root/src/app/main.js
diff options
context:
space:
mode:
authorGitExample <git@example.com>2022-02-03 01:36:11 +0100
committerGitExample <git@example.com>2022-02-03 01:36:11 +0100
commita4b11903979fdb4c8b0f6dda8f7343e14c1ebe17 (patch)
tree408def0b839140c6004ba5099c3abf0cc2319bea /src/app/main.js
parentd3228ae7fad117a8313731107f572ba4879569b6 (diff)
downloadViper-a4b11903979fdb4c8b0f6dda8f7343e14c1ebe17.tar.gz
Viper-a4b11903979fdb4c8b0f6dda8f7343e14c1ebe17.zip
detection of installed mods, disabling buttons
When a new mod has been installed through the browser UI it's button is changed from "Install" to "Re-Install" instantly. We also now disable modding related buttons when updating NS, or when installing mods. This should prevent issues.
Diffstat (limited to 'src/app/main.js')
-rw-r--r--src/app/main.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/app/main.js b/src/app/main.js
index b61b20a..fa7cea8 100644
--- a/src/app/main.js
+++ b/src/app/main.js
@@ -68,6 +68,15 @@ function log(msg) {
// updating/installing Northstar.
function setButtons(state) {
playNsBtn.disabled = !state;
+
+ let disablearray = (array) => {
+ for (let i = 0; i < array.length; i++) {
+ array[i].disabled = !state;
+ }
+ }
+
+ disablearray(document.querySelectorAll("#nsMods .buttons.modbtns button"))
+ disablearray(document.querySelectorAll("#browser #browserEntries .text button"))
}
// Frontend part of updating Northstar
@@ -150,11 +159,13 @@ function selected(all) {
// Tells the main process to install a mod
function installmod() {
+ setButtons(false);
ipcRenderer.send("installmod")
}
// Tells the main process to install a mod from a URL
function installFromURL(url) {
+ setButtons(false);
ipcRenderer.send("installfromurl", url)
}