Bind stadium construction and historical data to scoped engine offers (by Codex)

This commit is contained in:
Codex committed 2026-10-29 06:09:10 +01:00
1 parent dfb972abbd
commit 0edf208405
22 files changed
+1037 -40

No files matched your search

+3
View File
@@ -8,6 +8,7 @@ std::optional<int> stadium_integer(const std::string &text,int maximum) {
}
} // namespace
void App::sync_stadium_draft() {
if(engine_mode_){if(auto *button=element("stadium-build"))button->SetAttribute("disabled",true);for(const auto *id:{"stadium-quote-total","stadium-cost-placesCost","stadium-cost-seatsCost","stadium-cost-roofCost"})if(auto *n=element(id))n->SetInnerRML("—");if(auto *n=element("stadium-draft-feedback"))n->SetInnerRML("Angebot für die geänderte Auswahl wird aktualisiert.");if(auto *n=element("stadium-place-number"))n->SetInnerRML("<span class=\"control-label\">"+std::to_string(stadium_view_.at("draft").at("places").get<int64_t>())+"</span>");dirty_=true;return;}
stadium_view_defaults(stadium_view_);if(stadium_view_.at("dialog")==""||!stadium_view_.at("draft").is_object())return;
const auto s=snap();const bool fresh=s.world==stadium_world_&&source_.get()==stadium_source_&&s.revision==stadium_revision_&&stadium_managed(s)==stadium_view_.value("bound_club",std::string());
const auto q=fresh?demo_stadium_quote(s.state,stadium_view_.at("draft"),*s.world,stadium_managed(s)):Json{{"ok",false}};
@@ -25,6 +26,7 @@ void App::sync_stadium_draft() {
dirty_=true;
}
bool App::stadium_action(const std::string &action,Rml::Element *target) {
if(engine_mode_)return engine_stadium_action(action,target);
if(!action.starts_with("stadium-"))return false;
if(menu_!="stadium"||!source_||!world_||amount_||!popup_.empty()||!report_detail_kind_.empty())return true;
stadium_view_defaults(stadium_view_);const auto s=snap();const auto club=stadium_managed(s);
@@ -101,6 +103,7 @@ bool App::stadium_action(const std::string &action,Rml::Element *target) {
refresh();return true;
}
bool App::stadium_event(Rml::Event &event) {
if(engine_mode_)return engine_stadium_event(event);
if(menu_!="stadium"||!source_||!report_detail_kind_.empty())return false;
stadium_view_defaults(stadium_view_);const auto type=event.GetType();auto *target=event.GetTargetElement();
const auto key=type=="keydown"?Rml::Input::KeyIdentifier(event.GetParameter<int>("key_identifier",0)):Rml::Input::KI_UNKNOWN;