mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-26 23:10:38 +00:00
parent
671ba6356b
commit
abe27dcb64
@ -141,12 +141,12 @@ void PopupMultiChoice::ChoiceCallback(int num) {
|
||||
UI::EventParams e{};
|
||||
e.v = this;
|
||||
e.a = num;
|
||||
e.b = PostChoiceCallback(num);
|
||||
OnChoice.Trigger(e);
|
||||
|
||||
if (restoreFocus_) {
|
||||
SetFocusedView(this);
|
||||
}
|
||||
PostChoiceCallback(num);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -238,7 +238,7 @@ private:
|
||||
UI::EventReturn HandleClick(UI::EventParams &e);
|
||||
|
||||
void ChoiceCallback(int num);
|
||||
virtual void PostChoiceCallback(int num) {}
|
||||
virtual bool PostChoiceCallback(int num) { return true; }
|
||||
|
||||
I18NCat category_;
|
||||
ScreenManager *screenManager_;
|
||||
@ -274,9 +274,15 @@ public:
|
||||
}
|
||||
|
||||
protected:
|
||||
void PostChoiceCallback(int num) override {
|
||||
if (valueStr_) {
|
||||
bool PostChoiceCallback(int num) override {
|
||||
if (!valueStr_) {
|
||||
return true;
|
||||
}
|
||||
if (*valueStr_ != choices_[num]) {
|
||||
*valueStr_ = choices_[num];
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1098,6 +1098,11 @@ void GameSettingsScreen::CreateSystemSettings(UI::ViewGroup *systemSettings) {
|
||||
PopupMultiChoiceDynamic *theme = systemSettings->Add(new PopupMultiChoiceDynamic(&g_Config.sThemeName, sy->T("Theme"), GetThemeInfoNames(), I18NCat::THEMES, screenManager()));
|
||||
theme->OnChoice.Add([=](EventParams &e) {
|
||||
UpdateTheme(screenManager()->getUIContext());
|
||||
// Reset the tint/saturation if the theme changed.
|
||||
if (e.b) {
|
||||
g_Config.fUITint = 0.0f;
|
||||
g_Config.fUISaturation = 1.0f;
|
||||
}
|
||||
return UI::EVENT_CONTINUE;
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user