Players wear shirt numbers the manager can change

Every player keeps a number from 1 to 99, unique within his squad. The
line-up shows it and changes it by a click; the tactics sketch and the
match sheet wear it too.

Engine: shirt_numbers.hpp, squad read player.shirtNumber, command
lineup.setNumber; saved in state/modern.json.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
MichaelandClaude Fable 5.2 committed 2026-11-17 16:58:34 +01:00
1 parent 7b3f52d809
commit 72e06aabdb
20 files changed
+304 -8

No files matched your search

+2 -2
View File
@@ -204,7 +204,7 @@ std::string App::live_roster(const Json &owner) {
last = "<div class=\"mv-ko\"><span class=\"bar\"><div style=\"width:" + std::to_string(value) + "%;background-color:" +
(value > 70 ? "#56874a" : value > 50 ? "#d9a441" : "#c8372d") + ";\"></div></span><span>" + std::to_string(value) + "</span></div>";
}
out += "<div class=\"mv-tr\" data-live-player=\"" + esc(id) + "\">" + cell(std::to_string(i + 1), "w1") +
out += "<div class=\"mv-tr\" data-live-player=\"" + esc(id) + "\">" + cell(engine_shirt(id, i + 1), "w1") +
cell(live_position_text(row.value("position", Json())), "w2 l pos") +
"<span class=\"nm\"><span class=\"t\">" + esc(row.at("name").get<std::string>()) + "</span>" + badges + "</span>" +
cell(lineup_value(row.at(national ? "caps" : "strength")), "w3") + last + "</div>";
@@ -328,7 +328,7 @@ std::string App::live_dialog_markup(const Json &owner) {
if (chosen) names[bench] = rows[i].at("name").get<std::string>();
const std::string strength = lineup_value(rows[i].value("strength", Json())), condition = lineup_value(rows[i].value("condition", Json()));
lists[bench] += btn(bench ? "live-pick-in" : "live-pick-out",
"<span class=\"nr\">" + std::to_string(i + 1) + "</span><span class=\"ps\">" + esc(live_position_text(rows[i].value("position", Json()))) + "</span><span class=\"nm\">" +
"<span class=\"nr\">" + engine_shirt(id, i + 1) + "</span><span class=\"ps\">" + esc(live_position_text(rows[i].value("position", Json()))) + "</span><span class=\"nm\">" +
esc(rows[i].at("name").get<std::string>()) + "</span><span class=\"vl\">" + esc(strength + " · " + condition) + "</span>",
std::string("mv-pick") + (chosen ? " selected" : ""),
"id=\"live-pick-" + std::to_string(i) + "\" data-id=\"" + esc(id) + "\" aria-pressed=\"" + (chosen ? "true" : "false") + "\"");