diff --git a/src/modern/ui/engine_dto.cpp b/src/modern/ui/engine_dto.cpp index 55e8db4..cb685ac 100644 --- a/src/modern/ui/engine_dto.cpp +++ b/src/modern/ui/engine_dto.cpp @@ -527,7 +527,10 @@ Json engine_contracts_projection(const Json &bundle) { const auto salary = engine_money_minor(person->at("salaryMonthly")); require(salary >= 0 && salary <= std::numeric_limits::max() - total, "Ungültiges Monatsgehalt."); total += salary; require(person->at("contractRemaining").at("unit") == "months" && person->at("offerBlocked").is_boolean(), "Unbekannte Vertragseinheit oder Sperre."); - row["name"] = person->at("name"); row["position"] = person->at("position"); + // the squad row carries the player's name as the world spells it; the contract read only + // has the short upper-case form of the original + if (!row.contains("name") || !row.at("name").is_string() || row.at("name").get().empty()) row["name"] = person->at("name"); + row["position"] = person->at("position"); row["age"] = whole_in_range(person->at("age"), 0, 255); row["salary"] = salary; row["months"] = whole_in_range(person->at("contractRemaining").at("value"), 0, 255); row["insurance"] = whole_in_range(person->at("insuranceMonths"), 0, 255); diff --git a/src/modern/ui/engine_lineup.inc b/src/modern/ui/engine_lineup.inc index c13e557..f1a7b0a 100644 --- a/src/modern/ui/engine_lineup.inc +++ b/src/modern/ui/engine_lineup.inc @@ -20,8 +20,7 @@ std::string App::engine_lineup_controls() { } return "

Aufstellung

" "

Zwei Spieler zum Tauschen anklicken.

" - "

Der Tausch wird erst nach Bestätigung übernommen. " - "Formationen, Anweisungen und Schützen sind hier noch nicht angebunden.

" + pairs + + "

Der Tausch wird erst nach Bestätigung übernommen.

" + pairs + "

" + esc(engine_busy_ ? engine_operation_ : engine_notice_) + "

"; } diff --git a/src/modern/ui/engine_live.cpp b/src/modern/ui/engine_live.cpp index 61d1bd6..b70e2ab 100644 --- a/src/modern/ui/engine_live.cpp +++ b/src/modern/ui/engine_live.cpp @@ -5,6 +5,7 @@ #include "modern/ui/engine_live.hpp" #include +#include #include #include @@ -268,7 +269,17 @@ Json engine_live_progress(const Json &previous, const Json &state, const Json &b } Json home = m.at("home"), away = m.at("away"); home["role"] = role; away["role"] = role; - out["matches"].push_back({{"id", id}, {"home", home}, {"away", away}, {"owners", owners}, {"competition", "Spieltag"}, + // the desk announced this fixture with its competition; other matches stay unnamed + std::string competition = "Spieltag"; + try { + const auto &next = bundle.at("desktop").at("data").at("nextFixture"); + if (next.is_object() && next.at("home").at("id") == m.at("home").at("id")) { + competition = next.at("competition").value("text", competition); + std::replace(competition.begin(), competition.end(), '\n', ' '); + } + } catch (const std::exception &) {} + out["matches"].push_back({{"id", id}, {"home", home}, {"away", away}, {"owners", owners}, {"competition", competition}, + {"attendance", m.value("attendance", Json())}, {"weather", m.value("weather", Json())}}); } if (out.at("owners").empty() || out.at("matches").empty()) return failure("live_no_human_match"); diff --git a/src/modern/ui/live_screens.inc b/src/modern/ui/live_screens.inc index dc3b4ae..2e6c45f 100644 --- a/src/modern/ui/live_screens.inc +++ b/src/modern/ui/live_screens.inc @@ -177,7 +177,7 @@ std::string App::live_ticker_events(const Json &frame, size_t &shown) { "
" + live_text(match.at("home").at("name").get() + " · " + match.at("away").at("name").get(), "live-event-owners") + "

" + live_text(event.at("headline")) + "

" + live_text(event.at("body")) + "

" + live_text(live_score_text(event.at("score")), "live-event-score") + ""; ++shown; } - if (!shown) out += "

" + live_text(fixture.at("source") == "engine-recording" ? "Für diesen Filter liegt noch keine Meldung vor." : "Für diesen Filter liegt noch keine Demomeldung vor.") + "

"; + if (!shown) out += "

" + live_text(fixture.at("source") == "engine-recording" ? "Noch keine Meldungen." : "Für diesen Filter liegt noch keine Demomeldung vor.") + "

"; return out; } std::string App::render_live() { @@ -192,13 +192,14 @@ std::string App::render_live() { const bool recorded = fixture.at("source") == "engine-recording"; const auto phase_text = live_.finished() ? "Beendet" : phase == "interval" ? "Halbzeit" : live_.speed() ? (recorded ? (phase == "extra_time" ? "Verlängerung" : phase == "shootout" ? "Elfmeterschießen" : "Spiel läuft") : "Aufzeichnung läuft") : (recorded ? "Pausiert" : "Gemeinsam pausiert"); const auto arrow = [&](bool right) { const auto color = theme_ == "silver" ? "#376b84" : theme_ == "matchday" ? "#efb2aa" : "#b5dbd2"; return picture(renderer_.diagram(right ? "live-arrow-right" : "live-arrow-left", "", 72), 36, 36); }; - std::string out = "
()) + "\">
" + live_text("SPIELTAG · LIVE-TICKER", "live-eyebrow") + + std::string out = "
()) + "\">
" + (recorded ? std::string() : live_text("SPIELTAG · LIVE-TICKER", "live-eyebrow")) + "

" + live_text(live_review_ ? "Ergebnisse & Bericht" : fixture.at("role") == "national" ? "Deutschland · Demo-Länderspiel" : fixture.at("surface") == "indoor" ? "Hallenpartien · 40 Minuten" : recorded ? fixture.at("matches").front().value("competition", std::string("Spieltag")) : std::string("Gemeinsamer Spieltag")) + "

" + live_text(recorded ? fixture.value("date", std::string()) : std::string("UI-Demo · vorgegebene Ergebnisse"), "live-demo-tag") + "
"; const auto scoreline = [&](const Json &match) { const auto &value = live_score_by_id(frame, match.at("id")); return "
" + live_text(match.at("home").at("name"), "live-team-name home") + live_badge(match.at("home"), 58) + live_text(live_score_text(value.at("score")), "live-score") + live_badge(match.at("away"), 58) + live_text(match.at("away").at("name"), "live-team-name away") + "
"; }; out += "

" + live_text("Gemeinsamer Live-Ticker") + "

" + live_text(live_coverage_ == "single" ? "Gewählte Partie" : "Alle Manager", "live-small") + "

" + live_text(recorded ? "Ticker" : "Gemeinsamer Live-Ticker") + "

" + (recorded && fixture.at("owners").size() == 1 ? std::string() : live_text(live_coverage_ == "single" ? "Gewählte Partie" : "Alle Manager", "live-small")) + "
"; size_t shown = 0; out += live_ticker_events(frame, shown); - out += "
" "" + esc(std::to_string(shown) + (live_.fixture().at("source") == "engine-recording" ? " Meldungen" : " Meldungen · feste Aufzeichnung")) + "" + "" + esc(phase_text) + "