diff --git a/UI/EmuScreen.cpp b/UI/EmuScreen.cpp index 8cab0ee3d5..8aabe1bd5c 100644 --- a/UI/EmuScreen.cpp +++ b/UI/EmuScreen.cpp @@ -509,7 +509,7 @@ EmuScreen::~EmuScreen() { void EmuScreen::dialogFinished(const Screen *dialog, DialogResult result) { std::string_view tag = dialog->tag(); - if (tag == "TextEditPopup" || tag == "LoadStateConfirm") { + if (tag == "TextEditPopup") { // Chat message finished. return; } diff --git a/UI/LoadStateConfirmScreen.cpp b/UI/LoadStateConfirmScreen.cpp index d8ea3ada1f..4891e1f35d 100644 --- a/UI/LoadStateConfirmScreen.cpp +++ b/UI/LoadStateConfirmScreen.cpp @@ -28,6 +28,10 @@ void LoadStateConfirmScreen::CreatePopupContents(UI::ViewGroup *parent) { new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT, Margins(0, 8)))); } -void LoadStateConfirmScreen::OnCompleted(DialogResult result) { - if (callback_) callback_(result == DR_OK); +void LoadStateConfirmScreen::TriggerFinish(DialogResult result) { + if (callback_) { + callback_(result == DR_OK); + callback_ = nullptr; + } + UI::PopupScreen::TriggerFinish(DR_CANCEL); } diff --git a/UI/LoadStateConfirmScreen.h b/UI/LoadStateConfirmScreen.h index 9491998b2c..c6444aec1a 100644 --- a/UI/LoadStateConfirmScreen.h +++ b/UI/LoadStateConfirmScreen.h @@ -12,8 +12,7 @@ public: LoadStateConfirmScreen(std::string_view saveStatePrefix, int slot, std::function callback); const char *tag() const override { return "LoadStateConfirm"; } void CreatePopupContents(UI::ViewGroup *parent) override; -protected: - void OnCompleted(DialogResult result) override; + void TriggerFinish(DialogResult result) override; private: std::string saveStatePrefix_; int slot_; diff --git a/UI/PauseScreen.cpp b/UI/PauseScreen.cpp index f32673aea0..7cb1da9ea3 100644 --- a/UI/PauseScreen.cpp +++ b/UI/PauseScreen.cpp @@ -829,7 +829,7 @@ void GamePauseScreen::dialogFinished(const Screen *dialog, DialogResult dr) { } else { if (tag == "Game") { g_BackgroundAudio.SetGame(Path()); - } else if (tag != "MessagePopupScreen" && tag != "Prompt" && tag != "ContextMenuPopup" && tag != "ContextMenuCallbackPopup" && tag != "Report" && tag != "listpopup" && tag != "LoadStateConfirm") { + } else if (tag != "MessagePopupScreen" && tag != "Prompt" && tag != "ContextMenuPopup" && tag != "ContextMenuCallbackPopup" && tag != "Report" && tag != "listpopup") { // Maybe should invert the logic here, so many cases.. // There may have been changes to our savestates, so let's recreate. SaveState::Rescan(saveStatePrefix_);