diff options
author | 0neGal <mail@0negal.com> | 2023-03-05 00:52:49 +0100 |
---|---|---|
committer | 0neGal <mail@0negal.com> | 2023-03-05 00:52:49 +0100 |
commit | a5dd677c6e5e6c2cb3eec7a2edc08d15dfe43c7a (patch) | |
tree | e058daee9677f5820d3130f08a34cb9ccfd8442e /src/index.js | |
parent | 5d86a3daa5f762326055469b6bcd8346e0655056 (diff) | |
download | Viper-a5dd677c6e5e6c2cb3eec7a2edc08d15dfe43c7a.tar.gz Viper-a5dd677c6e5e6c2cb3eec7a2edc08d15dfe43c7a.zip |
show alert when updating with game running
This also fixes is_running not quite working on Linux
Diffstat (limited to 'src/index.js')
-rw-r--r-- | src/index.js | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/index.js b/src/index.js index 88e3ed9..d94b6a4 100644 --- a/src/index.js +++ b/src/index.js @@ -7,15 +7,19 @@ const { app, ipcMain, BrowserWindow, dialog } = require("electron"); process.chdir(app.getPath("appData")); const cli = require("./cli"); +const lang = require("./lang"); + const json = require("./modules/json"); const kill = require("./modules/kill"); const mods = require("./modules/mods"); const update = require("./modules/update"); const launch = require("./modules/launch"); +const win_show = require("./modules/window"); const version = require("./modules/version"); const gamepath = require("./modules/gamepath"); const settings = require("./modules/settings"); const requests = require("./modules/requests"); +const is_running = require("./modules/is_running"); var log = console.log; @@ -169,7 +173,15 @@ ipcMain.on("setlang", (event, lang) => { settings.save(); }); -ipcMain.on("update-northstar", () => {update.northstar()}) +ipcMain.on("update-northstar", async () => { + console.log(await is_running.game()) + if (await is_running.game()) { + return win_show.alert(lang("general.autoupdates.gamerunning")); + } + + update.northstar(); +}) + ipcMain.on("setpath-cli", () => {gamepath.set()}); ipcMain.on("setpath", (event, value) => { if (! value) { |