Bind the tablet to real mailbox states and engine press events (by Codex)

This commit is contained in:
Codex committed 2026-10-29 11:20:49 +01:00
1 parent 0fc26624d9
commit 256d6d5211
15 files changed
+633 -44

No files matched your search

+7 -1
View File
@@ -32,6 +32,7 @@ void App::engine_accept(EngineReply result) {
engine_toto_poll();
engine_stadium_poll();
engine_transfer_sync();
engine_news_sync();
engine_contracts_poll();
engine_calendar_sync();
engine_friendly_sync();
@@ -80,6 +81,7 @@ void App::engine_poll() {
void App::engine_frame() {
engine_poll();
const bool rendered = needs_render_;
if(needs_render_&&menu_=="news"){last_rendered_menu_=menu_;news_before_render();}
if (needs_render_) engine_render();
engine_sports_update();
if (ticket_) ticket_->update();
@@ -93,6 +95,7 @@ void App::engine_frame() {
if(rendered&&(menu_=="scorers"||menu_=="fairplay")){rankings_restore_scroll();context_->Update();}
if(menu_=="statistics")statistics_restore_scroll();
if(menu_=="transfer")transfer_restore_scroll();
if(menu_=="news")news_after_render();
if(rendered&&files_native_){files_after_render();context_->Update();}
if (center_selects(*doc_)) context_->Update();
if (menu_ == "lineup" && lineup_roster_scroll_) {
@@ -170,6 +173,7 @@ void App::engine_event(Rml::Event &event) {
if(menu_=="stadium"&&stadium_event(event))return;
if(menu_=="transfer"&&transfer_event(event))return;
if(menu_=="achievements"&&career_report_event(event))return;
if(menu_=="news"&&news_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;
@@ -266,6 +270,7 @@ void App::engine_event(Rml::Event &event) {
if(menu_=="stadium"&&stadium_action(action,node))return;
if(menu_=="transfer"&&transfer_action(action,node))return;
if(menu_=="achievements"&&career_report_action(action,node))return;
if(menu_=="news"&&dispatch_news(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;
@@ -282,6 +287,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=="news"){menu_=id;news_dialog_.clear();refresh();}
else if(action=="engine-open"&&id=="achievements"){menu_=id;career_view_=Json::object();refresh();}
else if(action=="engine-open"&&id=="transfer"){menu_=id;transfer_view_=Json::object();transfer_dialog_.clear();engine_transfer_sync();refresh();}
else if(action=="engine-open"&&id=="stadium"){menu_=id;stadium_view_=Json::object();stadium_view_defaults(stadium_view_);engine_stadium_sync();refresh();}
@@ -318,5 +324,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_},
{"achievements_value",engine_mode_&&engine_data_.value("achievements",Json()).value("messageType","")=="snapshot"?achievements_data(career_view_.value("page",0)):Json()},{"career_view",career_view_},{"transfer_value",engine_transfer_value_},{"transfer_filters",engine_transfer_filters_},{"transfer_draft",transfer_draft_},{"transfer_view",transfer_view_},{"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_}};
{"news_error",engine_news_error_},{"news_value",engine_news_value_},{"news_view",news_view_},{"news_undo",engine_news_undo_},{"achievements_value",engine_mode_&&engine_data_.value("achievements",Json()).value("messageType","")=="snapshot"?achievements_data(career_view_.value("page",0)):Json()},{"career_view",career_view_},{"transfer_value",engine_transfer_value_},{"transfer_filters",engine_transfer_filters_},{"transfer_draft",transfer_draft_},{"transfer_view",transfer_view_},{"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_}};
}