diff options
author | 0neGal <mail@0negal.com> | 2022-04-20 20:22:58 +0200 |
---|---|---|
committer | 0neGal <mail@0negal.com> | 2022-04-20 20:22:58 +0200 |
commit | 8c437b60104cbf1bed9ebc313e5bc3b9d04162b3 (patch) | |
tree | 938575a1caccfaeedb4972483ff134833ad873a9 /src/app | |
parent | a2e1b36c558ed32e7a91b28a21a3843cd82217be (diff) | |
download | Viper-8c437b60104cbf1bed9ebc313e5bc3b9d04162b3.tar.gz Viper-8c437b60104cbf1bed9ebc313e5bc3b9d04162b3.zip |
running status on buttons
When the game is running the buttons will go from saying "Launch" to
"Running" and the buttons will also disable, so you can't run the game
multiple times, avoiding a lot of issues.
Diffstat (limited to 'src/app')
-rw-r--r-- | src/app/main.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/app/main.js b/src/app/main.js index 8894d3f..4918777 100644 --- a/src/app/main.js +++ b/src/app/main.js @@ -91,6 +91,20 @@ function setButtons(state) { } ipcRenderer.on("setbuttons", (event, state) => {setButtons(state)}) + +ipcRenderer.on("gamestate", (event, state) => { + setButtons(! state); + + let string = lang("gui.launch"); + if (state) { + string = lang("gui.running"); + } + + let btns = document.querySelectorAll(".playBtnContainer .playBtn"); + btns[0].innerHTML = string; + btns[1].innerHTML = string; +}) + ipcRenderer.on("gamepathlost", (event, state) => { page(0); setButtons(false); |