aboutsummaryrefslogtreecommitdiff
path: root/src/index.js
diff options
context:
space:
mode:
author0neGal <mail@0negal.com>2023-01-12 23:34:54 +0100
committer0neGal <mail@0negal.com>2023-01-12 23:34:54 +0100
commit876962e00c1df15f3116ef552a6a2be456526dfc (patch)
treee90325b36467405fdbf35d7a50a671b5b327da11 /src/index.js
parent2889b310c18acc5fbc926d63659a624e4675fe57 (diff)
downloadViper-876962e00c1df15f3116ef552a6a2be456526dfc.tar.gz
Viper-876962e00c1df15f3116ef552a6a2be456526dfc.zip
put mods Object into src/modules/mods.js
Diffstat (limited to 'src/index.js')
-rw-r--r--src/index.js19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/index.js b/src/index.js
index c3d3556..16eebfe 100644
--- a/src/index.js
+++ b/src/index.js
@@ -8,6 +8,7 @@ process.chdir(app.getPath("appData"));
const utils = require("./utils");
const cli = require("./cli");
+const mods = require("./modules/mods");
const settings = require("./modules/settings");
const requests = require("./modules/requests");
@@ -74,7 +75,7 @@ function start() {
ipcMain.on("duped-mod", (event, modname) => {send("duped-mod", modname)});
ipcMain.on("failed-mod", (event, modname) => {send("failed-mod", modname)});
ipcMain.on("removed-mod", (event, modname) => {send("removed-mod", modname)});
- ipcMain.on("gui-getmods", (event, ...args) => {send("mods", utils.mods.list())});
+ ipcMain.on("gui-getmods", (event, ...args) => {send("mods", mods.list())});
ipcMain.on("installed-mod", (event, modname) => {send("installed-mod", modname)});
ipcMain.on("no-internet", () => {send("no-internet")});
@@ -84,11 +85,11 @@ function start() {
});
// install calls
- ipcMain.on("install-from-path", (event, path) => {utils.mods.install(path)});
- ipcMain.on("install-from-url", (event, url, author) => {utils.mods.installFromURL(url, author)});
+ ipcMain.on("install-from-path", (event, path) => {mods.install(path)});
+ ipcMain.on("install-from-url", (event, url, author) => {mods.installFromURL(url, author)});
win.webContents.on("dom-ready", () => {
- send("mods", utils.mods.list());
+ send("mods", mods.list());
});
// ensures gamepath still exists and is valid on startup
@@ -136,11 +137,11 @@ function start() {
// module inside the file that sent the event. {
ipcMain.on("install-mod", () => {
if (cli.hasArgs()) {
- utils.mods.install(cli.param("installmod"));
+ mods.install(cli.param("installmod"));
} else {
dialog.showOpenDialog({properties: ["openFile"]}).then(res => {
if (res.filePaths.length != 0) {
- utils.mods.install(res.filePaths[0]);
+ mods.install(res.filePaths[0]);
} else {
send("set-buttons", true);
}
@@ -148,8 +149,8 @@ ipcMain.on("install-mod", () => {
}
})
-ipcMain.on("remove-mod", (event, mod) => {utils.mods.remove(mod)});
-ipcMain.on("toggle-mod", (event, mod) => {utils.mods.toggle(mod)});
+ipcMain.on("remove-mod", (event, mod) => {mods.remove(mod)});
+ipcMain.on("toggle-mod", (event, mod) => {mods.toggle(mod)});
ipcMain.on("launch-ns", () => {utils.launch()});
ipcMain.on("launch-vanilla", () => {utils.launch("vanilla")});
@@ -193,7 +194,7 @@ ipcMain.on("version-cli", () => {
// sends installed mods info to renderer
ipcMain.on("getmods", () => {
- let mods = utils.mods.list();
+ let mods = mods.list();
if (mods.all.length > 0) {
log(`${utils.lang("general.mods.installed")} ${mods.all.length}`);
log(`${utils.lang("general.mods.enabled")} ${mods.enabled.length}`);