From 18d1166b6b8beef422590607cd02d613dd02d2d0 Mon Sep 17 00:00:00 2001 From: 3top1a <57371001+3top1a@users.noreply.github.com> Date: Mon, 24 Jan 2022 14:27:29 +0100 Subject: Edge case in vdf reading (#56) * Edge case * Alert user only when automatic detection failed * extra info on not found message * support for [Free/Open]BSD Co-authored-by: 0neGal --- src/lang/en.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/lang') diff --git a/src/lang/en.json b/src/lang/en.json index c2b6f98..8d4daeb 100644 --- a/src/lang/en.json +++ b/src/lang/en.json @@ -96,7 +96,7 @@ "general.mods.enabled": "Enabled mods:", "general.mods.disabled": "Disabled mods:", "general.mods.installed": "Installed mods:", - "general.missingpath": "Game path is not set!", + "general.missingpath": "Game location could not be found automatically! Please select it manually!", "general.notinstalled": "Northstar is not installed!", "general.launching": "Launching" } -- cgit v1.2.3 From 5566e6c1cd572c18944f651083e6f30b8e7a4354 Mon Sep 17 00:00:00 2001 From: Remy Raes Date: Mon, 24 Jan 2022 15:38:17 +0100 Subject: [fix] update general.missingpath French translation --- src/lang/fr.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/lang') diff --git a/src/lang/fr.json b/src/lang/fr.json index 59a3090..1ba7acf 100644 --- a/src/lang/fr.json +++ b/src/lang/fr.json @@ -96,7 +96,7 @@ "general.mods.enabled": "Mods activés :", "general.mods.disabled": "Mods désactivés :", "general.mods.installed": "Mods installés :", - "general.missingpath": "Le chemin du client n'est pas défini !", + "general.missingpath": "Le chemin du client n'a pu être trouvé automatiquement, merci de le sélectionner manuellement.", "general.notinstalled": "Northstar n'est pas installé !", "general.launching": "Lancement" } -- cgit v1.2.3 From 9c6ac295189acab7303952725755dfac87e18470 Mon Sep 17 00:00:00 2001 From: 0neGal Date: Mon, 24 Jan 2022 18:21:13 +0100 Subject: no alert when manually changing the game path When changing the game path by clicking the button you shouldn't be told it can't find the game and you've to select one manually, as you know that already. More importantly, if it could be found automatically it'll just not do anything. With this change I also changed the "gui.setpath" string to be more logical, and to make it clear what it does. --- src/app/main.js | 1 - src/index.js | 10 +++++++--- src/lang/en.json | 2 +- src/utils.js | 30 ++++++++++++++++-------------- 4 files changed, 24 insertions(+), 19 deletions(-) (limited to 'src/lang') diff --git a/src/app/main.js b/src/app/main.js index dab584e..a3a1d04 100644 --- a/src/app/main.js +++ b/src/app/main.js @@ -26,7 +26,6 @@ if (fs.existsSync("viper.json")) { settings.zip = path.join(settings.gamepath + "/northstar.zip"); if (settings.gamepath.length === 0) { - alert(lang("general.missingpath")); setpath(false); } else { setpath(true); diff --git a/src/index.js b/src/index.js index f4207e7..c8bfc53 100644 --- a/src/index.js +++ b/src/index.js @@ -87,9 +87,13 @@ ipcMain.on("launchVanilla", (event) => {utils.launch("vanilla")}) ipcMain.on("update", (event) => {utils.update()}) ipcMain.on("setpathcli", (event) => {utils.setpath()}); ipcMain.on("setpath", (event, value) => { - if (!value) { - utils.setpath(win); - } else if (!win.isVisible()) { + if (! value) { + if (! win.isVisible()) { + utils.setpath(win); + } else { + utils.setpath(win, true); + } + } else if (! win.isVisible()) { win.show(); } }); diff --git a/src/lang/en.json b/src/lang/en.json index 8d4daeb..fe9b0b0 100644 --- a/src/lang/en.json +++ b/src/lang/en.json @@ -42,7 +42,7 @@ "gui.versions.northstar": "Northstar version", "gui.exit": "Exit", "gui.update": "Update", - "gui.setpath": "Game Path", + "gui.setpath": "Change Game Path", "gui.update.check": "Check for updates", "gui.mods": "Mods", diff --git a/src/utils.js b/src/utils.js index ef647fe..fb94b92 100644 --- a/src/utils.js +++ b/src/utils.js @@ -116,7 +116,7 @@ northstar_auto_updates: { // // If running with CLI it takes in the --setpath argument otherwise it // open the systems file browser for the user to select a path. -async function setpath(win) { +async function setpath(win, forcedialog) { function setGamepath(folder) { settings.gamepath = folder; settings.zip = path.join(settings.gamepath + "/northstar.zip"); @@ -128,21 +128,23 @@ async function setpath(win) { if (! win) { // CLI setGamepath(cli.param("setpath")); } else { // GUI - function setGamepath(folder) { - settings.gamepath = folder; - settings.zip = path.join(settings.gamepath + "/northstar.zip"); - saveSettings(); - win.webContents.send("newpath", settings.gamepath); - ipcMain.emit("newpath", null, settings.gamepath); - } + if (! forcedialog) { + function setGamepath(folder, forcedialog) { + settings.gamepath = folder; + settings.zip = path.join(settings.gamepath + "/northstar.zip"); + saveSettings(); + win.webContents.send("newpath", settings.gamepath); + ipcMain.emit("newpath", null, settings.gamepath); + } - let gamepath = await findgame(); - if (gamepath) { - setGamepath(gamepath); - return; - } + let gamepath = await findgame(); + if (gamepath) { + setGamepath(gamepath); + return; + } - alert(lang("general.missingpath")); + winAlert(lang("general.missingpath")); + } // Fallback to manual selection dialog.showOpenDialog({properties: ["openDirectory"]}).then(res => { -- cgit v1.2.3 From 61f9bc80b33ff4a3d9397640db7ca82f7bb79861 Mon Sep 17 00:00:00 2001 From: 0neGal Date: Tue, 25 Jan 2022 22:08:23 +0100 Subject: changed French localization, remove .vscode/ --- .vscode/launch.json | 17 ----------------- src/lang/fr.json | 2 +- 2 files changed, 1 insertion(+), 18 deletions(-) delete mode 100644 .vscode/launch.json (limited to 'src/lang') diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index ef3f9b3..0000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "version": "0.2.0", - "configurations": [ - { - "name": "Debug Main Process", - "type": "node", - "request": "launch", - "cwd": "${workspaceFolder}", - "runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron", - "windows": { - "runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron.cmd" - }, - "args" : ["."], - "outputCapture": "std" - } - ] - } \ No newline at end of file diff --git a/src/lang/fr.json b/src/lang/fr.json index 1ba7acf..2fbc89a 100644 --- a/src/lang/fr.json +++ b/src/lang/fr.json @@ -42,7 +42,7 @@ "gui.versions.northstar": "Version de Northstar", "gui.exit": "Fermer", "gui.update": "Mise à jour", - "gui.setpath": "Chemin du jeu", + "gui.setpath": "Mettre à jour le chemin du jeu", "gui.update.check": "Vérifier les mises à jour", "gui.mods": "Mods", -- cgit v1.2.3