Offer only the tactics the match engine reads; suggest a change after an own injury

In a live match the tactics board shows the attitude and the commitment
with what they do; the play-pattern items have no effect on a match and
are not offered there. When an own starter is injured the match stops and
the strongest bench player of his position is offered as the change.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
MichaelandClaude Fable 5.2 committed 2026-11-14 12:01:17 +01:00
1 parent 1732a2477b
commit bd20960f90
3 files changed
+42 -1

No files matched your search

+5
View File
@@ -112,9 +112,13 @@ std::string App::live_detail(const Json &owner, const Json &frame) {
}
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>";
// the match engine reads the attitude (item 0) and the commitment (item 7); the play
// patterns between them have no effect on a match and are not offered here
for (size_t i = 0; i < engine_live_tactics_.size(); ++i)
if (i == 0 || i == 7)
out += "<div class=\"live-tactic-row\">" + live_text(engine_live_tactics_[i].at("label").get<std::string>()) +
live_text(i == 0 && engine_live_assistant_ ? std::string("Assistent passt an") : live_tactic_value(i, engine_live_tactics_[i].at("value").get<int>(), engine_live_tactics_[i].at("max").get<int>())) + "</div>";
out += "<p class=\"live-note\">" + live_text("Offensiver heißt mehr eigene Chancen und mehr Chancen für den Gegner. Mehr Einsatz bringt Druck nach vorn, aber auch mehr Karten und Verletzungen.") + "</p>";
return out + btn("live-intervene-tactics", "Taktik ändern", "", "id=\"live-tactics-edit\"") + "</div>";
}
if (live_tab_ == "tactics" && recorded)
@@ -177,6 +181,7 @@ std::string App::live_dialog_markup(const Json &owner) {
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)
if (!engine_board || i == 0 || i == 7)
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", engine_board ? live_tactic_value(i, values[i].get<int>(), engine_live_tactics_[i].at("max").get<int>()) : "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\"") +