diff options
author | 0neGal <mail@0negal.com> | 2022-06-07 17:23:33 +0200 |
---|---|---|
committer | 0neGal <mail@0negal.com> | 2022-06-07 17:24:41 +0200 |
commit | 59aa33289cebd63432904ac69fa7d9f4f2bc1b9c (patch) | |
tree | d937953babe0a2b40fcbc5dd1f55df2964db4bc8 | |
parent | 0944356fb64512396c46b374197fdfb2606aeb07 (diff) | |
download | Viper-59aa33289cebd63432904ac69fa7d9f4f2bc1b9c.tar.gz Viper-59aa33289cebd63432904ac69fa7d9f4f2bc1b9c.zip |
minor changes
Mostly syntax, but also a few fixes with how the settings system work,
and also a change in localization strings.
-rw-r--r-- | .gitignore | 3 | ||||
-rw-r--r-- | src/app/main.js | 1 | ||||
-rw-r--r-- | src/index.js | 7 | ||||
-rw-r--r-- | src/lang/en.json | 2 | ||||
-rw-r--r-- | src/utils.js | 31 |
5 files changed, 25 insertions, 19 deletions
@@ -1,3 +1,4 @@ +.vscode/ + dist/ node_modules/ -.vscode/
\ No newline at end of file diff --git a/src/app/main.js b/src/app/main.js index 647e5cd..9fb3191 100644 --- a/src/app/main.js +++ b/src/app/main.js @@ -14,6 +14,7 @@ var settings = { autolang: true, forcedlang: "en", autoupdate: true, + originkill: false, zip: "/northstar.zip", lang: navigator.language, excludes: [ diff --git a/src/index.js b/src/index.js index a566b57..2c03529 100644 --- a/src/index.js +++ b/src/index.js @@ -6,7 +6,6 @@ const { app, ipcMain, BrowserWindow, dialog } = require("electron"); const utils = require("./utils"); const cli = require("./cli"); const requests = require("./extras/requests"); -const { settings } = require("./utils"); var log = console.log; @@ -48,7 +47,7 @@ function start() { }; send = win.send; ipcMain.on("exit", () => { - if (settings.originkill) { + if (utils.settings.originkill) { utils.isOriginRunning().then((running) => { if (running) { utils.killOrigin().then(process.exit(0)) @@ -60,8 +59,8 @@ function start() { process.exit(0) } }); - ipcMain.on("minimize", () => { win.minimize() }); - ipcMain.on("relaunch", () => { app.relaunch(); app.exit() }); + ipcMain.on("minimize", () => {win.minimize()}); + ipcMain.on("relaunch", () => {app.relaunch(); app.exit()}); // passthrough to renderer from main ipcMain.on("win-log", (event, ...args) => {send("log", ...args)}); diff --git a/src/lang/en.json b/src/lang/en.json index 3ae6ff1..72711b8 100644 --- a/src/lang/en.json +++ b/src/lang/en.json @@ -105,7 +105,7 @@ "gui.settings.excludes.title": "Retain files on update", "gui.settings.excludes.desc": "When Northstar is updated, files specified here will not be overwritten by files from the new Northstar update, unless you know what you're changing, you should probably not change anything here. Each file is separated with a space.", "gui.settings.originkill.title": "Automatically quit Origin", - "gui.settings.originkill.desc": "When Viper exits, automatically quit Origin client too. Mirrors behavior of launching the game through Steam.", + "gui.settings.originkill.desc": "When Viper exits, automatically quit Origin client too.", "gui.update.downloading": "Downloading...", "gui.update.extracting": "Extracting update...", diff --git a/src/utils.js b/src/utils.js index 2fea3ea..6114ef1 100644 --- a/src/utils.js +++ b/src/utils.js @@ -29,6 +29,7 @@ var settings = { autolang: true, forcedlang: "en", autoupdate: true, + originkill: false, nsargs: "-multiple", zip: "/northstar.zip", @@ -37,9 +38,7 @@ var settings = { excludes: [ "ns_startup_args.txt", "ns_startup_args_dedi.txt" - ], - - originkill: false + ] } // Logs into the dev tools of the renderer @@ -103,7 +102,7 @@ async function isGameRunning() { }); } -//Check if origin client is running +// checks if any origin processes are running async function isOriginRunning() { return new Promise(resolve => { let procs = ["Origin.exe", "OriginClientService.exe"]; @@ -126,7 +125,7 @@ async function isOriginRunning() { }); } -//Kill origin client +// kill origin processes async function killOrigin() { return new Promise(resolve => { let proc = "Origin.exe"; //I'm pretty sure we only have to kill this one @@ -138,7 +137,7 @@ async function killOrigin() { })(); exec(cmd, (err, stdout) => { - //just try and fail silently if we don't find it w/e + // just try and fail silently if we don't find it w/e resolve(true); }); }); @@ -879,21 +878,27 @@ setInterval(() => { module.exports = { mods, - lang, winLog, - launch, + update, - setpath, updatevp, - settings, - saveSettings, getNSVersion, getTF2Version, + handleNorthstarUpdating, + + launch, + killOrigin, isGameRunning, isOriginRunning, - killOrigin, + + + settings, + saveSettings, + + setpath, gamepathExists, - handleNorthstarUpdating, + + lang, setlang: (lang) => { settings.lang = lang; saveSettings(); |