mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-07-11 01:25:07 +02:00
Separate TriggerFinish from parent result
This commit is contained in:
+1
-1
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -12,8 +12,7 @@ public:
|
||||
LoadStateConfirmScreen(std::string_view saveStatePrefix, int slot, std::function<void(bool)> 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_;
|
||||
|
||||
+1
-1
@@ -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_);
|
||||
|
||||
Reference in New Issue
Block a user