aboutsummaryrefslogtreecommitdiff
path: root/src/index.js
diff options
context:
space:
mode:
author0neGal <mail@0negal.com>2021-12-30 22:05:54 +0100
committer0neGal <mail@0negal.com>2021-12-30 22:05:54 +0100
commitee885beeed57d95ffb58922cfc6b826b7ebf9a31 (patch)
tree6cc217060683a950561b3e5da828d52f7b60c63a /src/index.js
parent823d34f6f41c65c7b1cb8e55bd429b9efc4f3878 (diff)
downloadViper-ee885beeed57d95ffb58922cfc6b826b7ebf9a31.tar.gz
Viper-ee885beeed57d95ffb58922cfc6b826b7ebf9a31.zip
first-ish draft of the mod UI and utils
Diffstat (limited to 'src/index.js')
-rw-r--r--src/index.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/index.js b/src/index.js
index c99e367..3f301ae 100644
--- a/src/index.js
+++ b/src/index.js
@@ -41,6 +41,11 @@ function start() {
ipcMain.on("ns-updated", () => {win.webContents.send("ns-updated")})
ipcMain.on("ns-updating", () => {win.webContents.send("ns-updating")})
ipcMain.on("winLog", (event, ...args) => {win.webContents.send("log", ...args)})
+ ipcMain.on("guigetmods", (event, ...args) => {win.webContents.send("mods", utils.mods.list())})
+
+ win.webContents.once("dom-ready", () => {
+ win.webContents.send("mods", utils.mods.list());
+ });
}
ipcMain.on("launch", (event) => {utils.launch()})
@@ -50,6 +55,20 @@ ipcMain.on("launchVanilla", (event) => {utils.launch("vanilla")})
ipcMain.on("update", (event) => {utils.update()})
ipcMain.on("setpathcli", (event) => {utils.setpath()})
+ipcMain.on("getmods", (event) => {
+ let mods = utils.mods.list();
+ if (mods.length > 0) {
+ console.log(`${utils.lang("general.mods.installed")} ${mods.length}`)
+ for (let i = 0; i < mods.length; i++) {
+ console.log(` ${mods[i].Name} ${mods[i].Version}`)
+ }
+ cli.exit(0);
+ } else {
+ console.log("No mods installed");
+ cli.exit(0);
+ }
+})
+
process.chdir(app.getPath("appData"));
if (cli.hasArgs()) {