aboutsummaryrefslogtreecommitdiff
path: root/src/utils.js
diff options
context:
space:
mode:
author0neGal <mail@0negal.com>2022-01-05 00:37:38 +0100
committer0neGal <mail@0negal.com>2022-01-05 00:37:38 +0100
commita898d6866a912abceb78832bc1b3fe2ff56d1335 (patch)
tree9067a550a1f110b37cfa8cd99ce7a80b156c442d /src/utils.js
parentdce0f68e7f9095ffa400112f03968251999a92dc (diff)
parent89d8d1986b62d5686160f28359383ccd0c67f77d (diff)
downloadViper-a898d6866a912abceb78832bc1b3fe2ff56d1335.tar.gz
Viper-a898d6866a912abceb78832bc1b3fe2ff56d1335.zip
Merge branch 'main' of 0neGal/viper into mod-support
Diffstat (limited to 'src/utils.js')
-rw-r--r--src/utils.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/utils.js b/src/utils.js
index 5be9cfe..fc62f01 100644
--- a/src/utils.js
+++ b/src/utils.js
@@ -31,7 +31,7 @@ if (fs.existsSync("viper.json")) {
settings = {...settings, ...JSON.parse(fs.readFileSync("viper.json", "utf8"))};
settings.zip = path.join(settings.gamepath + "/northstar.zip");
} else {
- console.log(lang("general.missinggamepath"));
+ console.log(lang("general.missingpath"));
}
function setpath(win) {
@@ -39,10 +39,15 @@ function setpath(win) {
settings.gamepath = cli.param("setpath");
} else {
dialog.showOpenDialog({properties: ["openDirectory"]}).then(res => {
+ if (res.canceled) {
+ ipcMain.emit("newpath", null, false);
+ return;
+ }
settings.gamepath = res.filePaths[0];
settings.zip = path.join(settings.gamepath + "/northstar.zip");
saveSettings();
win.webContents.send("newpath", settings.gamepath);
+ ipcMain.emit("newpath", null, settings.gamepath);
}).catch(err => {console.error(err)})
}