| 3938 | } |
| 3939 | |
| 3940 | void FullscreenUI::ReportStateLoadError(const std::string& message, std::optional<s32> slot, bool backup) |
| 3941 | { |
| 3942 | MTGS::RunOnGSThread([message, slot, backup]() { |
| 3943 | const bool prompt_on_error = Host::GetBaseBoolSettingValue("UI", "PromptOnStateLoadSaveFailure", true); |
| 3944 | if (!prompt_on_error || !ImGuiManager::InitializeFullscreenUI()) |
| 3945 | { |
| 3946 | SaveState_ReportLoadErrorOSD(message, slot, backup); |
| 3947 | return; |
| 3948 | } |
| 3949 | |
| 3950 | std::string title; |
| 3951 | if (slot.has_value()) |
| 3952 | { |
| 3953 | if (backup) |
| 3954 | title = fmt::format(FSUI_FSTR("Failed to Load State From Backup Slot {}"), *slot); |
| 3955 | else |
| 3956 | title = fmt::format(FSUI_FSTR("Failed to Load State From Slot {}"), *slot); |
| 3957 | } |
| 3958 | else |
| 3959 | { |
| 3960 | title = FSUI_STR("Failed to Load State"); |
| 3961 | } |
| 3962 | |
| 3963 | ImGuiFullscreen::InfoMessageDialogCallback callback; |
| 3964 | if (VMManager::GetState() == VMState::Running) |
| 3965 | { |
| 3966 | Host::RunOnCPUThread([]() { VMManager::SetPaused(true); }); |
| 3967 | callback = []() { |
| 3968 | Host::RunOnCPUThread([]() { VMManager::SetPaused(false); }); |
| 3969 | }; |
| 3970 | } |
| 3971 | |
| 3972 | ImGuiFullscreen::OpenInfoMessageDialog( |
| 3973 | fmt::format("{} {}", ICON_FA_TRIANGLE_EXCLAMATION, title), |
| 3974 | std::move(message), std::move(callback)); |
| 3975 | }); |
| 3976 | } |
| 3977 | |
| 3978 | void FullscreenUI::ReportStateSaveError(const std::string& message, std::optional<s32> slot) |
| 3979 | { |
nothing calls this directly
no test coverage detected