diff options
author | 0neGal <mail@0negal.com> | 2024-02-03 19:15:29 +0100 |
---|---|---|
committer | 0neGal <mail@0negal.com> | 2024-02-03 19:21:23 +0100 |
commit | 159e2f981bdbfd6a0589639424155d34b7a4cc91 (patch) | |
tree | b3c1dfa3aaeb989b88abea6c9fc927c5dad3c2f9 /src/modules/version.js | |
parent | 647bd1f6a76c834b3db9b70005f4b8365d1ded91 (diff) | |
download | Viper-159e2f981bdbfd6a0589639424155d34b7a4cc91.tar.gz Viper-159e2f981bdbfd6a0589639424155d34b7a4cc91.zip |
src/modules/settings.js now provides a function
This fixes a couple issues where the main process wouldn't actually get
changes made to the settings, this fixes that.
On top of this, changing settings is now done with `settings.set()`
There shouldn't be any breakage from this change, but I suppose it is
possible. Especially because the `settings()` function still does
contain backup options set, meaning `settings.nsargs` is technically
still valid, but dont expect it to actually be updated when that
variable is changed, its merely here to avoid any problems.
Diffstat (limited to 'src/modules/version.js')
-rw-r--r-- | src/modules/version.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/modules/version.js b/src/modules/version.js index 6195cad..da0a730 100644 --- a/src/modules/version.js +++ b/src/modules/version.js @@ -10,7 +10,7 @@ let version = {}; // if not installed it'll return "unknown" version.northstar = () => { // if NorthstarLauncher.exe doesn't exist, always return "unknown" - if (! fs.existsSync(path.join(settings.gamepath, "NorthstarLauncher.exe"))) { + if (! fs.existsSync(path.join(settings().gamepath, "NorthstarLauncher.exe"))) { return "unknown"; } @@ -30,7 +30,7 @@ version.northstar = () => { // checks version of mods for (let i = 0; i < versionFiles.length; i++) { - var versionFile = path.join(settings.gamepath, "R2Northstar/mods/", versionFiles[i],"/mod.json"); + var versionFile = path.join(settings().gamepath, "R2Northstar/mods/", versionFiles[i],"/mod.json"); if (fs.existsSync(versionFile)) { if (! fs.statSync(versionFile).isFile()) { add("unknown"); @@ -68,7 +68,7 @@ version.northstar = () => { // TODO: This file is present on Origin install, should check if it's // present with Steam install as well. version.titanfall = () => { - var versionFilePath = path.join(settings.gamepath, "gameversion.txt"); + var versionFilePath = path.join(settings().gamepath, "gameversion.txt"); if (fs.existsSync(versionFilePath)) { return fs.readFileSync(versionFilePath, "utf8"); } else { |