diff --git a/src/core/system.cpp b/src/core/system.cpp index 36dffe258..63d119b45 100644 --- a/src/core/system.cpp +++ b/src/core/system.cpp @@ -1355,13 +1355,35 @@ bool System::BootSystem(SystemBootParameters parameters) } // Check for resuming with hardcore mode. - if (!parameters.save_state.empty() && Achievements::IsHardcoreModeActive() && - !Achievements::ConfirmHardcoreModeDisable(TRANSLATE("Achievements", "Resuming state"))) + if (parameters.disable_achievements_hardcore_mode) + Achievements::DisableHardcoreMode(); + if (!parameters.save_state.empty() && Achievements::IsHardcoreModeActive()) { - s_state = State::Shutdown; - ClearRunningGame(); - Host::OnSystemDestroyed(); - return false; + bool cancelled; + if (FullscreenUI::IsInitialized()) + { + Achievements::ConfirmHardcoreModeDisableAsync(TRANSLATE("Achievements", "Resuming state"), + [parameters = std::move(parameters)](bool approved) mutable { + if (approved) + { + parameters.disable_achievements_hardcore_mode = true; + BootSystem(std::move(parameters)); + } + }); + cancelled = true; + } + else + { + cancelled = !Achievements::ConfirmHardcoreModeDisable(TRANSLATE("Achievements", "Resuming state")); + } + + if (cancelled) + { + s_state = State::Shutdown; + ClearRunningGame(); + Host::OnSystemDestroyed(); + return false; + } } // Load BIOS image. diff --git a/src/core/system.h b/src/core/system.h index 077b1df77..39f5ee39f 100644 --- a/src/core/system.h +++ b/src/core/system.h @@ -50,6 +50,7 @@ struct SystemBootParameters bool load_image_to_ram = false; bool force_software_renderer = false; bool fast_forward_to_first_frame = false; + bool disable_achievements_hardcore_mode = false; }; struct SaveStateInfo