Merge pull request #14832 from iota97/settinginfo

Fix setting info on multi choice
This commit is contained in:
Unknown W. Brackets
2021-09-12 06:40:13 -07:00
committed by GitHub
4 changed files with 21 additions and 0 deletions
+10
View File
@@ -218,6 +218,11 @@ void GameSettingsScreen::CreateViews() {
settingInfo_->SetBottomCutoff(dp_yres - 200.0f);
root_->Add(settingInfo_);
// Show it again if we recreated the view
if (oldSettingInfo_ != "") {
settingInfo_->Show(oldSettingInfo_, nullptr);
}
// TODO: These currently point to global settings, not game specific ones.
// Graphics
@@ -1273,6 +1278,11 @@ void GameSettingsScreen::dialogFinished(const Screen *dialog, DialogResult resul
}
}
void GameSettingsScreen::RecreateViews() {
oldSettingInfo_ = settingInfo_->GetText();
UIScreen::RecreateViews();
}
void GameSettingsScreen::CallbackMemstickFolder(bool yes) {
auto sy = GetI18NCategory("System");
+4
View File
@@ -44,6 +44,7 @@ protected:
void CallbackMemstickFolder(bool yes);
bool UseVerticalLayout() const;
void dialogFinished(const Screen *dialog, DialogResult result) override;
void RecreateViews() override;
private:
void TriggerRestart(const char *why);
@@ -137,6 +138,9 @@ private:
// Android-only
std::string pendingMemstickFolder_;
// If we recreate the views while this is active we show it again
std::string oldSettingInfo_;
};
class DeveloperToolsScreen : public UIDialogScreenWithBackground {
+5
View File
@@ -1086,4 +1086,9 @@ void SettingInfoMessage::Draw(UIContext &dc) {
text_->SetTextColor(whiteAlpha(alpha));
ViewGroup::Draw(dc);
showing_ = sinceShow <= timeToShow; // Don't consider fade time
}
std::string SettingInfoMessage::GetText() const {
return showing_ && text_ ? text_->GetText() : "";
}
+2
View File
@@ -175,9 +175,11 @@ public:
void Show(const std::string &text, UI::View *refView = nullptr);
void Draw(UIContext &dc);
std::string GetText() const;
private:
UI::TextView *text_ = nullptr;
double timeShown_ = 0.0;
float cutOffY_;
bool showing_ = false;
};