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

+6 -1
View File
@@ -30,6 +30,7 @@ void App::engine_accept(EngineReply result) {
engine_almanac_sync();
engine_ticket_bind();
engine_toto_poll();
engine_stadium_poll();
engine_contracts_poll();
engine_calendar_sync();
engine_friendly_sync();
@@ -133,6 +134,7 @@ void App::engine_save() {
engine_start("Spielstand wird gespeichert …", [link, output] { auto response = link->save_copy(output); return EngineReply{link, link->snapshot(), response, nullptr}; });
}
void App::engine_quit() {
if(!engine_busy_&&engine_data_.value("stadium",Json()).is_object()&&engine_data_.at("stadium").value("messageType","")=="snapshot"&&engine_data_.at("stadium").at("data").at("quote").is_object()){engine_stadium_exit_=true;engine_stadium_send(engine_stadium_commit(engine_data_,false,editor::new_id("request:ui-")),"cancel");return;}
if (engine_busy_ || engine_files_busy_) { engine_notice_ = "Bitte den laufenden Vorgang abwarten."; dirty_ = true; return; }
if (engine_dirty_) {
confirmation("Die Partie enthält ungespeicherte Änderungen. Vor dem Beenden speichern?",[this]{closed_=true;});
@@ -163,6 +165,7 @@ void App::engine_event(Rml::Event &event) {
if (engine_reports_event(event)) return;
if(menu_=="statistics"&&statistics_event(event))return;
if(menu_=="toto"&&toto_event(event))return;
if(menu_=="stadium"&&stadium_event(event))return;
if(!engine_busy_&&popup_.empty()&&rankings_event(event))return;
if (!engine_busy_ && popup_.empty() && engine_friendly_event(event)) return;
if (!engine_busy_ && planning_dialog_.empty() && popup_.empty() && (menu_ == "friendlies" || menu_ == "almanac" || menu_=="tables" || menu_=="strengths" || menu_=="league" || menu_=="other" || menu_=="scorers" || menu_=="statistics") && report_picker_event(event)) return;
@@ -256,6 +259,7 @@ void App::engine_event(Rml::Event &event) {
if (engine_reports_action(action,node)) return;
if(menu_=="statistics"&&statistics_action(action,node))return;
if(menu_=="toto"&&toto_action(action,node))return;
if(menu_=="stadium"&&stadium_action(action,node))return;
if (almanac_action(action,node)) return;
if (engine_friendly_action(action, node)) return;
if ((menu_ == "friendlies" || menu_ == "almanac" || menu_=="tables" || menu_=="strengths" || menu_=="league" || menu_=="other" || menu_=="scorers" || menu_=="statistics") && report_picker_action(action,node)) return;
@@ -272,6 +276,7 @@ void App::engine_event(Rml::Event &event) {
ticket_->open(node, device_ratio_, price.at("min"), price.at("max")); dirty_ = true;
}
else if (action == "engine-open" && (id == "environment" || id == "advertising")) { menu_ = id; advertising_selected_ = -1; advertising_offer_ = 0; refresh(); }
else if(action=="engine-open"&&id=="stadium"){menu_=id;stadium_view_=Json::object();stadium_view_defaults(stadium_view_);engine_stadium_sync();refresh();}
else if(action=="engine-open"&&id=="toto"){menu_=id;engine_toto_sync();refresh();}
else if(action=="engine-open"&&id=="statistics"){menu_=id;engine_reports_sync();engine_statistics_load();}
else if(action=="engine-open"&&id=="load"){engine_files_begin("load");}
@@ -305,5 +310,5 @@ void App::engine_event(Rml::Event &event) {
}
Json App::engine_snapshot() const {
return {{"mode", engine_mode_}, {"creation_busy",engine_creation_busy_}, {"busy", engine_busy_}, {"dirty", engine_dirty_}, {"fresh", engine_fresh_}, {"bundle", engine_data_},
{"response", engine_response_}, {"toto_value",engine_toto_value_},{"toto_draft",engine_toto_edit_},{"toto_quote",engine_toto_quote_},{"toto_feedback",engine_toto_feedback_},{"statistics_read",engine_statistics_read_},{"statistics_value",engine_statistics_value_},{"statistics_query",engine_statistics_query_},{"files_native",files_native_},{"files_busy",engine_files_busy_},{"files_current",engine_files_metadata_},{"opening_read",engine_opening_read_},{"opening_state",engine_opening_state_},{"rankings_read",engine_rankings_read_},{"rankings_state",engine_rankings_state_},{"fairplay_read",engine_fairplay_read_},{"other_index",engine_other_index_},{"other_read",engine_other_read_},{"fixtures_read",engine_fixtures_read_},{"reports_state",engine_reports_state_},{"reports_index",engine_reports_index_},{"reports_read",engine_reports_read_},{"reports_roster",engine_reports_roster_},{"almanac_cache",engine_almanac_cache_}, {"almanac_context",engine_almanac_context_}, {"friendly_quote", engine_friendly_read_}, {"friendly_league", engine_friendly_league_}, {"friendly_opponent", engine_friendly_opponent_}, {"friendly_date", engine_friendly_date_}, {"friendly_home", engine_friendly_home_}, {"friendly_stage", engine_friendly_stage_}, {"friendly_month", engine_friendly_month_}, {"calendar_day", engine_calendar_day_}, {"move_id", engine_move_id_}, {"credit_preview", engine_credit_}, {"credit_edits", engine_credit_edits_}, {"training_draft", engine_training_draft_}, {"tactics_draft", engine_tactics_draft_}, {"player_profile", engine_player_}, {"lineup_selected", lineup_selected_}, {"focus", engine_focus_}, {"selected_camp", engine_camp_}, {"notice", engine_notice_}};
{"response", engine_response_}, {"stadium_view",stadium_view_},{"stadium_value",engine_stadium_value_},{"toto_value",engine_toto_value_},{"toto_draft",engine_toto_edit_},{"toto_quote",engine_toto_quote_},{"toto_feedback",engine_toto_feedback_},{"statistics_read",engine_statistics_read_},{"statistics_value",engine_statistics_value_},{"statistics_query",engine_statistics_query_},{"files_native",files_native_},{"files_busy",engine_files_busy_},{"files_current",engine_files_metadata_},{"opening_read",engine_opening_read_},{"opening_state",engine_opening_state_},{"rankings_read",engine_rankings_read_},{"rankings_state",engine_rankings_state_},{"fairplay_read",engine_fairplay_read_},{"other_index",engine_other_index_},{"other_read",engine_other_read_},{"fixtures_read",engine_fixtures_read_},{"reports_state",engine_reports_state_},{"reports_index",engine_reports_index_},{"reports_read",engine_reports_read_},{"reports_roster",engine_reports_roster_},{"almanac_cache",engine_almanac_cache_}, {"almanac_context",engine_almanac_context_}, {"friendly_quote", engine_friendly_read_}, {"friendly_league", engine_friendly_league_}, {"friendly_opponent", engine_friendly_opponent_}, {"friendly_date", engine_friendly_date_}, {"friendly_home", engine_friendly_home_}, {"friendly_stage", engine_friendly_stage_}, {"friendly_month", engine_friendly_month_}, {"calendar_day", engine_calendar_day_}, {"move_id", engine_move_id_}, {"credit_preview", engine_credit_}, {"credit_edits", engine_credit_edits_}, {"training_draft", engine_training_draft_}, {"tactics_draft", engine_tactics_draft_}, {"player_profile", engine_player_}, {"lineup_selected", lineup_selected_}, {"focus", engine_focus_}, {"selected_camp", engine_camp_}, {"notice", engine_notice_}};
}