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) {
|
void EmuScreen::dialogFinished(const Screen *dialog, DialogResult result) {
|
||||||
std::string_view tag = dialog->tag();
|
std::string_view tag = dialog->tag();
|
||||||
if (tag == "TextEditPopup" || tag == "LoadStateConfirm") {
|
if (tag == "TextEditPopup") {
|
||||||
// Chat message finished.
|
// Chat message finished.
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,6 +28,10 @@ void LoadStateConfirmScreen::CreatePopupContents(UI::ViewGroup *parent) {
|
|||||||
new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT, Margins(0, 8))));
|
new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT, Margins(0, 8))));
|
||||||
}
|
}
|
||||||
|
|
||||||
void LoadStateConfirmScreen::OnCompleted(DialogResult result) {
|
void LoadStateConfirmScreen::TriggerFinish(DialogResult result) {
|
||||||
if (callback_) callback_(result == DR_OK);
|
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);
|
LoadStateConfirmScreen(std::string_view saveStatePrefix, int slot, std::function<void(bool)> callback);
|
||||||
const char *tag() const override { return "LoadStateConfirm"; }
|
const char *tag() const override { return "LoadStateConfirm"; }
|
||||||
void CreatePopupContents(UI::ViewGroup *parent) override;
|
void CreatePopupContents(UI::ViewGroup *parent) override;
|
||||||
protected:
|
void TriggerFinish(DialogResult result) override;
|
||||||
void OnCompleted(DialogResult result) override;
|
|
||||||
private:
|
private:
|
||||||
std::string saveStatePrefix_;
|
std::string saveStatePrefix_;
|
||||||
int slot_;
|
int slot_;
|
||||||
|
|||||||
+1
-1
@@ -829,7 +829,7 @@ void GamePauseScreen::dialogFinished(const Screen *dialog, DialogResult dr) {
|
|||||||
} else {
|
} else {
|
||||||
if (tag == "Game") {
|
if (tag == "Game") {
|
||||||
g_BackgroundAudio.SetGame(Path());
|
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..
|
// Maybe should invert the logic here, so many cases..
|
||||||
// There may have been changes to our savestates, so let's recreate.
|
// There may have been changes to our savestates, so let's recreate.
|
||||||
SaveState::Rescan(saveStatePrefix_);
|
SaveState::Rescan(saveStatePrefix_);
|
||||||
|
|||||||
Reference in New Issue
Block a user