From a897b95b75ef462a0c9abc8987b75c0c83ffc737 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Thu, 22 Oct 2026 08:57:29 +0200 Subject: [PATCH] GameScreen: Know whether the game is homebrew before creating either pane isHomebrew_ was set in CreateSettingsViews, but CreateContentViews uses it too, and in portrait it's created first. Co-Authored-By: Claude Opus 5.5 (1M context) --- UI/GameScreen.cpp | 7 +++++-- UI/GameScreen.h | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/UI/GameScreen.cpp b/UI/GameScreen.cpp index 65b7817e56..6acc975c81 100644 --- a/UI/GameScreen.cpp +++ b/UI/GameScreen.cpp @@ -257,6 +257,11 @@ void GameScreen::RefreshInstalledUpdate() { hasInstalledUpdate_ = FindInstalledGameUpdate(info_->id, &installedUpdate_); } +// Both panes use isHomebrew_, and which is created first depends on orientation. +void GameScreen::BeforeCreateViews() { + isHomebrew_ = info_ && info_->region == GameRegion::HOMEBREW; +} + void GameScreen::CreateContentViews(UI::ViewGroup *parent) { if (!info_) { // Shouldn't happen @@ -579,8 +584,6 @@ void GameScreen::CreateSettingsViews(UI::ViewGroup *rightColumn) { }); } - isHomebrew_ = info_ && info_->region == GameRegion::HOMEBREW; - const bool packing = GamePacker::IsPacking(gamePath_); if (fileTypeSupportCRC && !isHomebrew_ && !Reporting::HasCRC(gamePath_) && !packing) { rightColumnItems->Add(new Choice(ga->T("Calculate CRC"), ImageID("I_CHECKMARK")))->OnClick.Add([this](UI::EventParams &) { diff --git a/UI/GameScreen.h b/UI/GameScreen.h index c2b667dc85..9c819c5e09 100644 --- a/UI/GameScreen.h +++ b/UI/GameScreen.h @@ -48,6 +48,7 @@ public: bool GameRemoved() const { return gameRemoved_; } protected: + void BeforeCreateViews() override; void CreateContentViews(UI::ViewGroup *parent) override; void CreateSettingsViews(UI::ViewGroup *parent) override; void CreateContextMenu(UI::ViewGroup *parent) override;