diff --git a/src-tauri/src/commands/install/mod.rs b/src-tauri/src/commands/install/mod.rs index fda2b82..07cb1d0 100644 --- a/src-tauri/src/commands/install/mod.rs +++ b/src-tauri/src/commands/install/mod.rs @@ -19,13 +19,8 @@ use types::InstallErr; /// ## Arguments /// /// * `game_path` - Absolute path to the game folder/directory. -/// * `is_launch_option_set` - Whether if steam launch option is already set or not. #[tauri::command] -pub async fn install( - window: tauri::Window, - game_path: String, - is_launch_option_set: bool, -) -> Result<(), InstallErr> { +pub async fn install(window: tauri::Window, game_path: String) -> Result<(), InstallErr> { println!("install command called"); // @@ -74,7 +69,7 @@ pub async fn install( // match install_bepinex::install_bepinex(game_path).await { - Ok(()) => {} + Ok(_) => {} Err(err) => return Err(err), } @@ -83,7 +78,7 @@ pub async fn install( // match install_mod::install_wbm_mod(game_path).await { - Ok(()) => {} + Ok(_) => {} Err(err) => return Err(err), } @@ -91,11 +86,9 @@ pub async fn install( // Set steam launch option if OS is linux or macOS // - if !is_launch_option_set { - match launch_options::unix_launch_option_setup(&window, game_path).await { - Ok(_) => {} - Err(err) => return Err(err), - } + match launch_options::unix_launch_option_setup(&window, game_path).await { + Ok(_) => {} + Err(err) => return Err(err), } // diff --git a/src/pages/Operation/Install.svelte b/src/pages/Operation/Install.svelte index 5db3761..046dc6a 100644 --- a/src/pages/Operation/Install.svelte +++ b/src/pages/Operation/Install.svelte @@ -90,11 +90,11 @@ {:else if lastInstallErr == InstallErr.FailedToSendLaunchOption} Failed to receive steam launch option data :( diff --git a/src/pages/Operation/logic.ts b/src/pages/Operation/logic.ts index 71a374b..a401043 100644 --- a/src/pages/Operation/logic.ts +++ b/src/pages/Operation/logic.ts @@ -11,31 +11,23 @@ function buttonClicked() { store.spinCog.set(true) } -interface InstallArgs { - gamePath?: string - isLaunchOptionSet?: boolean -} - /** * Calls the install command in the backend. * - * @param {InstallArgs} gamePath - Absolute path to the game directory in the steam library. Leave it empty to use default location. + * @param {string} gamePath - Absolute path to the game directory in the steam library. Leave it empty to use default location. */ -export function install(args: InstallArgs = {}) { +export function install(gamePath: string = "") { buttonClicked() // get stored gamePath if it's empty - if (!args.gamePath) { + if (!gamePath) { store.gamePath.update((value) => { - args.gamePath = value + gamePath = value return value }) } - invoke(COMMANDS.INSTALL, { - gamePath: args.gamePath || "", - isLaunchOptionSet: args.isLaunchOptionSet || false, - }) + invoke(COMMANDS.INSTALL, { gamePath }) .then(() => { store.wasInstallSuccessful.set(true) }) @@ -80,7 +72,7 @@ export function selectGamePathAndRun(type: "install" | "remove") { switch (type) { case "install": { - install({ gamePath: value }) + install(value) } case "remove": {