From 2d66609ca8a34442831b793b136e0b795ac93c1e Mon Sep 17 00:00:00 2001 From: Weyoune Date: Sat, 14 Nov 2026 00:14:44 +0100 Subject: [PATCH] Show the post-match review of a played Modern kickoff The review is built from the engine's recording; an engine career draws no demo desk beneath it and returns to the real desk. Co-Authored-By: Claude Fable 5.2 --- src/modern/ui/demo_post_match.cpp | 4 ++-- src/modern/ui/engine_live.cpp | 2 ++ src/modern/ui/live_controls.inc | 3 +-- src/modern/ui/live_screens.inc | 2 +- src/modern/ui/postmatch_controls.inc | 2 +- src/modern/ui/postmatch_screens.inc | 19 ++++++++++++------- 6 files changed, 19 insertions(+), 13 deletions(-) diff --git a/src/modern/ui/demo_post_match.cpp b/src/modern/ui/demo_post_match.cpp index 95e1574..046f9f5 100644 --- a/src/modern/ui/demo_post_match.cpp +++ b/src/modern/ui/demo_post_match.cpp @@ -86,7 +86,7 @@ Json provenance(const Json &fixture) { {"world", fixture.at("world")}, {"date", fixture.at("date")}, {"role", fixture.at("role")}, {"surface", fixture.at("surface")}, {"duration", fixture.at("duration")}, {"field_count", fixture.at("field_count")}, - {"notice", "UI-Demo · Rückblick auf vorgegebene Ergebnisse, keine Spielsimulation"}}; + {"notice", fixture.at("source") == "engine-recording" ? "Rückblick auf den gespielten Spieltag" : "UI-Demo · Rückblick auf vorgegebene Ergebnisse, keine Spielsimulation"}}; } Json match_events(const Json &events, const Json &match_id) { Json rows = Json::array(); @@ -172,7 +172,7 @@ Json make_demo_post_match(const Json &fixture, size_t completed_sequence, const else out["tables"].push_back({{"id", "ui-table:" + match.at("id").get()}, {"match_ids", Json::array({match.at("id")})}, {"rows", final.at("standings")}, - {"notice", "Vorgegebener POC-Tabellenstand der Liveaufnahme"}, + {"notice", fixture.at("source") == "engine-recording" ? "Tabellenstand nach diesem Spieltag" : "Vorgegebener POC-Tabellenstand der Liveaufnahme"}, {"wins", nullptr}, {"draws", nullptr}, {"losses", nullptr}}); } } diff --git a/src/modern/ui/engine_live.cpp b/src/modern/ui/engine_live.cpp index c2e0183..42efb2a 100644 --- a/src/modern/ui/engine_live.cpp +++ b/src/modern/ui/engine_live.cpp @@ -100,6 +100,8 @@ Json engine_live_fixture(const Json &recording, const Json &bundle) { const std::string role = out.value("role", "club") == "national" ? "national" : "club"; out["role"] = role; if (!out.contains("surface")) out["surface"] = "outdoor"; + if (!out.contains("date")) out["date"] = ""; + try { out["world"] = bundle.at("desktop").at("meta").at("worldId"); } catch (const std::exception &) { out["world"] = ""; } // The desk manager's squad in line-up order (the squad after the kickoff). std::string desk_team; diff --git a/src/modern/ui/live_controls.inc b/src/modern/ui/live_controls.inc index c7d2f68..10ecbc8 100644 --- a/src/modern/ui/live_controls.inc +++ b/src/modern/ui/live_controls.inc @@ -147,8 +147,7 @@ bool App::live_action(const std::string &action, Rml::Element *target) { } else if (action == "live-pause") { live_set_speed(live_.speed() ? 0 : 1); return true; } else if (action == "live-review" && live_.finished()) { - if (live_.fixture().at("source") == "engine-recording") live_close(); else postmatch_open(); - return true; + postmatch_open();return true; } else if (action == "live-review-back") { postmatch_action("postmatch-ticker",target);return true; } else if (action == "live-intervene-lineup" || action == "live-intervene-tactics") { diff --git a/src/modern/ui/live_screens.inc b/src/modern/ui/live_screens.inc index a4dffdb..01cb038 100644 --- a/src/modern/ui/live_screens.inc +++ b/src/modern/ui/live_screens.inc @@ -201,7 +201,7 @@ std::string App::render_live() { out += "
" + live_detail(owner, frame) + "
" + btn("live-intervene-lineup", "Aufstellung & Wechsel", "", "id=\"live-lineup-edit\" " + std::string(live_.finished() || recorded ? "disabled" : "")) + "
"; out += "
" + live_text("+") + "" + esc(live_.finished() ? "Ende" : live_.speed() ? std::to_string(live_.speed()) + "×" : "Pause") + "
"; out += "
" + btn("live-back", recorded ? "Zum Schreibtisch" : "Zum Desktop", "", "id=\"live-back\"") + btn("live-pause", live_.speed() ? "Pause" : "Abspielen", "", "id=\"live-pause\" " + std::string(live_.finished() ? "disabled" : "")) + "
" + esc(live_feedback_.empty() ? std::string(phase_text) + " · " + std::to_string(minute) + (recorded ? "′" : "′ · keine Spielwertänderung") : live_feedback_) + "" + - btn(live_.finished() ? "live-review" : "live-next", live_.finished() ? (recorded ? "Zum Schreibtisch" : "Zur Auswertung") : "Nächste Meldung", "", "id=\"" + std::string(live_.finished() ? "live-review" : "live-next") + "\"") + "
"; + btn(live_.finished() ? "live-review" : "live-next", live_.finished() ? "Zur Auswertung" : "Nächste Meldung", "", "id=\"" + std::string(live_.finished() ? "live-review" : "live-next") + "\"") + ""; return out + live_dialog_markup(owner) + ""; } void App::live_after_render() { diff --git a/src/modern/ui/postmatch_controls.inc b/src/modern/ui/postmatch_controls.inc index c961f0d..b34d2b0 100644 --- a/src/modern/ui/postmatch_controls.inc +++ b/src/modern/ui/postmatch_controls.inc @@ -7,7 +7,7 @@ bool App::postmatch_open() { message("Die Auswertung dieser Aufnahme ist nicht verfügbar."); return false; } - try { + if (live_.fixture().at("source") != "engine-recording") try { const auto current = snap(); if (source_.get() != live_source_ || current.world != live_world_ || current.revision != live_.fixture().at("source_revision")) { diff --git a/src/modern/ui/postmatch_screens.inc b/src/modern/ui/postmatch_screens.inc index 23f6bf9..2b86ad3 100644 --- a/src/modern/ui/postmatch_screens.inc +++ b/src/modern/ui/postmatch_screens.inc @@ -328,8 +328,10 @@ std::string App::render_postmatch() { esc(m.at("id").get()) + "\""); } body += "

" + - live_text("Vorgegebene Aufzeichnung der menschlichen Partien · " - "kein vollständiger Ligaspieltag") + + live_text(postmatch_data_.at("source") == "engine-recording" + ? "Partien mit eigener Beteiligung · alle Ergebnisse stehen unter Ligaspiele und Übrige Spiele" + : "Vorgegebene Aufzeichnung der menschlichen Partien · " + "kein vollständiger Ligaspieltag") + "

"; } else if (postmatch_tab_ == "report") body += postmatch_report_markup(postmatch_report()); @@ -394,8 +396,10 @@ std::string App::render_postmatch() { } body += "

" + - live_text("Vorgegebener POC-Tabellenstand · Siege, Unentschieden und " - "Niederlagen nicht aufgezeichnet") + + live_text(postmatch_data_.at("source") == "engine-recording" + ? "Tabellenstand nach diesem Spieltag" + : "Vorgegebener POC-Tabellenstand · Siege, Unentschieden und " + "Niederlagen nicht aufgezeichnet") + "

"; for (const auto *label : @@ -431,12 +435,12 @@ std::string App::render_postmatch() { "id=\"postmatch-prev\" " + std::string(position == 0 ? "disabled" : "")) + live_text(std::to_string(position + 1) + " / " + - std::to_string(tabs.size()) + " · UI-Aufzeichnung", + std::to_string(tabs.size()) + (engine_mode_ ? "" : " · UI-Aufzeichnung"), "postmatch-status") + btn("postmatch-ticker", "Zum Ticker", {}, "id=\"postmatch-ticker\"") + btn("postmatch-next", - position + 1 == tabs.size() ? "Zum Desktop" : "Weiter ›", {}, + position + 1 == tabs.size() ? (engine_mode_ ? "Zum Schreibtisch" : "Zum Desktop") : "Weiter ›", {}, "id=\"postmatch-next\"") + ""; if (!postmatch_dialog_.empty()) { @@ -498,7 +502,8 @@ std::string App::render_postmatch() { std::string(match ? "" : "disabled")) + "
"; } - return render_desktop() + + // An engine career has no demo desk to draw beneath the review; its background stays. + return (engine_mode_ ? std::string() : render_desktop()) + "
" + btn("postmatch-desktop", "×", "close",