diff options
author | 0neGal <mail@0negal.com> | 2023-09-16 18:17:04 +0200 |
---|---|---|
committer | 0neGal <mail@0negal.com> | 2023-09-16 18:17:04 +0200 |
commit | f3e5e1596a22c3df38a8c00a5ceadf8a5dd2967a (patch) | |
tree | a5ae56bdc7baedc22930697de9cefc171705410d /src/app/main.js | |
parent | 53c19052738a4a9cc43feca31e8231c844b4d2b5 (diff) | |
download | Viper-f3e5e1596a22c3df38a8c00a5ceadf8a5dd2967a.tar.gz Viper-f3e5e1596a22c3df38a8c00a5ceadf8a5dd2967a.zip |
added buttons for fixing some problems and alike
I will likely add more buttons in the future, but for now this is most
of the ones a user could need to repair problems.
Diffstat (limited to 'src/app/main.js')
-rw-r--r-- | src/app/main.js | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/src/app/main.js b/src/app/main.js index bbf1e57..d94d508 100644 --- a/src/app/main.js +++ b/src/app/main.js @@ -122,6 +122,17 @@ if (! navigator.onLine) { function exit() {ipcRenderer.send("exit")} function updateNorthstar() {ipcRenderer.send("update-northstar")} +function force_update_ns() { + ipcRenderer.send("update-northstar", true); +} + +function reset_config() { + ipcRenderer.send("reset-config"); +} + +function relaunch() { + ipcRenderer.send("relaunch"); +} // Reports to the main process about game path status. // @param {boolean} value is game path loaded @@ -151,11 +162,18 @@ function setButtons(state) { let disablearray = (array) => { for (let i = 0; i < array.length; i++) { - array[i].disabled = !state; + array[i].disabled = ! state; + + if (state) { + array[i].classList.remove("disabled") + } else { + array[i].classList.add("disabled") + } } } disablearray(document.querySelectorAll("#modsdiv .el button")); + disablearray(document.querySelectorAll(".disable-when-installing")); disablearray(document.querySelectorAll(".playBtnContainer .playBtn")); disablearray(document.querySelectorAll("#nsMods .buttons.modbtns button")); disablearray(document.querySelectorAll("#browser #browserEntries .text button")); @@ -333,6 +351,18 @@ function kill_game() { ipcRenderer.send("kill-game"); } +function kill_origin() { + ipcRenderer.send("kill-origin"); +} + +function delete_request_cache() { + ipcRenderer.send("delete-request-cache"); +} + +function delete_install_cache() { + ipcRenderer.send("delete-install-cache"); +} + // Updates the installed mods ipcRenderer.on("mods", (event, mods_obj) => { modsobj = mods_obj; |