diff options
author | 0neGal <mail@0negal.com> | 2022-05-03 00:03:05 +0200 |
---|---|---|
committer | 0neGal <mail@0negal.com> | 2022-05-03 00:03:05 +0200 |
commit | 32b033d6dac63cb6cf783394d20459dd44b9459a (patch) | |
tree | c7627a3c45f2a4f37975ac126a8d5a386ca3cbe4 /src/utils.js | |
parent | 547cd10bb77be6aee0eb781fd9de44c934772909 (diff) | |
download | Viper-32b033d6dac63cb6cf783394d20459dd44b9459a.tar.gz Viper-32b033d6dac63cb6cf783394d20459dd44b9459a.zip |
modfile. enable(), disable() and toggle() now work
Diffstat (limited to 'src/utils.js')
-rw-r--r-- | src/utils.js | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/utils.js b/src/utils.js index d1b1ebb..971ecd9 100644 --- a/src/utils.js +++ b/src/utils.js @@ -539,10 +539,20 @@ const mods = { fs.writeFileSync(file, JSON.stringify(names)) }, + disable: (mod) => { + let data = require(file); + data[mod] = false; + fs.writeFileSync(file, JSON.stringify(data)); + }, + enable: (mod) => { + let data = require(file); + data[mod] = true; + fs.writeFileSync(file, JSON.stringify(data)); + }, toggle: (mod) => { let data = require(file); - data[mod] = !data[mod]; - console.log(data) + data[mod] = ! data[mod]; + fs.writeFileSync(file, JSON.stringify(data)); }, get: () => { let enabled = []; @@ -901,8 +911,7 @@ const mods = { } }; -mods.modfile().gen(); -console.log(mods.modfile().toggle("EladNLG.HUDRevamp")) +console.log(mods.list()) setInterval(() => { if (gamepathExists()) { ipcMain.emit("guigetmods"); |