diff --git a/src-tauri/src/commands/config.rs b/src-tauri/src/commands/config.rs index 091b1904..ebc6c382 100644 --- a/src-tauri/src/commands/config.rs +++ b/src-tauri/src/commands/config.rs @@ -620,3 +620,15 @@ pub async fn set_rip_streamed_audio_enabled( })?; Ok(()) } + +#[tauri::command] +pub async fn get_proceed_after_successful_operation( + config: tauri::State<'_, tokio::sync::Mutex>, +) -> Result { + let config_lock = config.lock().await; + Ok( + config_lock + .proceed_after_successful_operation + .unwrap_or(true), + ) +} diff --git a/src-tauri/src/config.rs b/src-tauri/src/config.rs index d416827e..6c6be439 100644 --- a/src-tauri/src/config.rs +++ b/src-tauri/src/config.rs @@ -198,6 +198,7 @@ pub struct LauncherConfig { pub mod_sources: Option>, pub decompiler_settings: Option, pub check_for_latest_mod_version: Option, + pub proceed_after_successful_operation: Option, } fn default_version() -> Option { @@ -224,6 +225,7 @@ impl LauncherConfig { mod_sources: None, decompiler_settings: Some(DecompilerSettings::default()), check_for_latest_mod_version: Some(true), + proceed_after_successful_operation: Some(true), } } diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index c7a225bf..3bddcce8 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -166,6 +166,7 @@ fn main() { commands::config::does_active_tooling_version_meet_minimum, commands::config::does_active_tooling_version_support_game, commands::config::finalize_installation, + commands::config::get_proceed_after_successful_operation, commands::config::get_active_tooling_version_folder, commands::config::get_active_tooling_version, commands::config::get_bypass_requirements, diff --git a/src/components/games/job/GameJob.svelte b/src/components/games/job/GameJob.svelte index 2b679729..2deded6d 100644 --- a/src/components/games/job/GameJob.svelte +++ b/src/components/games/job/GameJob.svelte @@ -13,6 +13,7 @@ } from "$lib/rpc/binaries"; import { finalizeInstallation, + getProceedAfterSuccessfulOperation, setEnabledTexturePacks, } from "$lib/rpc/config"; import { generateSupportPackage } from "$lib/rpc/support"; @@ -44,8 +45,18 @@ const dispatch = createEventDispatcher(); let installationError: string | undefined | null = undefined; + let proceedAfterSuccessfulOperation = true; - $: if ($progressTracker.overallStatus === "success") { + onMount(async () => { + proceedAfterSuccessfulOperation = + await getProceedAfterSuccessfulOperation(); + console.log(proceedAfterSuccessfulOperation); + }); + + $: if ( + $progressTracker.overallStatus === "success" && + proceedAfterSuccessfulOperation + ) { dispatch("jobFinished"); } @@ -480,7 +491,17 @@ -{#if $progressTracker.overallStatus === "failed"} +{#if $progressTracker.overallStatus === "success" && !proceedAfterSuccessfulOperation} +
+
+ +
+
+{:else if $progressTracker.overallStatus === "failed"}
diff --git a/src/components/games/setup/GameSetup.svelte b/src/components/games/setup/GameSetup.svelte index fca1a54d..aea940de 100644 --- a/src/components/games/setup/GameSetup.svelte +++ b/src/components/games/setup/GameSetup.svelte @@ -17,6 +17,7 @@ isDiskSpaceRequirementMet, isOpenGLRequirementMet, isMinimumVCCRuntimeInstalled, + getProceedAfterSuccessfulOperation, } from "$lib/rpc/config"; import { progressTracker } from "$lib/stores/ProgressStore"; import { generateSupportPackage } from "$lib/rpc/support"; @@ -30,10 +31,13 @@ let requirementsMet = true; let installing = false; let installationError = undefined; + let proceedAfterSuccessfulOperation = true; onMount(async () => { // Check requirements await checkRequirements(); + proceedAfterSuccessfulOperation = + await getProceedAfterSuccessfulOperation(); }); async function checkRequirements() { @@ -117,7 +121,10 @@ } } - $: if ($progressTracker.overallStatus === "success") { + $: if ( + $progressTracker.overallStatus === "success" && + proceedAfterSuccessfulOperation + ) { dispatch("change"); } @@ -129,7 +136,17 @@
- {#if $progressTracker.overallStatus === "failed"} + {#if $progressTracker.overallStatus === "success" && !proceedAfterSuccessfulOperation} +
+
+ +
+
+ {:else if $progressTracker.overallStatus === "failed"}
{ return await invoke_rpc("is_rip_streamed_audio_enabled", {}, () => false); } +export async function getProceedAfterSuccessfulOperation(): Promise { + return await invoke_rpc( + "get_proceed_after_successful_operation", + {}, + () => true, + ); +} + export async function setRipStreamedAudioEnabled( enabled: boolean, ): Promise {