Paper windows, a display serif and chalk hand, a symmetric tactics board, the match day as a stage

- Material: menu windows are sheets of paper (warm surface, edge, two sheets beneath,
  serif headings) that slide in once when their menu opens; the desk stays glass.
  Source Serif 4 and Cabin Sketch ship in assets/modern/fonts (SIL OFL, see
  THIRD_PARTY_NOTICES.md); system fonts remain the fallback.
- Tactics board: 320 x 200 units mirrored about its middle - the pitch of the
  attitude on the left, six equal tiles for the play settings on the right with
  their names in chalk, the commitment with a scale across the foot.
- Live match: a 4:3 sheet like the menus (same window zoom) on the darkened stadium.
  One score board per match of a human manager - a full-width card for one match,
  two side by side, a 2 x 2 grid for three or four - with crests, a score plate in
  the clubs' colours (read from the crests), a clock ring, a pressure bar, and a
  time line of goals, cards and injuries. Compact ticker rows with a mark per kind,
  a goal banner on the card, a horizontal speed control, and optional halts at half
  time and when falling behind.
- QA: script command demo-start begins a demo career with 1-4 managers.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
MichaelandClaude Fable 5.2 committed 2026-11-14 16:15:11 +01:00
1 parent 54fef90a5b
commit 9b5d448fb6
21 files changed
+887 -125

No files matched your search

+25 -4
View File
@@ -182,6 +182,26 @@ void App::engine_live_poll() {
focus_after_render_ = "live-dialog-apply";
}
} catch (const std::exception &) {}
// the halts the manager asked for: at half time, and when his side falls behind
try {
const auto owner = live_owner();
const auto &match = live_match_by_id(live_.fixture().at("matches"), owner.at("match_id"));
const bool home = match.at("home").at("id") == owner.at("team").at("id");
std::string reason;
for (const auto &e : live_.fixture().at("frames").back().at("events")) {
if (seen.contains(e.at("id").get<std::string>()) || e.at("match_id") != match.at("id")) continue;
const std::string what = e.value("kind", std::string());
if (live_halt_interval_ && what == "interval") reason = "Halbzeit.";
if (live_halt_behind_ && what == "goal" && (e.at("side") == "home") != home) {
const auto &score = e.at("score");
if ((home ? score[0].get<int>() : score[1].get<int>()) < (home ? score[1].get<int>() : score[0].get<int>())) reason = "Rückstand.";
}
}
if (!reason.empty() && live_dialog_.empty() && live_.speed()) {
live_.speed(0);
live_feedback_ = "Angehalten: " + reason;
}
} catch (const std::exception &) {}
}
} else {
live_.speed(0);
@@ -255,9 +275,7 @@ void App::live_set_speed(int value) {
live_feedback_.clear();
live_last_tick_ = SDL_GetTicks64();
if (auto *node = dynamic_cast<Rml::ElementFormControl *>(element("live-speed"))) {
// Native vertical sliders increase downward; the user's logical speed is
// deliberately inverted so the bottom position always means zero/pause.
node->SetValue(std::to_string(4 - value)); node->SetAttribute("aria-valuenow", value);
node->SetValue(std::to_string(value)); node->SetAttribute("aria-valuenow", value);
node->SetAttribute("aria-valuetext", value ? "Wiedergabe Stufe " + std::to_string(value) : "Pause");
}
if (auto *node = element("live-speed-value")) node->SetInnerRML(esc(value ? std::to_string(value) + "×" : "Pause"));
@@ -360,6 +378,9 @@ bool App::live_action(const std::string &action, Rml::Element *target) {
} else if (action == "live-next") {
if (engine_live_running_) { engine_live_elapsed_ = 0; engine_live_send("live.step", {{"minutes", 1}}); return true; }
live_.next(); live_last_tick_ = SDL_GetTicks64();
} else if (action == "live-halt") {
(id == "interval" ? live_halt_interval_ : live_halt_behind_) ^= true;
focus_after_render_ = target->GetId();
} else if (action == "live-pause") {
live_set_speed(live_.speed() ? 0 : 1); return true;
} else if (action == "live-review" && live_.finished()) {
@@ -425,7 +446,7 @@ bool App::live_event(Rml::Event &event) {
if ((type == "change" || type == "input") && speed_control) {
if (setting_menu_markup_) return true;
if (auto *input = dynamic_cast<Rml::ElementFormControl *>(element("live-speed"))) {
try { live_set_speed(4 - std::stoi(input->GetValue())); } catch (const std::exception &) {}
try { live_set_speed(std::stoi(input->GetValue())); } catch (const std::exception &) {}
}
return true;
}