diff options
Diffstat (limited to 'src/index.js')
-rw-r--r-- | src/index.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/index.js b/src/index.js index 198bc74..2a5ed2b 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()}) @@ -65,6 +70,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()) { |