aboutsummaryrefslogtreecommitdiff
path: root/src/app/main.js
diff options
context:
space:
mode:
author0neGal <mail@0negal.com>2023-05-06 23:08:10 +0200
committer0neGal <mail@0negal.com>2023-05-06 23:08:10 +0200
commitcfec36cbdf00b181e6560be15c6b341842894e00 (patch)
tree79695f247fdd886874617adf78015bccc7508bca /src/app/main.js
parent4e60274bbefa1ddf17cb5b7589b6915254063bbe (diff)
downloadViper-cfec36cbdf00b181e6560be15c6b341842894e00.tar.gz
Viper-cfec36cbdf00b181e6560be15c6b341842894e00.zip
change launch button text if game is running
This should've already been a thing, and was a thing for when the game was currently launching, but this functionality seems to have been broken at some point.
Diffstat (limited to 'src/app/main.js')
-rw-r--r--src/app/main.js25
1 files changed, 25 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;