mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-11 05:26:24 +02:00
UI: Send prompt results even on back/cancel.
Before, if you went to the GPU backend prompt, and canceled, it would never call the callback, and so the g_Config value never got reset.
This commit is contained in:
1 parent
d6b7cde718
commit
cde6b3d3e4
2 files changed
+8
-3
No files matched your search
+6
-3
@@ -275,22 +275,25 @@ void PromptScreen::CreateViews() {
|
||||
Choice *yesButton = rightColumnItems->Add(new Choice(yesButtonText_));
|
||||
yesButton->OnClick.Handle(this, &PromptScreen::OnYes);
|
||||
root_->SetDefaultFocusView(yesButton);
|
||||
if (noButtonText_ != "")
|
||||
if (!noButtonText_.empty())
|
||||
rightColumnItems->Add(new Choice(noButtonText_))->OnClick.Handle(this, &PromptScreen::OnNo);
|
||||
}
|
||||
|
||||
UI::EventReturn PromptScreen::OnYes(UI::EventParams &e) {
|
||||
callback_(true);
|
||||
TriggerFinish(DR_OK);
|
||||
return UI::EVENT_DONE;
|
||||
}
|
||||
|
||||
UI::EventReturn PromptScreen::OnNo(UI::EventParams &e) {
|
||||
callback_(false);
|
||||
TriggerFinish(DR_CANCEL);
|
||||
return UI::EVENT_DONE;
|
||||
}
|
||||
|
||||
void PromptScreen::TriggerFinish(DialogResult result) {
|
||||
callback_(result == DR_OK || result == DR_YES);
|
||||
UIDialogScreenWithBackground::TriggerFinish(result);
|
||||
}
|
||||
|
||||
PostProcScreen::PostProcScreen(const std::string &title) : ListPopupScreen(title) {
|
||||
I18NCategory *ps = GetI18NCategory("PostShaders");
|
||||
ReloadAllPostShaderInfo();
|
||||
|
||||
@@ -78,6 +78,8 @@ public:
|
||||
|
||||
void CreateViews() override;
|
||||
|
||||
void TriggerFinish(DialogResult result) override;
|
||||
|
||||
private:
|
||||
UI::EventReturn OnYes(UI::EventParams &e);
|
||||
UI::EventReturn OnNo(UI::EventParams &e);
|
||||
|
||||
Reference in new issue
Block a user