Bind league fixtures and round navigation to live engine data (by Codex)
This commit is contained in:
1 parent
1c35698dbe
commit
545e16f153
21 files changed
+207
-31
No files matched your search
@@ -70,10 +70,11 @@ std::string App::render_reports(const std::string &mode) {
|
||||
: rows.size() >= 20 ? (1682 - heading_height) / rows.size() : 80;
|
||||
std::string body = "<div id=\"report-underlay\" class=\"report-underlay\">";
|
||||
if (matches) {
|
||||
const int round = std::clamp(state.value("round", 0), 0,
|
||||
const int round = engine_mode_?engine_fixtures_value_.at("round").get<int>()-1:std::clamp(state.value("round", 0), 0,
|
||||
report_round_count(*world_, state, mode == "other") - 1);
|
||||
std::string subtitle;
|
||||
if (mode == "league" || state.value("competition", 0) == 0)
|
||||
if(engine_mode_){const auto &l=engine_fixtures_value_.at("league");subtitle=(l.at("nationId").is_string()?world_->nation_name(l.at("nationId")):std::string())+" · "+l.at("name").get<std::string>();}
|
||||
else if (mode == "league" || state.value("competition", 0) == 0)
|
||||
subtitle = (league ? world_->nation_name(league->value("nation", "")) : "") +
|
||||
" · " + (league ? world_->name(*league) : "");
|
||||
else {
|
||||
@@ -136,7 +137,7 @@ std::string App::render_reports(const std::string &mode) {
|
||||
std::string value;
|
||||
if (matches)
|
||||
value = row.at("home_goals").is_null() || row.at("away_goals").is_null()
|
||||
? "–" : report_number(row["home_goals"]) + " : " + report_number(row["away_goals"]);
|
||||
? (engine_mode_&&(row.value("status","")=="rescheduled"||row.value("status","")=="postponed")?"verlegt":"–") : report_number(row["home_goals"]) + " : " + report_number(row["away_goals"]);
|
||||
else if (!strengths && column == 5)
|
||||
value = row.value("form_text", "");
|
||||
else if (!strengths && column == 7)
|
||||
@@ -171,7 +172,7 @@ std::string App::render_reports(const std::string &mode) {
|
||||
body += btn("report-round", i ? "›" : "‹", "report-round",
|
||||
"id=\"report-round-" + std::string(i ? "next" : "previous") +
|
||||
"\" data-id=\"" + (i ? "1" : "-1") + "\" style=\"" +
|
||||
rect(i * 130, 0, 110, 94) + "\" " + (opening ? "disabled" : ""));
|
||||
rect(i * 130, 0, 110, 94) + "\" " + ((opening||(engine_mode_&&(i?engine_fixtures_value_.at("round")==engine_fixtures_value_.at("rounds"):engine_fixtures_value_.at("round")==1))) ? "disabled" : ""));
|
||||
body += mode == "league" ? report_picker("country", 260, 1060) + report_picker("league", 1340, 1272)
|
||||
: report_picker("competition", 260, 2352);
|
||||
} else if (strengths)
|
||||
|
||||
Reference in new issue
Block a user