Bind cup reports and linked competition phases to live engine data (by Codex)

This commit is contained in:
Codex committed 2026-10-28 23:03:36 +01:00
1 parent 545e16f153
commit 6b4aa9772d
26 files changed
+402 -33

No files matched your search

+4 -3
View File
@@ -114,11 +114,12 @@ void App::engine_render() {
const auto route = id.substr(4);
const bool camp_allowed = desk.at("menuAvailability").at("camps").value("status", "") == "available";
const auto commands = meta.at("scope").value("allowedCommands", Json::array());
const bool supported = ((route=="tables"||route=="strengths"||route=="league")&&engine_fresh_&&meta.at("scope").at("role")=="club") || (route == "almanac" && engine_fresh_) || (route == "friendlies" && friendlies_available && engine_fresh_) || (route == "calendar" && calendar_available && engine_fresh_) || (route == "postpone" && scheduling_available && engine_fresh_) || (route == "contracts" && contracts_available && engine_fresh_) || (route == "environment" && environment_available && engine_fresh_) || (route == "advertising" && advertising_available && engine_fresh_) || (route == "bank" && bank_available && engine_fresh_) || (route == "training" && training_available && engine_fresh_) || (route == "tactics" && tactics_available && engine_fresh_) || (route == "lineup" && lineup_available && engine_fresh_) || route == "save" || (route == "camp" && engine_fresh_ && camp_allowed && std::find(commands.begin(), commands.end(), Json("camp.book")) != commands.end());
const bool supported = ((route=="tables"||route=="strengths"||route=="league"||route=="other")&&engine_fresh_&&meta.at("scope").at("role")=="club") || (route == "almanac" && engine_fresh_) || (route == "friendlies" && friendlies_available && engine_fresh_) || (route == "calendar" && calendar_available && engine_fresh_) || (route == "postpone" && scheduling_available && engine_fresh_) || (route == "contracts" && contracts_available && engine_fresh_) || (route == "environment" && environment_available && engine_fresh_) || (route == "advertising" && advertising_available && engine_fresh_) || (route == "bank" && bank_available && engine_fresh_) || (route == "training" && training_available && engine_fresh_) || (route == "tactics" && tactics_available && engine_fresh_) || (route == "lineup" && lineup_available && engine_fresh_) || route == "save" || (route == "camp" && engine_fresh_ && camp_allowed && std::find(commands.begin(), commands.end(), Json("camp.book")) != commands.end());
out += desktop_button(id, o, "engine-open", supported && !engine_busy_);
}
}
out += "</div>";
if(menu_=="other")out+="<div class=\"fill\" style=\"z-index:100;\">"+window("Übrige Spiele",engine_other_value_.is_object()?render_reports("other"):"<div class=\"fill center\">"+esc(engine_busy_?"Wettbewerbe werden geladen …":engine_other_index_.is_object()?"Keine aktiven Wettbewerbe.":engine_notice_)+"</div>")+"</div>";
if(menu_=="league")out+="<div class=\"fill\" style=\"z-index:100;\">"+window("Ligaspiele",engine_fixtures_value_.is_object()?render_reports("league"):"<div class=\"fill center\">"+esc(engine_busy_?"Ligaspiele werden geladen …":engine_notice_)+"</div>")+"</div>";
if(menu_=="tables"||menu_=="strengths")out+="<div class=\"fill\" style=\"z-index:100;\">"+window(menu_=="tables"?"Tabelle":"Stärken",engine_reports_read_.is_object()?render_reports(menu_):"<div class=\"fill center\">"+esc(engine_busy_?"Ligabericht wird geladen …":engine_notice_)+"</div>")+"</div>";
if(menu_=="almanac") out+="<div class=\"fill\" style=\"z-index:100;\">"+window("Almanach",engine_almanac_cache_.contains("index")?render_almanac():"<div class=\"fill center\">"+esc(engine_busy_?"Spielarchiv wird geladen …":engine_notice_)+"</div>")+"</div>";
@@ -134,7 +135,7 @@ void App::engine_render() {
if (menu_ == "lineup") out += "<div class=\"fill\" style=\"z-index:100;\">" + window("Aufstellung", render_lineup()) + "</div>";
if (menu_ == "camp") out += "<div class=\"fill\" style=\"z-index:100;\">" + window("Trainingslager", render_camp()) + "</div>";
}
if ((menu_ == "bank" || menu_ == "environment" || menu_ == "advertising" || menu_ == "contracts" || menu_ == "calendar" || menu_ == "postpone" || menu_ == "friendlies" || menu_ == "almanac" || menu_=="tables" || menu_=="strengths" || menu_=="league") && !amount_ && contracts_dialog_.empty() && planning_dialog_.empty()) out += "<div class=\"panel\" style=\"position:absolute;bottom:12dp;left:700dp;right:700dp;padding:9dp;font-size:25dp;z-index:110;\" id=\"engine-status\">" + esc(engine_busy_ ? engine_operation_ : engine_notice_) + "</div>";
if ((menu_ == "bank" || menu_ == "environment" || menu_ == "advertising" || menu_ == "contracts" || menu_ == "calendar" || menu_ == "postpone" || menu_ == "friendlies" || menu_ == "almanac" || menu_=="tables" || menu_=="strengths" || menu_=="league" || menu_=="other") && !amount_ && contracts_dialog_.empty() && planning_dialog_.empty()) out += "<div class=\"panel\" style=\"position:absolute;bottom:12dp;left:700dp;right:700dp;padding:9dp;font-size:25dp;z-index:110;\" id=\"engine-status\">" + esc(engine_busy_ ? engine_operation_ : engine_notice_) + "</div>";
if (menu_.empty() || engine_data_.empty()) out += "<div class=\"panel\" style=\"position:absolute;left:850dp;bottom:24dp;right:100dp;padding:18dp;font-size:27dp;\" id=\"engine-status\">" + esc(engine_busy_ ? engine_operation_ : engine_notice_) + "</div>";
element("canvas")->SetInnerRML(out); ++document_generation_;
scale_chalk_shadow();
@@ -157,7 +158,7 @@ void App::engine_render() {
Rml::ElementList underlay; doc_->QuerySelectorAll(underlay, ".window>.content,.window>.titlebar");
for (auto *node : underlay) { node->SetProperty("pointer-events", "none"); node->SetProperty("filter", "blur(10dp)"); }
}
if(!report_detail_kind_.empty()&&(menu_=="tables"||menu_=="strengths"||menu_=="league")){Rml::ElementList nodes;doc_->QuerySelectorAll(nodes,"#report-underlay button,#window-close");for(auto *n:nodes){n->SetAttribute("disabled",true);n->SetProperty("pointer-events","none");}}
if(!report_detail_kind_.empty()&&(menu_=="tables"||menu_=="strengths"||menu_=="league"||menu_=="other")){Rml::ElementList nodes;doc_->QuerySelectorAll(nodes,"#report-underlay button,#window-close");for(auto *n:nodes){n->SetAttribute("disabled",true);n->SetProperty("pointer-events","none");}}
if (engine_busy_) {
Rml::ElementList controls; doc_->QuerySelectorAll(controls, "#canvas button,#canvas input");
for (auto *node : controls) node->SetAttribute("disabled", true);