From d167ef54cb8f43fff89405d26e208486a1801c12 Mon Sep 17 00:00:00 2001 From: Sabarigirish Manikandan Date: Sun, 9 Nov 2025 20:16:03 +0530 Subject: [PATCH 1/2] feat: implement command line arguments --- src-tauri/bindings/NorthstarLaunchOptions.ts | 2 +- src-tauri/src/northstar/mod.rs | 3 ++- src-vue/package-lock.json | 10 ++++++++-- src-vue/src/i18n/lang/en.json | 5 +++++ src-vue/src/plugins/store.ts | 10 ++++++++-- src-vue/src/views/SettingsView.vue | 16 ++++++++++++++++ 6 files changed, 40 insertions(+), 6 deletions(-) diff --git a/src-tauri/bindings/NorthstarLaunchOptions.ts b/src-tauri/bindings/NorthstarLaunchOptions.ts index 6133f6c02..36446951f 100644 --- a/src-tauri/bindings/NorthstarLaunchOptions.ts +++ b/src-tauri/bindings/NorthstarLaunchOptions.ts @@ -1,3 +1,3 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export type NorthstarLaunchOptions = { launch_via_steam: boolean, bypass_checks: boolean, }; +export type NorthstarLaunchOptions = { launch_via_steam: boolean, bypass_checks: boolean, cmd_args: string, }; diff --git a/src-tauri/src/northstar/mod.rs b/src-tauri/src/northstar/mod.rs index 9953d742e..d4b9257cb 100644 --- a/src-tauri/src/northstar/mod.rs +++ b/src-tauri/src/northstar/mod.rs @@ -15,6 +15,7 @@ use ts_rs::TS; pub struct NorthstarLaunchOptions { launch_via_steam: bool, bypass_checks: bool, + cmd_args: String, } /// Gets list of available Northstar versions from Thunderstore @@ -215,7 +216,7 @@ pub fn launch_northstar( let ns_profile_arg = format!("-profile={}", game_install.profile); let mut output = std::process::Command::new("C:\\Windows\\System32\\cmd.exe") - .args(["/C", "start", "", &ns_exe_path, &ns_profile_arg]) + .args(["/C", "start", "", &ns_exe_path, &ns_profile_arg]).args(launch_options.cmd_args.split(" ")) .spawn() .expect("failed to execute process"); output.wait().expect("failed waiting on child process"); diff --git a/src-vue/package-lock.json b/src-vue/package-lock.json index cdda637f7..2d10319b7 100644 --- a/src-vue/package-lock.json +++ b/src-vue/package-lock.json @@ -275,6 +275,7 @@ "resolved": "https://registry.npmjs.org/@types/lodash-es/-/lodash-es-4.17.12.tgz", "integrity": "sha512-0NgftHUcV4v34VhXm8QBSftKVXtbkBG3ViCjs6+eJ5a6y6Mi/jiFGPc1sC7QK+9BFhWrURE3EOggmWaSxL9OzQ==", "license": "MIT", + "peer": true, "dependencies": { "@types/lodash": "*" } @@ -1103,13 +1104,15 @@ "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/lodash-es": { "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.21.tgz", "integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/lodash-unified": { "version": "1.0.3", @@ -1322,6 +1325,7 @@ "integrity": "sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==", "devOptional": true, "license": "Apache-2.0", + "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -1336,6 +1340,7 @@ "integrity": "sha512-K/jGKL/PgbIgKCiJo5QbASQhFiV02X9Jh+Qq0AKCRCRKZtOTVi4t6wh75FDpGf2N9rYOnzH87OEFQNaFy6pdxQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "esbuild": "^0.15.9", "postcss": "^8.4.18", @@ -1392,6 +1397,7 @@ "resolved": "https://registry.npmjs.org/vue/-/vue-3.5.13.tgz", "integrity": "sha512-wmeiSMxkZCSc+PM2w2VRsOYAZC8GdipNFRTsLSfodVqI9mbejKeXEGr8SckuLnrQPGe3oJN5c3K0vpoU9q/wCQ==", "license": "MIT", + "peer": true, "dependencies": { "@vue/compiler-dom": "3.5.13", "@vue/compiler-sfc": "3.5.13", diff --git a/src-vue/src/i18n/lang/en.json b/src-vue/src/i18n/lang/en.json index 4f32e082f..fe8aa2ce5 100644 --- a/src-vue/src/i18n/lang/en.json +++ b/src-vue/src/i18n/lang/en.json @@ -121,6 +121,11 @@ "show_deprecated_mods_desc2": "Watch out, such mods are usually deprecated for a good reason.", "show_nsfw_mods": "Show NSFW Thunderstore mods", + "cmd_args": { + "title": "Northstar command line arguments", + "placeholder": "-novid" + }, + "profile": { "active": "Active Profile", "edit": "Edit Profiles", diff --git a/src-vue/src/plugins/store.ts b/src-vue/src/plugins/store.ts index dcd6a211b..2c3b626ae 100644 --- a/src-vue/src/plugins/store.ts +++ b/src-vue/src/plugins/store.ts @@ -179,7 +179,7 @@ export const store = createStore({ } } }, - async launchGame(state: any, launch_options: NorthstarLaunchOptions = { launch_via_steam: false, bypass_checks: false}) { + async launchGame(state: any, launch_options: NorthstarLaunchOptions = { launch_via_steam: false, bypass_checks: false, cmd_args: state.command_line_args }) { if (launch_options.bypass_checks) { await invoke("launch_northstar", { gameInstall: state.game_install, launchOptions: launch_options }) @@ -248,7 +248,7 @@ export const store = createStore({ break; } }, - async launchGameSteam(state: any, launch_options: NorthstarLaunchOptions = { launch_via_steam: true, bypass_checks: false}) { + async launchGameSteam(state: any, launch_options: NorthstarLaunchOptions = { launch_via_steam: true, bypass_checks: false, cmd_args: state.command_line_args }) { await invoke("launch_northstar", { gameInstall: state.game_install, launchOptions: launch_options }) .then((_message) => { showNotification('Success'); @@ -403,6 +403,12 @@ async function _initializeApp(state: any) { state.mods_per_page = perPageFromStore.value; } + // Grab "Northstar command line arguments" setting from store if possible + const commandLineArgs: { value: String } | null | undefined = await persistentStore.get('northstar-command-line-args'); + if (commandLineArgs) { + state.command_line_args = commandLineArgs.value; + } + // Get FlightCore version number state.flightcore_version = await invoke("get_flightcore_version_number"); diff --git a/src-vue/src/views/SettingsView.vue b/src-vue/src/views/SettingsView.vue index 874c0f9c4..3ac1da19c 100644 --- a/src-vue/src/views/SettingsView.vue +++ b/src-vue/src/views/SettingsView.vue @@ -51,6 +51,12 @@ + +
+

{{$t('settings.cmd_args.title')}}

+ +
+

{{ $t('settings.profile.active') }}

@@ -210,6 +216,16 @@ export default defineComponent({ await persistentStore.save(); // explicit save to disk } }, + commandLineArgs: { + get(): String { + return this.$store.state.command_line_args; + }, + async set(value: String) { + this.$store.state.command_line_args = value; + persistentStore.set('northstar-command-line-args', { value }); + await persistentStore.save(); + } + }, activeProfile(): String { return this.$store.state.game_install.profile || "None"; }, From 8386ccfc96a158b1fda51fc7b0e53d886587b6b8 Mon Sep 17 00:00:00 2001 From: Sabarigirish Manikandan Date: Sun, 9 Nov 2025 21:20:04 +0530 Subject: [PATCH 2/2] feat: update translations for cmd args --- src-tauri/src/northstar/mod.rs | 2 +- src-vue/src/i18n/lang/da.json | 4 ++++ src-vue/src/i18n/lang/de.json | 4 ++++ src-vue/src/i18n/lang/es.json | 4 ++++ src-vue/src/i18n/lang/fr.json | 4 ++++ src-vue/src/i18n/lang/it.json | 4 ++++ src-vue/src/i18n/lang/pl.json | 4 ++++ src-vue/src/i18n/lang/ru.json | 4 ++++ src-vue/src/i18n/lang/zh_Hans.json | 4 ++++ 9 files changed, 33 insertions(+), 1 deletion(-) diff --git a/src-tauri/src/northstar/mod.rs b/src-tauri/src/northstar/mod.rs index d4b9257cb..08bc829c3 100644 --- a/src-tauri/src/northstar/mod.rs +++ b/src-tauri/src/northstar/mod.rs @@ -216,7 +216,7 @@ pub fn launch_northstar( let ns_profile_arg = format!("-profile={}", game_install.profile); let mut output = std::process::Command::new("C:\\Windows\\System32\\cmd.exe") - .args(["/C", "start", "", &ns_exe_path, &ns_profile_arg]).args(launch_options.cmd_args.split(" ")) + .args(["/C", "start", "", &ns_exe_path, &ns_profile_arg]).args(launch_options.cmd_args.split(" ").map(|a| a.trim())) .spawn() .expect("failed to execute process"); output.wait().expect("failed waiting on child process"); diff --git a/src-vue/src/i18n/lang/da.json b/src-vue/src/i18n/lang/da.json index 33486bcef..02acbbb55 100644 --- a/src-vue/src/i18n/lang/da.json +++ b/src-vue/src/i18n/lang/da.json @@ -103,6 +103,10 @@ "title": "Profiler" } }, + "cmd_args": { + "title": "Northstar command line argumenter", + "placeholder": "-novid" + }, "repair": { "title": "Reparere", "open_window": "Åbn reparationsvinduet", diff --git a/src-vue/src/i18n/lang/de.json b/src-vue/src/i18n/lang/de.json index 61e759b60..def18a627 100644 --- a/src-vue/src/i18n/lang/de.json +++ b/src-vue/src/i18n/lang/de.json @@ -116,6 +116,10 @@ "disable_modsettings": "Deaktiviere den ModSettings Mod" } }, + "cmd_args": { + "title": "Northstar command line argumenten", + "placeholder": "-novid" + }, "show_deprecated_mods_desc1": "Damit werden veraltete Mods in der Online-Mods-Ansicht sichtbar.", "show_deprecated_mods_desc2": "Aber Vorsicht, solche Mods sind normalerweise aus gutem Grund als veraltet markiert.", "show_deprecated_mods": "Veraltete Thunderstore mods anzeigen", diff --git a/src-vue/src/i18n/lang/es.json b/src-vue/src/i18n/lang/es.json index 2b4d255cf..daff7ae28 100644 --- a/src-vue/src/i18n/lang/es.json +++ b/src-vue/src/i18n/lang/es.json @@ -108,6 +108,10 @@ "clone": "Duplicar" } }, + "cmd_args": { + "title": "Northstar command line argumentos", + "placeholder": "-novid" + }, "repair": { "title": "Reparar", "window": { diff --git a/src-vue/src/i18n/lang/fr.json b/src-vue/src/i18n/lang/fr.json index da9c2b1a0..a4dcce06e 100644 --- a/src-vue/src/i18n/lang/fr.json +++ b/src-vue/src/i18n/lang/fr.json @@ -116,6 +116,10 @@ "kill_northstar_process": "Arrêter le processus en cous de Northstar/Titanfall2" } }, + "cmd_args": { + "title": "Northstar command line arguments", + "placeholder": "-novid" + }, "show_deprecated_mods": "Montrer les mods Thunderstore dépréciés", "show_deprecated_mods_desc1": "Ce paramètre vous permet d'afficher les mods Thunderstore dépréciés dans la collection de mods.", "show_deprecated_mods_desc2": "Attention, les mods dépréciés le sont généralement pour une bonne raison.", diff --git a/src-vue/src/i18n/lang/it.json b/src-vue/src/i18n/lang/it.json index 9da8ce8d6..47ad49a3c 100644 --- a/src-vue/src/i18n/lang/it.json +++ b/src-vue/src/i18n/lang/it.json @@ -147,6 +147,10 @@ "disable_modsettings": "Disabilita la mod ModSettings" } }, + "cmd_args": { + "title": "Northstar command line argomenti", + "placeholder": "-novid" + }, "profile": { "active": "Profilo attivo", "dialog": { diff --git a/src-vue/src/i18n/lang/pl.json b/src-vue/src/i18n/lang/pl.json index 175d6eb33..e270f4f7a 100644 --- a/src-vue/src/i18n/lang/pl.json +++ b/src-vue/src/i18n/lang/pl.json @@ -114,6 +114,10 @@ "kill_northstar_process": "Zamknij uruchomiony proces Northstar/Titanfall2" } }, + "cmd_args": { + "title": "Northstar command line argumenty", + "placeholder": "-novid" + }, "nb_ts_mods_per_page_desc1": "Ma to wpływ na wydajność wyświetlania podczas przeglądania modów Thunderstore.", "open_game_folder": "Otwórz folder", "show_deprecated_mods_desc2": "Ostrożnie, mody są zazwyczaj oznaczone jako przestarzałe nie bez powodu.", diff --git a/src-vue/src/i18n/lang/ru.json b/src-vue/src/i18n/lang/ru.json index b02612995..ca67a3b2f 100644 --- a/src-vue/src/i18n/lang/ru.json +++ b/src-vue/src/i18n/lang/ru.json @@ -110,6 +110,10 @@ }, "title": "Фиксы" }, + "cmd_args": { + "title": "Аргументы командной строки Northstar", + "placeholder": "-novid" + }, "nb_ts_mods_per_page_desc1": "Это влияет на производительность при просмотре модов с Thunderstore.", "about": "Информация:", "nb_ts_mods_per_page": "Количество модов Thunderstore на каждую страницу", diff --git a/src-vue/src/i18n/lang/zh_Hans.json b/src-vue/src/i18n/lang/zh_Hans.json index dca36f98e..f7b0b34d1 100644 --- a/src-vue/src/i18n/lang/zh_Hans.json +++ b/src-vue/src/i18n/lang/zh_Hans.json @@ -100,6 +100,10 @@ "show_deprecated_mods": "显示已弃用的Thunderstore模组", "show_deprecated_mods_desc1": "该选项会使您可以在线上模组合集中看到已弃用的模组。", "show_deprecated_mods_desc2": "请注意,这类模组被弃用一般是有原因的。", + "cmd_args": { + "title": "Northstar 命令行参数", + "placeholder": "-novid" + }, "repair": { "title": "修复", "window": {