diff options
author | 0neGal <mail@0negal.com> | 2022-01-26 00:20:25 +0100 |
---|---|---|
committer | 0neGal <mail@0negal.com> | 2022-01-26 00:20:25 +0100 |
commit | 6a08872d134f3afa3f81b92fabe51bdbd91f375d (patch) | |
tree | afb0172e5d4a6c4b9e4644513e012fde9efe65f5 /src/utils.js | |
parent | 61f9bc80b33ff4a3d9397640db7ca82f7bb79861 (diff) | |
download | Viper-6a08872d134f3afa3f81b92fabe51bdbd91f375d.tar.gz Viper-6a08872d134f3afa3f81b92fabe51bdbd91f375d.zip |
fixed mods not updating after changing path
This also fixes mods not showing up after first install of NS
Diffstat (limited to 'src/utils.js')
-rw-r--r-- | src/utils.js | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/utils.js b/src/utils.js index fb94b92..0507921 100644 --- a/src/utils.js +++ b/src/utils.js @@ -339,7 +339,6 @@ function winAlert(msg) { // // We can both get list of disabled mods, remove/install/toggle mods and // other things akin to that, all kinds of mod related stuff -let modpath = path.join(settings.gamepath, "R2Northstar/mods"); const mods = { // Returns a list of mods // @@ -347,6 +346,8 @@ const mods = { // combination of the other two, enabled being enabled mods, and you // guessed it, disabled being disabled mods. list: () => { + let modpath = path.join(settings.gamepath, "R2Northstar/mods"); + if (getNSVersion() == "unknown") { winLog(lang("general.notinstalled")) console.log("error: " + lang("general.notinstalled")) @@ -413,6 +414,8 @@ const mods = { // the absolute basics will be provided and we can't know the // version or similar. get: (mod) => { + let modpath = path.join(settings.gamepath, "R2Northstar/mods"); + if (getNSVersion() == "unknown") { winLog(lang("general.notinstalled")) console.log("error: " + lang("general.notinstalled")) @@ -437,6 +440,8 @@ const mods = { // inside the zip or folder to see if buried in another folder or // not, as sometimes that's the case. install: (mod) => { + let modpath = path.join(settings.gamepath, "R2Northstar/mods"); + if (getNSVersion() == "unknown") { winLog(lang("general.notinstalled")) console.log("error: " + lang("general.notinstalled")) @@ -515,6 +520,8 @@ const mods = { // Takes in the names of the mod then removes it, no confirmation, // that'd be up to the GUI. remove: (mod) => { + let modpath = path.join(settings.gamepath, "R2Northstar/mods"); + if (getNSVersion() == "unknown") { winLog(lang("general.notinstalled")) console.log("error: " + lang("general.notinstalled")) @@ -565,6 +572,8 @@ const mods = { // you checked for if a mod is already disable and if not run the // function. However we currently have no need for that. toggle: (mod, fork) => { + let modpath = path.join(settings.gamepath, "R2Northstar/mods"); + if (getNSVersion() == "unknown") { winLog(lang("general.notinstalled")) console.log("error: " + lang("general.notinstalled")) |