diff options
Diffstat (limited to 'src/app/main.js')
-rw-r--r-- | src/app/main.js | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/app/main.js b/src/app/main.js index 9bafaa5..809b5c8 100644 --- a/src/app/main.js +++ b/src/app/main.js @@ -20,7 +20,7 @@ if (fs.existsSync("viper.json")) { settings = {...settings, ...JSON.parse(fs.readFileSync("viper.json", "utf8"))}; settings.zip = path.join(settings.gamepath + "/northstar.zip"); } else { - alert(lang("gui.missinggamepath")); + alert(lang("general.missinggamepath")); setpath(); } @@ -31,10 +31,28 @@ function setpath() {ipcRenderer.send("setpath")} function launch() {ipcRenderer.send("launch")} function launchVanilla() {ipcRenderer.send("launchVanilla")} +function log(msg) { + console.log(msg); + welcome.innerHTML = msg; +} + +function setButtons(state) { + let buttons = document.querySelectorAll("button"); + + for (let i = 0; i < buttons.length; i++) { + buttons[i].disabled = !state; + } +} + +ipcRenderer.on("ns-updated", () => {setButtons(true)}) +ipcRenderer.on("ns-updating", () => {setButtons(false)}) + ipcRenderer.on("newpath", (event, newpath) => { settings.gamepath = newpath; }) +ipcRenderer.on("log", (event, msg) => {log(msg)}) + setlang(); setInterval(() => { ipcRenderer.send("setsize", document.querySelector(".lines").offsetHeight + 20); |