From bff68af8f52595bcf93c3d67fb388db5459f314c Mon Sep 17 00:00:00 2001 From: 0neGal Date: Mon, 18 Sep 2023 13:08:58 +0200 Subject: added "Open gamepath" button Very useful stuff! --- src/app/index.html | 1 + src/app/main.js | 9 +++++++++ src/lang/en.json | 2 ++ 3 files changed, 12 insertions(+) diff --git a/src/app/index.html b/src/app/index.html index b18db42..4bd4d92 100644 --- a/src/app/index.html +++ b/src/app/index.html @@ -162,6 +162,7 @@
+ diff --git a/src/app/main.js b/src/app/main.js index d94d508..8ccdce3 100644 --- a/src/app/main.js +++ b/src/app/main.js @@ -130,6 +130,15 @@ function reset_config() { ipcRenderer.send("reset-config"); } +function open_gamepath() { + let open_path = require("electron").shell.openPath; + if (settings.gamepath) { + open_path(settings.gamepath); + } else { + alert(lang("gui.settings.miscbuttons.open_gamepath_alert")); + } +} + function relaunch() { ipcRenderer.send("relaunch"); } diff --git a/src/lang/en.json b/src/lang/en.json index 5cb443e..bcfb372 100644 --- a/src/lang/en.json +++ b/src/lang/en.json @@ -188,6 +188,7 @@ "title": "Misc repair actions", "desc": "If you're having problems then some of these buttons may help fixing it", "buttons": { + "open_gamepath": "Open gamepath", "reset_config": "Reset config file", "restart_viper": "Restart Viper", "change_gamepath": "Change gamepath", @@ -195,6 +196,7 @@ "force_quit_origin": "Force quit Origin and or EA Desktop" }, + "open_gamepath_alert": "No valid gamepath is selected, so there's no gamepath to open, please select a valid gamepath first!", "reset_config_alert": "Please confirm that you want to reset the config file, after confirming Viper will delete the config file, and then restart." } }, -- cgit v1.2.3