diff options
author | 0neGal <mail@0negal.com> | 2022-02-08 21:15:38 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-08 21:15:38 +0100 |
commit | 70e50148c8a4315c7fc25d5052f9ebee1c5d56bc (patch) | |
tree | 5670e225378ebcb0e73efb0c84265357f74f00cb /src/app/main.js | |
parent | e2aa874f48dc585f0d67c5655df234bdf356cc53 (diff) | |
parent | 1bd83cf1a72332e142bb63acab47ac3877061875 (diff) | |
download | Viper-70e50148c8a4315c7fc25d5052f9ebee1c5d56bc.tar.gz Viper-70e50148c8a4315c7fc25d5052f9ebee1c5d56bc.zip |
Merge pull request #50 from 0neGal/thunderstore
Thunderstore support
Diffstat (limited to 'src/app/main.js')
-rw-r--r-- | src/app/main.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/app/main.js b/src/app/main.js index 19f6c9e..169f86f 100644 --- a/src/app/main.js +++ b/src/app/main.js @@ -3,6 +3,7 @@ const path = require("path"); const { ipcRenderer, shell } = require("electron"); const lang = require("../lang"); +var modsobj = {}; let shouldInstallNorthstar = false; // Base settings @@ -66,6 +67,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 @@ -148,9 +158,16 @@ 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) +} + // Frontend part of settings a new game path ipcRenderer.on("newpath", (event, newpath) => { settings.gamepath = newpath; @@ -163,6 +180,7 @@ ipcRenderer.on("alert", (event, msg) => {alert(msg)}) // Updates the installed mods ipcRenderer.on("mods", (event, mods) => { + modsobj = mods; if (! mods) {return} modcount.innerHTML = `${lang("gui.mods.count")} ${mods.all.length}`; |