From 96cb05894f7f38ba872b131df0efb13590473b4c Mon Sep 17 00:00:00 2001 From: Codex Date: Sat, 31 Oct 2026 22:30:56 +0100 Subject: [PATCH] Keep stadium and periphery backdrops behind compact construction dialogs (by Codex) --- src/app/main.cpp | 8 +++--- src/ui/game_end.cpp | 12 +++++---- src/ui/game_end.hpp | 4 ++- src/ui/stadium.cpp | 5 ++-- tests/stadium_block_ui_tests.cpp | 44 ++++++++++++++++++++++++++++++++ 5 files changed, 62 insertions(+), 11 deletions(-) diff --git a/src/app/main.cpp b/src/app/main.cpp index a22a47a..4af7028 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -2341,11 +2341,13 @@ int main(int argc, char** argv) { // after the tip question has returned, before the outer ACK. const Image backdrop = flow.stadium()->construction_notice_backdrop(); auto view = ui::construction_notice_dialog(staged, season_exe, notice); - std::optional effective_options; + const auto& stadium_owner = flow.stadium()->state(); + std::optional effective_options = + ui::GameEndRenderOptions{stadium_owner.plain_background, stadium_owner.gradient_text, true}; if (flow.stadium()->state().block_expansion || flow.stadium()->state().quoted_object) { const auto& owner = flow.stadium()->state(); view.compact_dialog_frame = owner.compact_dialog_frame; - effective_options = ui::GameEndRenderOptions{owner.plain_background, owner.gradient_text}; + effective_options = ui::GameEndRenderOptions{owner.plain_background, owner.gradient_text, true}; } const char* title = notice.kind == ConstructionNoticeKind::InsufficientFunds ? "OpenBMH - stadium_funds_notice" : "OpenBMH - stadium_sponsor_notice"; @@ -2359,7 +2361,7 @@ int main(int argc, char** argv) { view.compact_dialog_frame = owner.compact_dialog_frame; if (present_pending_dialog(staged, view, backdrop, "OpenBMH - stadium_ticket_compensation_notice", - ui::GameEndRenderOptions{owner.plain_background, owner.gradient_text}) == PendingOfferAnswer::unsupported) + ui::GameEndRenderOptions{owner.plain_background, owner.gradient_text, true}) == PendingOfferAnswer::unsupported) throw std::runtime_error("compensation notice presenter stopped"); }, sportschau_presenter, [&](const GameState& staged, const AdvertisingRenewal& renewal, const Image& backdrop) diff --git a/src/ui/game_end.cpp b/src/ui/game_end.cpp index 93c8b37..0a24039 100644 --- a/src/ui/game_end.cpp +++ b/src/ui/game_end.cpp @@ -277,14 +277,16 @@ GameEndTaxDialog::GameEndTaxDialog(const std::filesystem::path& data,TaxDialogPr badge_=load_vga(asset_path(data/"W",std::to_string(std::max(0,projection_.badge_sprite)>>3)+".VGA")); } Image GameEndTaxDialog::backdrop() const { - if(projection_.compact_dialog_frame)return Image(320,240,0); - if(restored_backdrop_&&restored_backdrop_->width==320&&restored_backdrop_->height==240)return *restored_backdrop_; + const bool restored=restored_backdrop_&&restored_backdrop_->width==320&&restored_backdrop_->height==240; + if(projection_.compact_dialog_frame&&!(options_.preserve_restored_backdrop&&restored))return Image(320,240,0); + if(restored)return *restored_backdrop_; return source_base(background_,options_.plain_background,false); } Image GameEndTaxDialog::render(std::optional