diff options
author | 0neGal <mail@0negal.com> | 2021-12-31 16:59:48 +0100 |
---|---|---|
committer | 0neGal <mail@0negal.com> | 2021-12-31 16:59:48 +0100 |
commit | 67b32b527aec8d36a4b6cca14677febc46f0e26d (patch) | |
tree | 47691134760f1cab6b9f7acbfb26a48d78326643 /src/index.js | |
parent | c5c63d6c8a81596d0dcf3e14e072ea14f4d0610c (diff) | |
parent | ba82a7e8e5bc90705649c859674caeb334996b81 (diff) | |
download | Viper-67b32b527aec8d36a4b6cca14677febc46f0e26d.tar.gz Viper-67b32b527aec8d36a4b6cca14677febc46f0e26d.zip |
Merge branch 'main' of 0neGal/viper into mod-support
Diffstat (limited to 'src/index.js')
-rw-r--r-- | src/index.js | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/src/index.js b/src/index.js index 3f301ae..2a5ed2b 100644 --- a/src/index.js +++ b/src/index.js @@ -1,6 +1,6 @@ const fs = require("fs"); const path = require("path"); -const { app, dialog, ipcMain, BrowserWindow } = require("electron"); +const { app, dialog, ipcMain, BrowserWindow, ipcRenderer } = require("electron"); const Emitter = require("events"); const events = new Emitter(); @@ -17,7 +17,7 @@ function start() { title: "Viper", resizable: false, titleBarStyle: "hidden", - icon: path.join(__dirname, 'assets/icons/512x512.png'), + icon: path.join(__dirname, "assets/icons/512x512.png"), webPreferences: { nodeIntegration: true, contextIsolation: false, @@ -53,7 +53,22 @@ ipcMain.on("setlang", (event, lang) => {utils.setlang(lang)}) ipcMain.on("launchVanilla", (event) => {utils.launch("vanilla")}) ipcMain.on("update", (event) => {utils.update()}) -ipcMain.on("setpathcli", (event) => {utils.setpath()}) +ipcMain.on("setpathcli", (event) => {utils.setpath()}); + +ipcMain.on("getversion", () => { + win.webContents.send("version", { + ns: utils.getNSVersion(), + vp: "v" + require("../package.json").version + }); +}); + +ipcMain.on("versioncli", () => { + console.log("Viper: v" + require("../package.json").version); + console.log("Northstar: " + utils.getNSVersion()); + console.log("Node: " + process.version); + console.log("Electron: v" + process.versions.electron); + cli.exit(); +}) ipcMain.on("getmods", (event) => { let mods = utils.mods.list(); |