diff options
author | GeckoEidechse <40122905+GeckoEidechse@users.noreply.github.com> | 2024-01-17 02:41:15 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-17 02:41:15 +0100 |
commit | 18a82df7e991ce64586bcc32afa184cbe7f9aa41 (patch) | |
tree | 2293307dbb8d2920a25e78a25219ded708a406b1 | |
parent | 49eb3c92b1116b6d8c3d5dceb7b2deabc504803a (diff) | |
download | FlightCore-18a82df7e991ce64586bcc32afa184cbe7f9aa41.tar.gz FlightCore-18a82df7e991ce64586bcc32afa184cbe7f9aa41.zip |
refactor: Make launching via Steam an arg passed to backend (#753)
instead of a separate dedicated function
-rw-r--r-- | src-tauri/src/main.rs | 1 | ||||
-rw-r--r-- | src-tauri/src/northstar/mod.rs | 7 | ||||
-rw-r--r-- | src-vue/src/plugins/store.ts | 2 |
3 files changed, 7 insertions, 3 deletions
diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index cda3dae7..a2e293b0 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -137,7 +137,6 @@ fn main() { northstar::install::find_game_install_location, northstar::install::install_northstar_wrapper, northstar::install::update_northstar, - northstar::launch_northstar_steam, northstar::launch_northstar, northstar::profile::delete_profile, northstar::profile::fetch_profiles, diff --git a/src-tauri/src/northstar/mod.rs b/src-tauri/src/northstar/mod.rs index e707849e..ea4f4cde 100644 --- a/src-tauri/src/northstar/mod.rs +++ b/src-tauri/src/northstar/mod.rs @@ -154,10 +154,16 @@ pub fn get_northstar_version_number(game_install: GameInstall) -> Result<String, #[tauri::command] pub fn launch_northstar( game_install: GameInstall, + launch_via_steam: Option<bool>, bypass_checks: Option<bool>, ) -> Result<String, String> { dbg!(game_install.clone()); + let launch_via_steam = launch_via_steam.unwrap_or(false); + if launch_via_steam { + return launch_northstar_steam(game_install, bypass_checks); + } + let host_os = get_host_os(); // Explicitly fail early certain (currently) unsupported install setups @@ -222,7 +228,6 @@ pub fn launch_northstar( } /// Prepare Northstar and Launch through Steam using the Browser Protocol -#[tauri::command] pub fn launch_northstar_steam( game_install: GameInstall, _bypass_checks: Option<bool>, diff --git a/src-vue/src/plugins/store.ts b/src-vue/src/plugins/store.ts index 56bf37e9..a1a67e2b 100644 --- a/src-vue/src/plugins/store.ts +++ b/src-vue/src/plugins/store.ts @@ -241,7 +241,7 @@ export const store = createStore<FlightCoreStore>({ } }, async launchGameSteam(state: any, no_checks = false) { - await invoke("launch_northstar_steam", { gameInstall: state.game_install, bypassChecks: no_checks }) + await invoke("launch_northstar", { gameInstall: state.game_install, launchViaSteam: true, bypassChecks: no_checks }) .then((message) => { showNotification('Success'); }) |