diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/app/main.js | 25 | ||||
-rw-r--r-- | src/index.js | 4 | ||||
-rw-r--r-- | src/lang/en.json | 1 |
3 files changed, 30 insertions, 0 deletions
diff --git a/src/app/main.js b/src/app/main.js index 72e0e09..1dbff40 100644 --- a/src/app/main.js +++ b/src/app/main.js @@ -242,6 +242,31 @@ ipcRenderer.on("confirm", (event, data) => { ipcRenderer.send("confirm-closed-" + data.id, confirmed); }) +let is_running = false; +ipcRenderer.on("is-running", (event, running) => { + let set_playbtns = (text) => { + let playbtns = document.querySelectorAll(".playBtn"); + for (let i = 0; i < playbtns.length; i++) { + playbtns[i].innerHTML = text; + } + } + + if (running && is_running != running) { + setButtons(false); + set_playbtns(lang("general.running")); + + is_running = running; + return; + } + + if (is_running != running) { + setButtons(true); + set_playbtns(lang("gui.launch")); + + is_running = running; + } +}) + // Updates the installed mods ipcRenderer.on("mods", (event, mods_obj) => { modsobj = mods_obj; diff --git a/src/index.js b/src/index.js index c6179e0..3d2f65b 100644 --- a/src/index.js +++ b/src/index.js @@ -156,6 +156,10 @@ function start() { ipcMain.on("update-now", () => { autoUpdater.quitAndInstall(); }) + + setInterval(async () => { + send("is-running", await is_running.game()); + }, 1000) } ipcMain.on("install-mod", () => { diff --git a/src/lang/en.json b/src/lang/en.json index 4eabbbd..4f90f32 100644 --- a/src/lang/en.json +++ b/src/lang/en.json @@ -164,6 +164,7 @@ "general.mods.installed": "Installed mods:", "general.missingpath": "Game location could not be found automatically! Please select it manually!", "general.notinstalled": "Northstar is not installed!", + "general.running": "Running", "general.launching": "Launching", "general.invalidconfig": "Your config file is improperly formatted, if it's been manually edited, please validate that everything is typed correctly.\n\nIf you did not manually edit the config file, it is recommended to simply reset the config.\n\nTo reset your config file simply click \"Ok\" below.\n\nMore details:\n", |