diff options
author | GitExample <git@example.com> | 2022-02-03 01:36:11 +0100 |
---|---|---|
committer | GitExample <git@example.com> | 2022-02-03 01:36:11 +0100 |
commit | a4b11903979fdb4c8b0f6dda8f7343e14c1ebe17 (patch) | |
tree | 408def0b839140c6004ba5099c3abf0cc2319bea /src/utils.js | |
parent | d3228ae7fad117a8313731107f572ba4879569b6 (diff) | |
download | Viper-a4b11903979fdb4c8b0f6dda8f7343e14c1ebe17.tar.gz Viper-a4b11903979fdb4c8b0f6dda8f7343e14c1ebe17.zip |
detection of installed mods, disabling buttons
When a new mod has been installed through the browser UI it's button is
changed from "Install" to "Re-Install" instantly. We also now disable
modding related buttons when updating NS, or when installing mods. This
should prevent issues.
Diffstat (limited to 'src/utils.js')
-rw-r--r-- | src/utils.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/utils.js b/src/utils.js index d1cc345..b54808d 100644 --- a/src/utils.js +++ b/src/utils.js @@ -444,12 +444,15 @@ const mods = { if (fs.existsSync(path.join(mod, "mod.json")) && fs.statSync(path.join(mod, "mod.json")).isFile()) { - copy.sync(mod, path.join(modpath, mod.replace(/^.*(\\|\/|\:)/, "")), { + let modname = mod.replace(/^.*(\\|\/|\:)/, ""); + copy.sync(mod, path.join(modpath, modname), { mode: true, cover: true, utimes: true, }); + ipcMain.emit("installedmod", "", modname); + return installed(); } else { files = fs.readdirSync(mod); |