aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/app/main.js6
-rw-r--r--src/modules/launch.js12
-rw-r--r--src/modules/settings.js9
3 files changed, 14 insertions, 13 deletions
diff --git a/src/app/main.js b/src/app/main.js
index 3ee95ce..f5fe19f 100644
--- a/src/app/main.js
+++ b/src/app/main.js
@@ -75,9 +75,9 @@ if (fs.existsSync("viper.json")) {
// filepath to Northstar's startup args file
let args = path.join(settings.gamepath, "ns_startup_args.txt");
- // check file exists
- if (fs.existsSync(args)) {
- // load file into `settings`
+ // check file exists, and that no `nsargs` setting was set
+ if (! settings.nsargs && fs.existsSync(args)) {
+ // load arguments from file into `settings`
settings.nsargs = fs.readFileSync(args, "utf8");
}
}
diff --git a/src/modules/launch.js b/src/modules/launch.js
index 24ea4b2..9238336 100644
--- a/src/modules/launch.js
+++ b/src/modules/launch.js
@@ -24,15 +24,23 @@ function launch(game_version) {
// change current directory to gamepath
process.chdir(settings.gamepath);
+ let launch_args = settings.nsargs || "";
+
// launch the requested game version
switch(game_version) {
case "vanilla":
console.info(lang("general.launching"), "Vanilla...");
- exec("Titanfall2.exe", {cwd: settings.gamepath});
+ exec("Titanfall2.exe " + launch_args, {
+ cwd: settings.gamepath
+ })
+
break;
default:
console.info(lang("general.launching"), "Northstar...");
- exec("NorthstarLauncher.exe", {cwd: settings.gamepath});
+ exec("NorthstarLauncher.exe " + launch_args, {
+ cwd: settings.gamepath
+ })
+
break;
}
}
diff --git a/src/modules/settings.js b/src/modules/settings.js
index 5476404..9d036cf 100644
--- a/src/modules/settings.js
+++ b/src/modules/settings.js
@@ -45,7 +45,7 @@ if (fs.existsSync("viper.json")) {
settings.zip = path.join(app.getPath("cache"), "vipertmp/northstar.zip");
let args = path.join(settings.gamepath, "ns_startup_args.txt");
- if (fs.existsSync(args)) {
+ if (! settings.nsargs && fs.existsSync(args)) {
settings.nsargs = fs.readFileSync(args, "utf8");
}
} else {
@@ -81,13 +81,6 @@ settings.save = (obj = {}, notify_renderer = true) => {
// set the settings obj for the main process
settings = settings_content;
-
- // write Northstar's startup arguments file
- if (fs.existsSync(settings.gamepath)) {
- fs.writeFileSync(path.join(
- settings.gamepath, "ns_startup_args.txt"
- ), settings.nsargs || "-multiple");
- }
if (notify_renderer) {
ipcMain.emit("saved-settings", settings_content);