Skip to content

Commit

Permalink
refactor: Make launching via Steam an arg passed to backend
Browse files Browse the repository at this point in the history
instead of a separate dedicated function
  • Loading branch information
GeckoEidechse committed Jan 17, 2024
1 parent fe5887f commit c3e1f45
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
1 change: 0 additions & 1 deletion src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
7 changes: 6 additions & 1 deletion src-tauri/src/northstar/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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>,
Expand Down
2 changes: 1 addition & 1 deletion src-vue/src/plugins/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
})
Expand Down

0 comments on commit c3e1f45

Please sign in to comment.