diff options
author | 0neGal <mail@0negal.com> | 2022-01-08 15:35:48 +0100 |
---|---|---|
committer | 0neGal <mail@0negal.com> | 2022-01-08 15:35:48 +0100 |
commit | 215f37c6fa16c81020c7256133b0058b1b0a98d8 (patch) | |
tree | 2c1645213fda795f5ea668d98de9a0cf285f7c78 /src | |
parent | 66e1499c3db2af9ec2002ae18b62892bbece992d (diff) | |
download | Viper-215f37c6fa16c81020c7256133b0058b1b0a98d8.tar.gz Viper-215f37c6fa16c81020c7256133b0058b1b0a98d8.zip |
mod support is disables if NS is not installed
Diffstat (limited to 'src')
-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++) { |