diff options
-rw-r--r-- | src/lang/en.json | 3 | ||||
-rw-r--r-- | src/utils.js | 35 |
2 files changed, 37 insertions, 1 deletions
diff --git a/src/lang/en.json b/src/lang/en.json index aa76cdf..61a8545 100644 --- a/src/lang/en.json +++ b/src/lang/en.json @@ -71,5 +71,6 @@ "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 path is not set!", + "general.notinstalled": "Northstar is not installed!" } diff --git a/src/utils.js b/src/utils.js index 67aee02..68cd6c1 100644 --- a/src/utils.js +++ b/src/utils.js @@ -184,6 +184,13 @@ function winAlert(msg) { let modpath = path.join(settings.gamepath, "R2Northstar/mods"); const mods = { list: () => { + if (getNSVersion() == "unknown") { + winLog(lang("general.notinstalled")) + console.log("error: " + lang("general.notinstalled")) + cli.exit(1); + return false; + } + let mods = []; let disabled = []; @@ -227,6 +234,13 @@ const mods = { }; }, get: (mod) => { + if (getNSVersion() == "unknown") { + winLog(lang("general.notinstalled")) + console.log("error: " + lang("general.notinstalled")) + cli.exit(1); + return false; + } + let list = mods.list().all; for (let i = 0; i < list.length; i++) { @@ -238,6 +252,13 @@ const mods = { return false; }, install: (mod) => { + if (getNSVersion() == "unknown") { + winLog(lang("general.notinstalled")) + console.log("error: " + lang("general.notinstalled")) + cli.exit(1); + return false; + } + let notamod = () => { winLog(lang("gui.mods.notamod")) console.log("error: " + lang("cli.mods.notamod")) @@ -305,6 +326,13 @@ const mods = { } }, remove: (mod) => { + if (getNSVersion() == "unknown") { + winLog(lang("general.notinstalled")) + console.log("error: " + lang("general.notinstalled")) + cli.exit(1); + return false; + } + if (mod == "allmods") { let modlist = mods.list().all; for (let i = 0; i < modlist.length; i++) { @@ -341,6 +369,13 @@ const mods = { } }, toggle: (mod, fork) => { + if (getNSVersion() == "unknown") { + winLog(lang("general.notinstalled")) + console.log("error: " + lang("general.notinstalled")) + cli.exit(1); + return false; + } + if (mod == "allmods") { let modlist = mods.list().all; for (let i = 0; i < modlist.length; i++) { |