mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-29 17:15:40 +00:00
System: Use Async HC mode disable for resuming
This commit is contained in:
parent
bbf7d9d769
commit
afe8384b6d
|
@ -1355,14 +1355,36 @@ bool System::BootSystem(SystemBootParameters parameters)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check for resuming with hardcore mode.
|
// Check for resuming with hardcore mode.
|
||||||
if (!parameters.save_state.empty() && Achievements::IsHardcoreModeActive() &&
|
if (parameters.disable_achievements_hardcore_mode)
|
||||||
!Achievements::ConfirmHardcoreModeDisable(TRANSLATE("Achievements", "Resuming state")))
|
Achievements::DisableHardcoreMode();
|
||||||
|
if (!parameters.save_state.empty() && Achievements::IsHardcoreModeActive())
|
||||||
|
{
|
||||||
|
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;
|
s_state = State::Shutdown;
|
||||||
ClearRunningGame();
|
ClearRunningGame();
|
||||||
Host::OnSystemDestroyed();
|
Host::OnSystemDestroyed();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Load BIOS image.
|
// Load BIOS image.
|
||||||
if (!LoadBIOS(parameters.override_bios))
|
if (!LoadBIOS(parameters.override_bios))
|
||||||
|
|
|
@ -50,6 +50,7 @@ struct SystemBootParameters
|
||||||
bool load_image_to_ram = false;
|
bool load_image_to_ram = false;
|
||||||
bool force_software_renderer = false;
|
bool force_software_renderer = false;
|
||||||
bool fast_forward_to_first_frame = false;
|
bool fast_forward_to_first_frame = false;
|
||||||
|
bool disable_achievements_hardcore_mode = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct SaveStateInfo
|
struct SaveStateInfo
|
||||||
|
|
Loading…
Reference in a new issue