From 22f2e69d0ab28d052901f4fee4041009a2adb7d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Tue, 24 Feb 2026 00:16:10 +0100 Subject: [PATCH] Integrate the exit reminder (you haven't saved..) in warnings from setting that require restart Part of #21223 --- UI/GameSettingsScreen.cpp | 12 +++++++++++- UI/PauseScreen.cpp | 4 ++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp index 2dad8dae3e..7748b63167 100644 --- a/UI/GameSettingsScreen.cpp +++ b/UI/GameSettingsScreen.cpp @@ -1744,9 +1744,19 @@ void TriggerRestart(const char *why, bool editThenRestore, const Path &gamePath) System_RestartApp(param); } +// From PauseScreen +std::string GetConfirmExitMessage(); + void GameSettingsScreen::TriggerRestartOrDo(std::function callback) { auto di = GetI18NCategory(I18NCat::DIALOG); - screenManager()->push(new UI::MessagePopupScreen(di->T("Restart"), di->T("Changing this setting requires PPSSPP to restart."), di->T("Restart"), di->T("Cancel"), [=](bool yes) { + + std::string confirmExitMessage = GetConfirmExitMessage(); + if (!confirmExitMessage.empty()) { + confirmExitMessage = "\n\n" + confirmExitMessage; + } + confirmExitMessage = std::string(di->T("Changing this setting requires PPSSPP to restart.")) + confirmExitMessage; + + screenManager()->push(new UI::MessagePopupScreen(di->T("Restart"), confirmExitMessage, di->T("Restart"), di->T("Cancel"), [=](bool yes) { if (yes) { TriggerRestart("GameSettingsScreen::RenderingBackendYes", editGameSpecificThenRestore_, gamePath_); } else { diff --git a/UI/PauseScreen.cpp b/UI/PauseScreen.cpp index 98336a6c87..05447bbc2e 100644 --- a/UI/PauseScreen.cpp +++ b/UI/PauseScreen.cpp @@ -782,6 +782,10 @@ int GetUnsavedProgressSeconds() { std::string GetConfirmExitMessage() { std::string confirmMessage; + if (!PSP_IsInited()) { + return std::string(); + } + int unsavedSeconds = GetUnsavedProgressSeconds(); // If RAIntegration has dirty info, ask for confirmation.