aboutsummaryrefslogtreecommitdiff
path: root/src/index.js
diff options
context:
space:
mode:
author0neGal <mail@0negal.com>2022-02-13 23:32:44 +0100
committerGitHub <noreply@github.com>2022-02-13 23:32:44 +0100
commit9f2f77558238c28ceb8ff4fca2096602671779e5 (patch)
treec15586b60de31de094c2f811832ef9ad6df2f50a /src/index.js
parent057b60f4843798441ad441370381b87299d5ad7f (diff)
parentb2f826a39e8ecf77f85ca56906758edaa3f1dac3 (diff)
downloadViper-9f2f77558238c28ceb8ff4fca2096602671779e5.tar.gz
Viper-9f2f77558238c28ceb8ff4fca2096602671779e5.zip
Merge branch 'main' into enabledmods
Diffstat (limited to 'src/index.js')
-rw-r--r--src/index.js16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/index.js b/src/index.js
index 3f50840..a06cf69 100644
--- a/src/index.js
+++ b/src/index.js
@@ -8,7 +8,7 @@ const events = new Emitter();
const utils = require("./utils");
const cli = require("./cli");
-const requests = require("./requests");
+const requests = require("./extras/requests");
// Starts the actual BrowserWindow, which is only run when using the
// GUI, for the CLI this function is never called.
@@ -43,9 +43,13 @@ function start() {
ipcMain.on("exit", () => {process.exit(0)})
ipcMain.on("minimize", () => {win.minimize()})
+ ipcMain.on("installfromurl", (event, url) => {utils.mods.installFromURL(url)})
ipcMain.on("winLog", (event, ...args) => {win.webContents.send("log", ...args)});
ipcMain.on("winAlert", (event, ...args) => {win.webContents.send("alert", ...args)});
ipcMain.on("ns-update-event", (event) => win.webContents.send("ns-update-event", event));
+ ipcMain.on("failedmod", (event, modname) => {win.webContents.send("failedmod", modname)});
+ ipcMain.on("removedmod", (event, modname) => {win.webContents.send("removedmod", modname)});
+ ipcMain.on("installedmod", (event, modname) => {win.webContents.send("installedmod", modname)});
ipcMain.on("guigetmods", (event, ...args) => {win.webContents.send("mods", utils.mods.list())});
win.webContents.on("dom-ready", () => {
@@ -87,9 +91,13 @@ ipcMain.on("launchVanilla", (event) => {utils.launch("vanilla")})
ipcMain.on("update", (event) => {utils.update()})
ipcMain.on("setpathcli", (event) => {utils.setpath()});
ipcMain.on("setpath", (event, value) => {
- if (!value) {
- utils.setpath(win);
- } else if (!win.isVisible()) {
+ if (! value) {
+ if (! win.isVisible()) {
+ utils.setpath(win);
+ } else {
+ utils.setpath(win, true);
+ }
+ } else if (! win.isVisible()) {
win.show();
}
});