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

+18 -1
View File
@@ -521,7 +521,24 @@ void App::engine_event(Rml::Event &event) {
if (action == "popup-confirm") { auto callback=std::move(confirm_);auto text_callback=std::move(text_accept_);const auto text=field("popup-text");popup_.clear();reset_popup();dirty_=true;if(text_callback)text_callback(text);else if(callback)callback(); }
return;
}
if (engine_assembly_open_) { engine_assembly_action(action, id); return; } // the sheet of the interested clubs lies over everything
if (engine_assembly_open_) { engine_assembly_action(action, id); return; }
if (action == "lineup-number" && engine_fresh_ && !engine_busy_ && menu_ == "lineup") {
// a new shirt number for the player; whoever wears it takes his
const std::string player = id;
const auto meta = engine_data_.at("desktop").at("meta");
AmountRequest request;
request.title = "Rückennummer";
request.review_text = [](int64_t) { return "Trägt schon ein anderer Spieler die Nummer, tauschen die beiden."; };
request.unit = "";
try { request.value = std::stoll(engine_shirt(player, 1)); } catch (const std::exception &) { request.value = 1; }
request.min = 1; request.max = 99; request.step = 1; request.suggestion_step = 1; request.review = false;
request.accept = [this, meta, player](int64_t value) {
if (engine_busy_ || !engine_fresh_ || meta != engine_data_.at("desktop").at("meta")) return false;
try { engine_finance_submit(engine_shirt_number_command(engine_data_, player, int(value), editor::new_id("request:ui-"))); } catch (const std::exception &) { return false; }
return true;
};
open_amount(std::move(request)); return;
} // the sheet of the interested clubs lies over everything
if (action == "engine-widget-warning" && menu_.empty() && !engine_busy_) {
const auto rows = engine_widgets_projection(engine_data_).at("warnings");
std::string text;