diff options
Diffstat (limited to 'src/index.js')
-rw-r--r-- | src/index.js | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/index.js b/src/index.js index b43611d..511aadb 100644 --- a/src/index.js +++ b/src/index.js @@ -42,6 +42,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()); + }); if (utils.settings.autoupdate) {utils.updatevp(false)} @@ -52,7 +57,6 @@ function start() { ipcMain.on("updatenow", () => { autoUpdater.quitAndInstall(); }) - } ipcMain.on("launch", (event) => {utils.launch()}) @@ -77,6 +81,20 @@ ipcMain.on("versioncli", () => { cli.exit(); }) +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()) { |