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 <noreply@anthropic.com>
This commit is contained in:
1 parent
7c0e66affe
commit
2d66609ca8
6 files changed
+19
-13
No files matched your search
@@ -86,7 +86,7 @@ Json provenance(const Json &fixture) {
|
|||||||
{"world", fixture.at("world")}, {"date", fixture.at("date")},
|
{"world", fixture.at("world")}, {"date", fixture.at("date")},
|
||||||
{"role", fixture.at("role")}, {"surface", fixture.at("surface")},
|
{"role", fixture.at("role")}, {"surface", fixture.at("surface")},
|
||||||
{"duration", fixture.at("duration")}, {"field_count", fixture.at("field_count")},
|
{"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 match_events(const Json &events, const Json &match_id) {
|
||||||
Json rows = Json::array();
|
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<std::string>()},
|
else out["tables"].push_back({{"id", "ui-table:" + match.at("id").get<std::string>()},
|
||||||
{"match_ids", Json::array({match.at("id")})},
|
{"match_ids", Json::array({match.at("id")})},
|
||||||
{"rows", final.at("standings")},
|
{"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}});
|
{"wins", nullptr}, {"draws", nullptr}, {"losses", nullptr}});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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";
|
const std::string role = out.value("role", "club") == "national" ? "national" : "club";
|
||||||
out["role"] = role;
|
out["role"] = role;
|
||||||
if (!out.contains("surface")) out["surface"] = "outdoor";
|
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).
|
// The desk manager's squad in line-up order (the squad after the kickoff).
|
||||||
std::string desk_team;
|
std::string desk_team;
|
||||||
|
|||||||
@@ -147,8 +147,7 @@ bool App::live_action(const std::string &action, Rml::Element *target) {
|
|||||||
} else if (action == "live-pause") {
|
} else if (action == "live-pause") {
|
||||||
live_set_speed(live_.speed() ? 0 : 1); return true;
|
live_set_speed(live_.speed() ? 0 : 1); return true;
|
||||||
} else if (action == "live-review" && live_.finished()) {
|
} else if (action == "live-review" && live_.finished()) {
|
||||||
if (live_.fixture().at("source") == "engine-recording") live_close(); else postmatch_open();
|
postmatch_open();return true;
|
||||||
return true;
|
|
||||||
} else if (action == "live-review-back") {
|
} else if (action == "live-review-back") {
|
||||||
postmatch_action("postmatch-ticker",target);return true;
|
postmatch_action("postmatch-ticker",target);return true;
|
||||||
} else if (action == "live-intervene-lineup" || action == "live-intervene-tactics") {
|
} else if (action == "live-intervene-lineup" || action == "live-intervene-tactics") {
|
||||||
|
|||||||
@@ -201,7 +201,7 @@ std::string App::render_live() {
|
|||||||
out += "</nav><div id=\"live-detail-body\" class=\"live-detail-body\" tabindex=\"0\">" + live_detail(owner, frame) + "</div><footer class=\"live-detail-footer\">" + btn("live-intervene-lineup", "Aufstellung & Wechsel", "", "id=\"live-lineup-edit\" " + std::string(live_.finished() || recorded ? "disabled" : "")) + "</footer></aside></div>";
|
out += "</nav><div id=\"live-detail-body\" class=\"live-detail-body\" tabindex=\"0\">" + live_detail(owner, frame) + "</div><footer class=\"live-detail-footer\">" + btn("live-intervene-lineup", "Aufstellung & Wechsel", "", "id=\"live-lineup-edit\" " + std::string(live_.finished() || recorded ? "disabled" : "")) + "</footer></aside></div>";
|
||||||
out += "<div class=\"live-speed\">" + live_text("+") + "<input id=\"live-speed\" type=\"range\" orientation=\"vertical\" min=\"0\" max=\"4\" step=\"1\" value=\"" + std::to_string(4 - live_.speed()) + "\" aria-label=\"Wiedergabegeschwindigkeit; unten Pause\" aria-valuenow=\"" + std::to_string(live_.speed()) + "\" " + (live_.finished() ? "disabled" : "") + "/><span id=\"live-speed-value\" class=\"live-speed-value\">" + esc(live_.finished() ? "Ende" : live_.speed() ? std::to_string(live_.speed()) + "×" : "Pause") + "</span></div>";
|
out += "<div class=\"live-speed\">" + live_text("+") + "<input id=\"live-speed\" type=\"range\" orientation=\"vertical\" min=\"0\" max=\"4\" step=\"1\" value=\"" + std::to_string(4 - live_.speed()) + "\" aria-label=\"Wiedergabegeschwindigkeit; unten Pause\" aria-valuenow=\"" + std::to_string(live_.speed()) + "\" " + (live_.finished() ? "disabled" : "") + "/><span id=\"live-speed-value\" class=\"live-speed-value\">" + esc(live_.finished() ? "Ende" : live_.speed() ? std::to_string(live_.speed()) + "×" : "Pause") + "</span></div>";
|
||||||
out += "<footer class=\"live-bottom\"><div class=\"live-bottom-actions\">" + 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" : "")) + "</div><span id=\"live-playback-status\" class=\"live-bottom-note\">" + esc(live_feedback_.empty() ? std::string(phase_text) + " · " + std::to_string(minute) + (recorded ? "′" : "′ · keine Spielwertänderung") : live_feedback_) + "</span>" +
|
out += "<footer class=\"live-bottom\"><div class=\"live-bottom-actions\">" + 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" : "")) + "</div><span id=\"live-playback-status\" class=\"live-bottom-note\">" + esc(live_feedback_.empty() ? std::string(phase_text) + " · " + std::to_string(minute) + (recorded ? "′" : "′ · keine Spielwertänderung") : live_feedback_) + "</span>" +
|
||||||
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") + "\"") + "</footer>";
|
btn(live_.finished() ? "live-review" : "live-next", live_.finished() ? "Zur Auswertung" : "Nächste Meldung", "", "id=\"" + std::string(live_.finished() ? "live-review" : "live-next") + "\"") + "</footer>";
|
||||||
return out + live_dialog_markup(owner) + "</section>";
|
return out + live_dialog_markup(owner) + "</section>";
|
||||||
}
|
}
|
||||||
void App::live_after_render() {
|
void App::live_after_render() {
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ bool App::postmatch_open() {
|
|||||||
message("Die Auswertung dieser Aufnahme ist nicht verfügbar.");
|
message("Die Auswertung dieser Aufnahme ist nicht verfügbar.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
try {
|
if (live_.fixture().at("source") != "engine-recording") try {
|
||||||
const auto current = snap();
|
const auto current = snap();
|
||||||
if (source_.get() != live_source_ || current.world != live_world_ ||
|
if (source_.get() != live_source_ || current.world != live_world_ ||
|
||||||
current.revision != live_.fixture().at("source_revision")) {
|
current.revision != live_.fixture().at("source_revision")) {
|
||||||
|
|||||||
@@ -328,8 +328,10 @@ std::string App::render_postmatch() {
|
|||||||
esc(m.at("id").get<std::string>()) + "\"");
|
esc(m.at("id").get<std::string>()) + "\"");
|
||||||
}
|
}
|
||||||
body += "</div><p class=\"postmatch-scope-note\">" +
|
body += "</div><p class=\"postmatch-scope-note\">" +
|
||||||
live_text("Vorgegebene Aufzeichnung der menschlichen Partien · "
|
live_text(postmatch_data_.at("source") == "engine-recording"
|
||||||
"kein vollständiger Ligaspieltag") +
|
? "Partien mit eigener Beteiligung · alle Ergebnisse stehen unter Ligaspiele und Übrige Spiele"
|
||||||
|
: "Vorgegebene Aufzeichnung der menschlichen Partien · "
|
||||||
|
"kein vollständiger Ligaspieltag") +
|
||||||
"</p>";
|
"</p>";
|
||||||
} else if (postmatch_tab_ == "report")
|
} else if (postmatch_tab_ == "report")
|
||||||
body += postmatch_report_markup(postmatch_report());
|
body += postmatch_report_markup(postmatch_report());
|
||||||
@@ -394,8 +396,10 @@ std::string App::render_postmatch() {
|
|||||||
}
|
}
|
||||||
body +=
|
body +=
|
||||||
"<p class=\"postmatch-table-note\">" +
|
"<p class=\"postmatch-table-note\">" +
|
||||||
live_text("Vorgegebener POC-Tabellenstand · Siege, Unentschieden und "
|
live_text(postmatch_data_.at("source") == "engine-recording"
|
||||||
"Niederlagen nicht aufgezeichnet") +
|
? "Tabellenstand nach diesem Spieltag"
|
||||||
|
: "Vorgegebener POC-Tabellenstand · Siege, Unentschieden und "
|
||||||
|
"Niederlagen nicht aufgezeichnet") +
|
||||||
"</p><div id=\"postmatch-table\" class=\"postmatch-table-scroll\"><div "
|
"</p><div id=\"postmatch-table\" class=\"postmatch-table-scroll\"><div "
|
||||||
"class=\"postmatch-table-row heading\">";
|
"class=\"postmatch-table-row heading\">";
|
||||||
for (const auto *label :
|
for (const auto *label :
|
||||||
@@ -431,12 +435,12 @@ std::string App::render_postmatch() {
|
|||||||
"id=\"postmatch-prev\" " +
|
"id=\"postmatch-prev\" " +
|
||||||
std::string(position == 0 ? "disabled" : "")) +
|
std::string(position == 0 ? "disabled" : "")) +
|
||||||
live_text(std::to_string(position + 1) + " / " +
|
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") +
|
"postmatch-status") +
|
||||||
btn("postmatch-ticker", "<span id=\"live-review-back\">Zum Ticker</span>",
|
btn("postmatch-ticker", "<span id=\"live-review-back\">Zum Ticker</span>",
|
||||||
{}, "id=\"postmatch-ticker\"") +
|
{}, "id=\"postmatch-ticker\"") +
|
||||||
btn("postmatch-next",
|
btn("postmatch-next",
|
||||||
position + 1 == tabs.size() ? "Zum Desktop" : "Weiter ›", {},
|
position + 1 == tabs.size() ? (engine_mode_ ? "Zum Schreibtisch" : "Zum Desktop") : "Weiter ›", {},
|
||||||
"id=\"postmatch-next\"") +
|
"id=\"postmatch-next\"") +
|
||||||
"</footer></section>";
|
"</footer></section>";
|
||||||
if (!postmatch_dialog_.empty()) {
|
if (!postmatch_dialog_.empty()) {
|
||||||
@@ -498,7 +502,8 @@ std::string App::render_postmatch() {
|
|||||||
std::string(match ? "" : "disabled")) +
|
std::string(match ? "" : "disabled")) +
|
||||||
"</footer></section></div>";
|
"</footer></section></div>";
|
||||||
}
|
}
|
||||||
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()) +
|
||||||
"<div class=\"fill\" style=\"z-index:100;\"><div class=\"window "
|
"<div class=\"fill\" style=\"z-index:100;\"><div class=\"window "
|
||||||
"postmatch-window\"><div class=\"titlebar\">" +
|
"postmatch-window\"><div class=\"titlebar\">" +
|
||||||
btn("postmatch-desktop", "<span>×</span>", "close",
|
btn("postmatch-desktop", "<span>×</span>", "close",
|
||||||
|
|||||||
Reference in new issue
Block a user