Compare commits

..
Author SHA1 Message Date
Codex 50e476f6e1 Prepare OpenBMH 1.1 Beta 2 construction dialog fix release (by Codex)
Prepare verified release / draft (push) Waiting to run
2026-10-31 22:39:57 +01:00
Codex 96cb05894f Keep stadium and periphery backdrops behind compact construction dialogs (by Codex) 2026-10-31 22:31:05 +01:00
7 changed files with 72 additions and 12 deletions

No files matched your search

+1 -1
View File
@@ -5,7 +5,7 @@ if(APPLE)
# Enable native languages before dependencies/subdirectories inherit rules.
enable_language(OBJC OBJCXX)
endif()
set(OPENBMH_PRERELEASE "beta.1" CACHE STRING "Prerelease identifier; empty for final release")
set(OPENBMH_PRERELEASE "beta.2" CACHE STRING "Prerelease identifier; empty for final release")
set(OPENBMH_PRODUCT_VERSION "${PROJECT_VERSION}")
if(OPENBMH_PRERELEASE)
string(APPEND OPENBMH_PRODUCT_VERSION "-${OPENBMH_PRERELEASE}")
+9
View File
@@ -0,0 +1,9 @@
# OpenBMH 1.1 Beta 2
Bei Rückfragen zum Bau von Stadionplätzen und Peripherie bleibt die aktuelle Stadionansicht jetzt sichtbar. Das gilt auch für gedrückte Schaltflächen und nachfolgende Zahlungs-, Zuschuss- und Entschädigungshinweise. Der zuvor schwarze Hintergrund ist behoben.
Die Änderung betrifft die Darstellung; Baupreise, Bauzeiten und Spielstände bleiben unverändert. Bestehende 1.1-Daten und Spielstände können weiterverwendet werden. Bei einem bestehenden Community-Paket die Programmdateien aktualisieren und die eigene `COMMUNITY.OBD` sowie Spielstände behalten.
Downloads für Windows x64, macOS ARM64 und Linux x64 sowie ein passendes Source-Archiv. Originale Spieldaten sind nicht enthalten. Der Dateneditor `obdeddi` bleibt ein separater Download. Die stabile Classic-Linie 1.0 bleibt unabhängig; 1.2 wird weiterhin separat entwickelt und ist kein Bestandteil dieses Releases.
Der Fix wurde unter Linux mit Original-Assets, Pixelvergleichen und Bauablauf-Tests geprüft. Native Plattform-Builds und synthetische Tests sind über `QA-REPORT.json` und `SHA256SUMS` dokumentiert. Eine vollständige menschliche Spielprüfung auf allen Plattformen wird damit nicht behauptet.
+5 -3
View File
@@ -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<ui::GameEndRenderOptions> effective_options;
const auto& stadium_owner = flow.stadium()->state();
std::optional<ui::GameEndRenderOptions> 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)
+7 -5
View File
@@ -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<Button> pressed) const {
Image out=backdrop();
draw_source_dialog(out,{widgets_,faces_,&badge_,font_->small,font_->large,
font_->exe,font_->sprite,texts_},projection_,options_.gradient_text,pressed);
font_->exe,font_->sprite,texts_},projection_,options_.gradient_text,pressed,
options_.preserve_restored_backdrop&&restored_backdrop_&&restored_backdrop_->width==320&&restored_backdrop_->height==240);
return out;
}
bool source_badge_fallback(int token) {
@@ -292,11 +294,11 @@ bool source_badge_fallback(int token) {
return original_badge_fallback(club);
}
void draw_source_dialog(Image& out,const SourceDialogAssets& assets,const TaxDialogProjection& p,
bool gradient,std::optional<GameEndTaxDialog::Button> pressed) {
bool gradient,std::optional<GameEndTaxDialog::Button> pressed,bool preserve_backdrop) {
using Button=GameEndTaxDialog::Button;
if(out.width!=320||out.height!=240||(!p.badge_fallback&&!assets.badge))
throw FormatError("Source dialog: invalid backdrop or badge assets");
if(p.compact_dialog_frame)out=Image(320,240,0);
if(p.compact_dialog_frame&&!preserve_backdrop)out=Image(320,240,0);
frame(out,assets.widgets,assets.exe,48,84,217,99,!p.compact_dialog_frame);
const std::string_view header = p.source_system_identity
? text_at(assets.texts,::bmh::layout::SystemManagerNameText) : p.manager_name;
+3 -1
View File
@@ -29,6 +29,7 @@ std::vector<std::string> wrap_source_text(const Font&, const LeImage&,
struct GameEndRenderOptions {
bool plain_background = false; // Original PlainBackground, not its inverse
bool gradient_text = true; // TextGradientDisabled==0 && BMH.exe[TextGradientMode]==2
bool preserve_restored_backdrop = false; // Nested construction notices retain their owning screen.
};
// Rendering-only projection. Names retain the Source ISO646-DE bytes; values and order have
@@ -129,6 +130,7 @@ struct SourceDialogAssets {
};
void draw_source_dialog(Image&, const SourceDialogAssets&, const TaxDialogProjection&,
bool gradient,
std::optional<GameEndTaxDialog::Button> pressed = {});
std::optional<GameEndTaxDialog::Button> pressed = {},
bool preserve_backdrop = false);
} // namespace bmh::ui
+3 -2
View File
@@ -697,12 +697,13 @@ void StadiumScreen::rebuild_tip_dialog() {
tip_dialog_.reset();
periphery_dialog_.reset();
if (state_.periphery_quote_dialog) {
GameEndRenderOptions options{state_.plain_background, state_.gradient_text};
GameEndRenderOptions options{state_.plain_background, state_.gradient_text, true};
periphery_dialog_.emplace(data_, *state_.periphery_quote_dialog, options, render_scene());
}
if (state_.construction_tip_dialog) {
GameEndRenderOptions options;
options.gradient_text = state_.gradient_text;
options.preserve_restored_backdrop = true;
if (state_.block_expansion) options.plain_background = state_.plain_background;
tip_dialog_.emplace(data_, *state_.construction_tip_dialog,
options, state_.block_expansion
@@ -2029,7 +2030,7 @@ void StadiumScreen::acknowledge(StadiumState updated) {
// therefore leaves the old question retryable.
std::optional<GameEndTaxDialog> staged_tip, staged_periphery;
if (updated.periphery_quote_dialog) {
const GameEndRenderOptions options{updated.plain_background, updated.gradient_text};
const GameEndRenderOptions options{updated.plain_background, updated.gradient_text, true};
staged_periphery.emplace(data_, *updated.periphery_quote_dialog, options, render_scene());
}
if (updated.construction_tip_dialog) {
+44
View File
@@ -4,6 +4,8 @@
#include "game/messages.hpp"
#include "ui/manager.hpp"
#include "formats/palette.hpp"
#include <fstream>
#include <algorithm>
#include <array>
@@ -1182,9 +1184,51 @@ void source_stadium_data_controls(const std::filesystem::path& data) {
}
}
namespace {
void construction_backdrop_tests(const std::filesystem::path& data,const std::filesystem::path& output) {
const auto save_image=[&](const Image& image,const std::string& name) {
if(output.empty())return;
std::filesystem::create_directories(output);const auto palette=load_palette(data/"M3PC.COL");
std::ofstream file(output/(name+".ppm"),std::ios::binary);file<<"P6\n320 240\n255\n";
for(auto pixel:image.pixels){const auto color=palette.argb[pixel];file.put(char(color>>16));file.put(char(color>>8));file.put(char(color));}
};
for(bool compact:{false,true})for(bool periphery:{false,true}) {
auto state=periphery?overview_state():detail_state(1,15333,1);
state.compact_dialog_frame=compact;
StadiumScreen screen(data,state);
if(periphery){screen.click(30,220);screen.click(160,220);}
const auto request=screen.click(periphery?266:50,periphery?125:140);
check(request.kind==(periphery?StadiumRequestKind::quote_periphery:StadiumRequestKind::expansion_confirm),"construction backdrop fixture did not enter its real request path");
const Image underlay=screen.render();
state=screen.state();next_identity(state);
auto question=question_for();question.compact_dialog_frame=compact;
if(periphery){state.quoted_object=request.object;state.quoted_price=1700000;question.source_flags=1;state.periphery_quote_dialog=question;}
else {state.block_expansion->offer=pending_offer(state.block_expansion->quote);state.construction_tip_dialog=question;}
screen.acknowledge(state);const auto actual=screen.render();
const auto check_outside=[&](const Image& image) {
for(int y=0;y<240;++y)if(y<80 || y>=190)for(int x=0;x<320;++x)
if(image.pixels[size_t(y*320+x)]!=underlay.pixels[size_t(y*320+x)])throw std::runtime_error(std::string(periphery?"periphery":"stands")+" compact="+std::to_string(compact)+" backdrop differs at "+std::to_string(x)+","+std::to_string(y));
};
check_outside(actual);
screen.pointer_down(100,171);check_outside(screen.render());
GameEndRenderOptions options{state.plain_background,state.gradient_text,true};
GameEndTaxDialog notice(data,question,options,screen.construction_notice_backdrop());
check(notice.backdrop().pixels==screen.construction_notice_backdrop().pixels,"construction notice completion restores a black frame");
check_outside(notice.render(GameEndTaxDialog::Button::yes));
if(compact) {
const auto name=periphery?"periphery":"stands";
GameEndTaxDialog previous(data,question,{state.plain_background,state.gradient_text},underlay);
check(previous.render().pixels[0]==0,"default compact dialog behavior changed outside construction menus");
save_image(previous.render(),std::string(name)+"-before");save_image(actual,std::string(name)+"-after");
}
}
}
}
int main(int argc, char** argv) try {
if (argc < 2 || !*argv[1]) throw std::runtime_error("expected Original BMH data directory");
const std::filesystem::path data = argv[1];
construction_backdrop_tests(data,argc>2?std::filesystem::path(argv[2]):std::filesystem::path{});
source_stadium_data_controls(data);
source_periphery_hit_tests(data);
row_hit_tests(data);