Play the Modern kickoff live: minute steps, substitutions and tactics from the ticker
A rehearsal (session.advance with dryRun) settles questions of the run before the kickoff; an extension answered there is agreed at the player's demand of that moment. With an own match the kickoff runs live: one live.step per beat of the speed control, substitutions and the tactics board through live.substitute and live.tactics, and leaving the ticker plays the match to its end. After the final whistle the engine's recording replaces the frames composed on the way. The paused live read names clubs in the world's spelling, and the review table shows wins, draws and losses. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
1 parent
2d66609ca8
commit
a5810b15ae
14 files changed
+456
-31
No files matched your search
@@ -99,6 +99,13 @@ std::string App::live_detail(const Json &owner, const Json &frame) {
|
||||
}
|
||||
return out + "</div>";
|
||||
}
|
||||
if (live_tab_ == "tactics" && live_.running() && engine_live_tactics_.size() == 8) {
|
||||
std::string out = "<div class=\"live-context\"><h3>" + live_text("Taktik in diesem Spiel") + "</h3>";
|
||||
for (size_t i = 0; i < engine_live_tactics_.size(); ++i)
|
||||
out += "<div class=\"live-tactic-row\">" + live_text(engine_live_tactics_[i].at("label").get<std::string>()) +
|
||||
live_text("Wert " + std::to_string(engine_live_tactics_[i].at("value").get<int>())) + "</div>";
|
||||
return out + btn("live-intervene-tactics", "Taktik ändern", "", "id=\"live-tactics-edit\"") + "</div>";
|
||||
}
|
||||
if (live_tab_ == "tactics" && recorded)
|
||||
return "<div class=\"live-context\"><h3>" + live_text("Taktik") + "</h3><p>" + live_text("Dieser Spieltag wurde mit der Aufstellung und Taktik vom Schreibtisch gespielt. Eingriffe während des Spiels folgen mit dem Live-Modus.") + "</p></div>";
|
||||
if (live_tab_ == "tactics") {
|
||||
@@ -127,20 +134,21 @@ std::string App::live_detail(const Json &owner, const Json &frame) {
|
||||
std::string App::live_dialog_markup(const Json &owner) {
|
||||
if (live_dialog_.empty()) return "";
|
||||
const auto rows = live_owner_rows(owner);
|
||||
std::string body = "<h2 id=\"live-dialog-heading\">" + live_text(live_dialog_ == "lineup" ? "Aufstellung & Wechsel · Demo" : "Taktik · Demo") + "</h2><p>" + live_text("Nur lokale Vorschau für " + owner.at("name").get<std::string>() + " · " + owner.at("team").at("name").get<std::string>() + ". Keine Änderung an der Partie; der feste Spielverlauf bleibt unverändert.") + "</p>";
|
||||
std::string body = "<h2 id=\"live-dialog-heading\">" + live_text(live_.running() ? (live_dialog_ == "lineup" ? "Aufstellung & Wechsel" : "Taktik") : live_dialog_ == "lineup" ? "Aufstellung & Wechsel · Demo" : "Taktik · Demo") + "</h2><p>" + live_text(live_.running() ? owner.at("team").at("name").get<std::string>() + " · Das Spiel steht, bis du entschieden hast." : "Nur lokale Vorschau für " + owner.at("name").get<std::string>() + " · " + owner.at("team").at("name").get<std::string>() + ". Keine Änderung an der Partie; der feste Spielverlauf bleibt unverändert.") + "</p>";
|
||||
if (live_dialog_ == "lineup") {
|
||||
std::vector<std::pair<std::string, std::string>> active, bench;
|
||||
for (size_t i = 0; i < rows.size(); ++i) (i < size_t(live_.fixture().at("field_count").get<int>()) ? active : bench).emplace_back(rows[i].at("id"), rows[i].at("name"));
|
||||
body += "<label for=\"live-player-out\">" + live_text("Vom Feld") + select("live-player-out", active, live_out_) + "</label><label for=\"live-player-in\">" + live_text("Von der Ersatzbank") + select("live-player-in", bench, live_in_) + "</label>";
|
||||
if (active.empty() || bench.empty()) body += "<p>" + live_text("Für diese Demokaderbasis ist kein Wechselpaar verfügbar.") + "</p>";
|
||||
if (active.empty() || bench.empty()) body += "<p>" + live_text(live_.running() ? "Kein Wechselpaar verfügbar." : "Für diese Demokaderbasis ist kein Wechselpaar verfügbar.") + "</p>";
|
||||
} else {
|
||||
const std::array<const char *, 8> names{"Defensiv / offensiv", "Pass-/Schussbild unten", "Pass-/Schussbild Mitte", "Pass-/Schussbild links", "Flache / hohe Bälle", "Flügelbild links", "Flügelbild rechts", "Einsatz"};
|
||||
const auto &values = live_dialog_draft_.at("tactics").at("values");
|
||||
const bool engine_board = live_.running() && engine_live_tactics_.size() == 8;
|
||||
const auto &values = engine_board ? live_dialog_draft_.at("values") : live_dialog_draft_.at("tactics").at("values");
|
||||
for (size_t i = 0; i < names.size(); ++i)
|
||||
body += "<div class=\"live-tactic-row\">" + live_text(names[i]) + btn("live-tactic-cycle", "Wert " + std::to_string(values[i].get<int>()), "", "id=\"live-tactic-" + std::to_string(i) + "\" data-id=\"" + std::to_string(i) + "\"") + "</div>";
|
||||
body += "<div class=\"live-tactic-row\">" + live_text(engine_board ? engine_live_tactics_[i].at("label").get<std::string>() : std::string(names[i])) + btn("live-tactic-cycle", "Wert " + std::to_string(values[i].get<int>()), "", "id=\"live-tactic-" + std::to_string(i) + "\" data-id=\"" + std::to_string(i) + "\"") + "</div>";
|
||||
}
|
||||
body += "<div class=\"live-dialog-actions\">" + btn("live-dialog-cancel", "Abbrechen", "", "id=\"live-dialog-cancel\"") +
|
||||
btn("live-dialog-apply", "Demovorschau anzeigen", "", "id=\"live-dialog-apply\" " + std::string(live_dialog_ == "lineup" && (live_out_.empty() || live_in_.empty()) ? "disabled" : "")) + "</div>";
|
||||
btn("live-dialog-apply", live_.running() ? (live_dialog_ == "lineup" ? "Wechsel ausführen" : "Taktik übernehmen") : "Demovorschau anzeigen", "", "id=\"live-dialog-apply\" " + std::string(live_dialog_ == "lineup" && (live_out_.empty() || live_in_.empty()) ? "disabled" : "")) + "</div>";
|
||||
return "<div class=\"live-dialog-layer\"><div id=\"live-dialog\" class=\"live-dialog\" role=\"dialog\" aria-modal=\"true\" aria-labelledby=\"live-dialog-heading\">" + body + "</div></div>";
|
||||
}
|
||||
std::string App::live_ticker_events(const Json &frame, size_t &shown) {
|
||||
@@ -198,10 +206,10 @@ std::string App::render_live() {
|
||||
out += "</div><footer class=\"live-ticker-footer\">" "<span id=\"live-event-count\" class=\"live-small\">" + esc(std::to_string(shown) + (live_.fixture().at("source") == "engine-recording" ? " Meldungen" : " Meldungen · feste Aufzeichnung")) + "</span>" + "<span id=\"live-phase-status\" class=\"live-small\">" + esc(phase_text) + "</span></footer></section></div><aside id=\"live-detail\" class=\"live-detail live-panel\"><header class=\"live-panel-heading\"><div class=\"live-detail-heading\"><h2>" + "<span id=\"live-owner-team\">" + esc(owner.at("team").at("name").get<std::string>()) + "</span></h2><p><span id=\"live-owner-name\">" + esc(owner.at("name").get<std::string>()) + "</span>" + "</p></div><nav class=\"live-team-switch\" aria-label=\"Managerdetails wechseln\">" +
|
||||
btn("live-owner-prev", arrow(false), "", "id=\"live-owner-prev\" aria-label=\"Vorheriger Manager\" " + std::string(fixture.at("owners").size() == 1 ? "disabled" : "")) + btn("live-owner-next", arrow(true), "", "id=\"live-owner-next\" aria-label=\"Nächster Manager\" " + std::string(fixture.at("owners").size() == 1 ? "disabled" : "")) + "</nav></header><nav class=\"live-tabs\">";
|
||||
for (const auto &[id, label] : std::array<std::pair<const char *, const char *>, 5>{{{"team", "Team"}, {"tactics", "Taktik"}, {"opponent", "Gegner"}, {"table", "Live-Tabelle"}, {"stats", "Statistik"}}}) out += btn("live-tab", label, live_tab_ == id ? "selected" : "", "id=\"live-tab-" + std::string(id) + "\" data-id=\"" + id + "\" aria-pressed=\"" + (live_tab_ == id ? "true" : "false") + "\"");
|
||||
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 && !live_.running()) ? "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 += "<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() ? "Zur Auswertung" : "Nächste Meldung", "", "id=\"" + std::string(live_.finished() ? "live-review" : "live-next") + "\"") + "</footer>";
|
||||
out += "<footer class=\"live-bottom\"><div class=\"live-bottom-actions\">" + btn("live-back", live_.running() ? "Zu Ende spielen" : 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() ? "Zur Auswertung" : live_.running() ? "Nächste Minute" : "Nächste Meldung", "", "id=\"" + std::string(live_.finished() ? "live-review" : "live-next") + "\"") + "</footer>";
|
||||
return out + live_dialog_markup(owner) + "</section>";
|
||||
}
|
||||
void App::live_after_render() {
|
||||
|
||||
Reference in new issue
Block a user