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 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()) { |