diff --git a/assets/modern/art/gui-assets.json b/assets/modern/art/gui-assets.json index 38e9b16..2deaac9 100644 --- a/assets/modern/art/gui-assets.json +++ b/assets/modern/art/gui-assets.json @@ -342,9 +342,9 @@ 1 ] }, - "match.0-cloud-a": { - "file": "match-0-cloud-a.jpg", - "sha256": "4d4eceb28266faee1fa0d94c40e28cc5ceb8fc0575bf53858ac2ae0fca878fed", + "match.pitch-1": { + "file": "pitch-1.jpg", + "sha256": "9fa87fde497f804f1585cef61f7503c712903319bfdaa17cf3949a82852cf582", "crop": [ 0, 0, @@ -352,9 +352,9 @@ 1 ] }, - "match.0-rain-a": { - "file": "match-0-rain-a.jpg", - "sha256": "15c5a0e282c1bffd926ae921508d6888454707ebced796634d0dcb0edf2aaff5", + "match.pitch-2": { + "file": "pitch-2.jpg", + "sha256": "16c51e447404b998e31dc9ce3151b823d3a5776bf0ef6ada4d14ebbc897001fe", "crop": [ 0, 0, @@ -362,9 +362,9 @@ 1 ] }, - "match.0-sun-a": { - "file": "match-0-sun-a.jpg", - "sha256": "d598289eb6f4ca0f2f384fd03d8a6efeeb3fa84515923291d2cd37be9625f133", + "match.pitch-3": { + "file": "pitch-3.jpg", + "sha256": "53c95ecc2a4ca6c3122af97f10dd0025ce1fc380b99eb9356c1d151bad7dadeb", "crop": [ 0, 0, @@ -372,9 +372,9 @@ 1 ] }, - "match.1-cloud-a": { - "file": "match-1-cloud-a.jpg", - "sha256": "54f6742aee42bdfe2a154269df6655f9bfe17aba6c2f6500d3018dde7f799147", + "match.pitch-4": { + "file": "pitch-4.jpg", + "sha256": "300357abac201e62f0f4a813e23e3cbae112511b5023c9cd37366305a5745077", "crop": [ 0, 0, @@ -382,9 +382,9 @@ 1 ] }, - "match.1-cloud-b": { - "file": "match-1-cloud-b.jpg", - "sha256": "87ce906f9b836cb0a4abf4bd36d727296cfdd01b78435926baa877ef2a2f8ba7", + "match.pitch-5": { + "file": "pitch-5.jpg", + "sha256": "07219b4368e5902b90eb995999d026c82477159e1876ff6f82de4d8fbebb5e25", "crop": [ 0, 0, @@ -392,9 +392,9 @@ 1 ] }, - "match.1-fair-a": { - "file": "match-1-fair-a.jpg", - "sha256": "e036af55bfc251a6b870a6c288840785c3666974c56bd4c3885758f760f0ae14", + "match.pitch-6": { + "file": "pitch-6.jpg", + "sha256": "04f5db2f89960f82f49f2507022a328fdadb0097cb12832130a0f512b32c89fb", "crop": [ 0, 0, @@ -402,9 +402,9 @@ 1 ] }, - "match.1-fair-b": { - "file": "match-1-fair-b.jpg", - "sha256": "b8e5d1fc116a3a6810e90a1924cbfe07edbc485d40fafc7e231166e18b182d6d", + "match.pitch-7": { + "file": "pitch-7.jpg", + "sha256": "8374127e15aa050fdc2841a716decedbdefa3337ffe47562f9fbe0a95c025b3e", "crop": [ 0, 0, @@ -412,9 +412,9 @@ 1 ] }, - "match.1-rain-a": { - "file": "match-1-rain-a.jpg", - "sha256": "8bd9f15f4d7376c299652a3926c0e5b8e1334961fe4a7f2c9f399855e6ad0e4c", + "match.pitch-8": { + "file": "pitch-8.jpg", + "sha256": "37b315a5fa75753a51b88e7acc45dbade4ad0c516a4304ec9665b1bff3e0b723", "crop": [ 0, 0, @@ -422,159 +422,9 @@ 1 ] }, - "match.1-snow-a": { - "file": "match-1-snow-a.jpg", - "sha256": "1eef2e5eef55341f774018670375e6f25bd90dba350618b3d3cb143567fe6971", - "crop": [ - 0, - 0, - 1, - 1 - ] - }, - "match.1-snow-b": { - "file": "match-1-snow-b.jpg", - "sha256": "6d3755320065eb150605128275ed99fcd65e97280de0fddd2c7ae2daf4a83f36", - "crop": [ - 0, - 0, - 1, - 1 - ] - }, - "match.1-sun-a": { - "file": "match-1-sun-a.jpg", - "sha256": "aca1eb0fb3464a3769ac84c53360e4dd9c03da9e93a53ae84f4d3e152ff8edf7", - "crop": [ - 0, - 0, - 1, - 1 - ] - }, - "match.1-sun-b": { - "file": "match-1-sun-b.jpg", - "sha256": "27a97ff3ff63522cb0454750c4b8ea2e4bea67963b226652f76d10f2e1b6405f", - "crop": [ - 0, - 0, - 1, - 1 - ] - }, - "match.1-sun-c": { - "file": "match-1-sun-c.jpg", - "sha256": "4456c84d0f99fbbf496c6f8f31c136a342273cec3e8cf8e2a3d9b0bf662ab510", - "crop": [ - 0, - 0, - 1, - 1 - ] - }, - "match.2-fair-a": { - "file": "match-2-fair-a.jpg", - "sha256": "9a27fe7ae5b02b9ca6cf2337f9d59d09ca3cf1a45d27fd65bf41ece071ca66af", - "crop": [ - 0, - 0, - 1, - 1 - ] - }, - "match.2-sun-a": { - "file": "match-2-sun-a.jpg", - "sha256": "581a50c03bd3e63f01cbbacb17ade7dfa653871a3dcf54c04a1d166adac6678c", - "crop": [ - 0, - 0, - 1, - 1 - ] - }, - "match.2-sun-b": { - "file": "match-2-sun-b.jpg", - "sha256": "2cd1e8b80ac928c2f4e59620f4b0b08fb16da7a4b8dd1fe76c061c2b92584055", - "crop": [ - 0, - 0, - 1, - 1 - ] - }, - "match.2-sun-c": { - "file": "match-2-sun-c.jpg", - "sha256": "6d1324fdc94624cf3bc0afc634497701f6337b4a80b3e6da795540bf4f26a697", - "crop": [ - 0, - 0, - 1, - 1 - ] - }, - "match.3-cloud-a": { - "file": "match-3-cloud-a.jpg", - "sha256": "3d753387443d799b99481d0391a1480331a304fa2a67ed635360f23140d5fcde", - "crop": [ - 0, - 0, - 1, - 1 - ] - }, - "match.3-fair-a": { - "file": "match-3-fair-a.jpg", - "sha256": "12bd8529ea65dc29ab5381281ae6a0dca527fcd170fb4529fc71f6b65c14fb0d", - "crop": [ - 0, - 0, - 1, - 1 - ] - }, - "match.3-fair-b": { - "file": "match-3-fair-b.jpg", - "sha256": "1d53c4d2281c89bf4e88a976e6dbd8f89ef9482937eb26c39a79b2c799ea69bd", - "crop": [ - 0, - 0, - 1, - 1 - ] - }, - "match.3-fair-c": { - "file": "match-3-fair-c.jpg", - "sha256": "9e97ad199d11c6643b9fbc76db830d04a72d74f1f923300944fdb37768964031", - "crop": [ - 0, - 0, - 1, - 1 - ] - }, - "match.3-rain-a": { - "file": "match-3-rain-a.jpg", - "sha256": "93a4ba1d3f336c73a1a26853d2df9e1ee381a4453fb3bfbca4c438a52b0a9e3b", - "crop": [ - 0, - 0, - 1, - 1 - ] - }, - "match.3-rain-b": { - "file": "match-3-rain-b.jpg", - "sha256": "6e58c10fda2e43f95ac7706d4d8f8a1ba00263217c4a4e288a5d2613225f3f67", - "crop": [ - 0, - 0, - 1, - 1 - ] - }, - "match.3-snow-a": { - "file": "match-3-snow-a.jpg", - "sha256": "dc6dd65380a5f4d00800c656805803306b58aef78b9f02f6c1ff7a86dd239c77", + "match.pitch-9": { + "file": "pitch-9.jpg", + "sha256": "ff57ca87c64bbbd0185bf9008eca091b72e9b3edee910569b606109f0a946ad1", "crop": [ 0, 0, diff --git a/assets/modern/art/match-0-cloud-a.jpg b/assets/modern/art/match-0-cloud-a.jpg deleted file mode 100644 index a756731..0000000 Binary files a/assets/modern/art/match-0-cloud-a.jpg and /dev/null differ diff --git a/assets/modern/art/match-0-rain-a.jpg b/assets/modern/art/match-0-rain-a.jpg deleted file mode 100644 index b9adfa5..0000000 Binary files a/assets/modern/art/match-0-rain-a.jpg and /dev/null differ diff --git a/assets/modern/art/match-0-sun-a.jpg b/assets/modern/art/match-0-sun-a.jpg deleted file mode 100644 index 809ce18..0000000 Binary files a/assets/modern/art/match-0-sun-a.jpg and /dev/null differ diff --git a/assets/modern/art/match-1-cloud-a.jpg b/assets/modern/art/match-1-cloud-a.jpg deleted file mode 100644 index 9ab63c3..0000000 Binary files a/assets/modern/art/match-1-cloud-a.jpg and /dev/null differ diff --git a/assets/modern/art/match-1-cloud-b.jpg b/assets/modern/art/match-1-cloud-b.jpg deleted file mode 100644 index 04e2363..0000000 Binary files a/assets/modern/art/match-1-cloud-b.jpg and /dev/null differ diff --git a/assets/modern/art/match-1-fair-a.jpg b/assets/modern/art/match-1-fair-a.jpg deleted file mode 100644 index 9d74425..0000000 Binary files a/assets/modern/art/match-1-fair-a.jpg and /dev/null differ diff --git a/assets/modern/art/match-1-fair-b.jpg b/assets/modern/art/match-1-fair-b.jpg deleted file mode 100644 index f5c9296..0000000 Binary files a/assets/modern/art/match-1-fair-b.jpg and /dev/null differ diff --git a/assets/modern/art/match-1-rain-a.jpg b/assets/modern/art/match-1-rain-a.jpg deleted file mode 100644 index 5a29d88..0000000 Binary files a/assets/modern/art/match-1-rain-a.jpg and /dev/null differ diff --git a/assets/modern/art/match-1-snow-a.jpg b/assets/modern/art/match-1-snow-a.jpg deleted file mode 100644 index 0105b72..0000000 Binary files a/assets/modern/art/match-1-snow-a.jpg and /dev/null differ diff --git a/assets/modern/art/match-1-snow-b.jpg b/assets/modern/art/match-1-snow-b.jpg deleted file mode 100644 index 5a4c866..0000000 Binary files a/assets/modern/art/match-1-snow-b.jpg and /dev/null differ diff --git a/assets/modern/art/match-1-sun-a.jpg b/assets/modern/art/match-1-sun-a.jpg deleted file mode 100644 index 7be0d6c..0000000 Binary files a/assets/modern/art/match-1-sun-a.jpg and /dev/null differ diff --git a/assets/modern/art/match-1-sun-b.jpg b/assets/modern/art/match-1-sun-b.jpg deleted file mode 100644 index ee86f29..0000000 Binary files a/assets/modern/art/match-1-sun-b.jpg and /dev/null differ diff --git a/assets/modern/art/match-1-sun-c.jpg b/assets/modern/art/match-1-sun-c.jpg deleted file mode 100644 index 708f015..0000000 Binary files a/assets/modern/art/match-1-sun-c.jpg and /dev/null differ diff --git a/assets/modern/art/match-2-fair-a.jpg b/assets/modern/art/match-2-fair-a.jpg deleted file mode 100644 index 4bc330a..0000000 Binary files a/assets/modern/art/match-2-fair-a.jpg and /dev/null differ diff --git a/assets/modern/art/match-2-sun-a.jpg b/assets/modern/art/match-2-sun-a.jpg deleted file mode 100644 index 68830fa..0000000 Binary files a/assets/modern/art/match-2-sun-a.jpg and /dev/null differ diff --git a/assets/modern/art/match-2-sun-b.jpg b/assets/modern/art/match-2-sun-b.jpg deleted file mode 100644 index 04f0f51..0000000 Binary files a/assets/modern/art/match-2-sun-b.jpg and /dev/null differ diff --git a/assets/modern/art/match-2-sun-c.jpg b/assets/modern/art/match-2-sun-c.jpg deleted file mode 100644 index 0b3e1e3..0000000 Binary files a/assets/modern/art/match-2-sun-c.jpg and /dev/null differ diff --git a/assets/modern/art/match-3-cloud-a.jpg b/assets/modern/art/match-3-cloud-a.jpg deleted file mode 100644 index eb547ed..0000000 Binary files a/assets/modern/art/match-3-cloud-a.jpg and /dev/null differ diff --git a/assets/modern/art/match-3-fair-a.jpg b/assets/modern/art/match-3-fair-a.jpg deleted file mode 100644 index 49e31d0..0000000 Binary files a/assets/modern/art/match-3-fair-a.jpg and /dev/null differ diff --git a/assets/modern/art/match-3-fair-b.jpg b/assets/modern/art/match-3-fair-b.jpg deleted file mode 100644 index 809a80e..0000000 Binary files a/assets/modern/art/match-3-fair-b.jpg and /dev/null differ diff --git a/assets/modern/art/match-3-fair-c.jpg b/assets/modern/art/match-3-fair-c.jpg deleted file mode 100644 index 4bba809..0000000 Binary files a/assets/modern/art/match-3-fair-c.jpg and /dev/null differ diff --git a/assets/modern/art/match-3-rain-a.jpg b/assets/modern/art/match-3-rain-a.jpg deleted file mode 100644 index 7f67678..0000000 Binary files a/assets/modern/art/match-3-rain-a.jpg and /dev/null differ diff --git a/assets/modern/art/match-3-rain-b.jpg b/assets/modern/art/match-3-rain-b.jpg deleted file mode 100644 index d416996..0000000 Binary files a/assets/modern/art/match-3-rain-b.jpg and /dev/null differ diff --git a/assets/modern/art/match-3-snow-a.jpg b/assets/modern/art/match-3-snow-a.jpg deleted file mode 100644 index 9d92c40..0000000 Binary files a/assets/modern/art/match-3-snow-a.jpg and /dev/null differ diff --git a/assets/modern/art/pitch-1.jpg b/assets/modern/art/pitch-1.jpg new file mode 100644 index 0000000..50477e2 Binary files /dev/null and b/assets/modern/art/pitch-1.jpg differ diff --git a/assets/modern/art/pitch-2.jpg b/assets/modern/art/pitch-2.jpg new file mode 100644 index 0000000..9f03469 Binary files /dev/null and b/assets/modern/art/pitch-2.jpg differ diff --git a/assets/modern/art/pitch-3.jpg b/assets/modern/art/pitch-3.jpg new file mode 100644 index 0000000..91bdf31 Binary files /dev/null and b/assets/modern/art/pitch-3.jpg differ diff --git a/assets/modern/art/pitch-4.jpg b/assets/modern/art/pitch-4.jpg new file mode 100644 index 0000000..1f2b2dd Binary files /dev/null and b/assets/modern/art/pitch-4.jpg differ diff --git a/assets/modern/art/pitch-5.jpg b/assets/modern/art/pitch-5.jpg new file mode 100644 index 0000000..a7b4cc6 Binary files /dev/null and b/assets/modern/art/pitch-5.jpg differ diff --git a/assets/modern/art/pitch-6.jpg b/assets/modern/art/pitch-6.jpg new file mode 100644 index 0000000..0cbfca2 Binary files /dev/null and b/assets/modern/art/pitch-6.jpg differ diff --git a/assets/modern/art/pitch-7.jpg b/assets/modern/art/pitch-7.jpg new file mode 100644 index 0000000..b893fff Binary files /dev/null and b/assets/modern/art/pitch-7.jpg differ diff --git a/assets/modern/art/pitch-8.jpg b/assets/modern/art/pitch-8.jpg new file mode 100644 index 0000000..6ed7ec3 Binary files /dev/null and b/assets/modern/art/pitch-8.jpg differ diff --git a/assets/modern/art/pitch-9.jpg b/assets/modern/art/pitch-9.jpg new file mode 100644 index 0000000..2afaf0c Binary files /dev/null and b/assets/modern/art/pitch-9.jpg differ diff --git a/assets/modern/live.rcss b/assets/modern/live.rcss index 1297a93..0e9619e 100644 --- a/assets/modern/live.rcss +++ b/assets/modern/live.rcss @@ -20,9 +20,9 @@ /* match cards */ .mv-cards {display:flex;flex:none;flex-wrap:wrap;gap:22.5dp;height:589.5dp;} -button.mv-card,button.mv-card:hover,.mv-stage button.mv-card,.mv-stage button.mv-card:hover {position:relative;display:flex;flex-direction:column;justify-content:flex-start;align-items:stretch;box-sizing:border-box;width:2025dp;height:589.5dp;margin:0;padding:22.5dp 36dp 18dp;border:3.38dp var(--p-div);border-radius:27dp;background-color:var(--p-n1);decorator:none;color:var(--p-text);overflow:hidden;text-align:left;font-family:Modern;font-size:29.25dp;line-height:39.38dp;} -.mv-stage button.mv-card.duo {width:1001.25dp;padding:22.5dp 27dp 18dp;} -.mv-stage button.mv-card.quad {width:1001.25dp;height:283.5dp;padding:15.75dp 27dp 13.5dp;} +button.mv-card,button.mv-card:hover,.mv-stage button.mv-card,.mv-stage button.mv-card:hover {position:relative;display:flex;flex-direction:column;justify-content:flex-start;align-items:stretch;box-sizing:border-box;width:100%;height:589.5dp;margin:0;padding:22.5dp 36dp 18dp;border:3.38dp var(--p-div);border-radius:27dp;background-color:var(--p-n1);decorator:none;color:var(--p-text);overflow:hidden;text-align:left;font-family:Modern;font-size:29.25dp;line-height:39.38dp;} +.mv-stage button.mv-card.duo {width:996.75dp;padding:22.5dp 27dp 18dp;} +.mv-stage button.mv-card.quad {width:996.75dp;height:283.5dp;padding:15.75dp 27dp 13.5dp;} .mv-stage button.mv-card.duo.sel {border:6.75dp var(--p-accent);padding:19.13dp 23.63dp 14.63dp;background-color:var(--p-a1);} .mv-stage button.mv-card.quad.sel {border:6.75dp var(--p-accent);padding:12.38dp 23.63dp 10.13dp;background-color:var(--p-a1);} .mv-chead {display:flex;flex:none;justify-content:space-between;align-items:center;gap:22.5dp;height:36dp;white-space:nowrap;} @@ -128,6 +128,8 @@ body.calm .mv-goal.fresh {animation:none;} .mv-info .main {display:block;flex:1;min-width:0;} .mv-info .big {display:block;font-family:Display;font-size:45dp;line-height:54dp;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;} .mv-info .sub {display:block;font-size:25.88dp;line-height:33.75dp;margin-top:6.75dp;color:var(--p-n7);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;} +.mv-capbar {display:block;height:13.5dp;margin-top:13.5dp;border-radius:6.75dp;background-color:var(--p-div);overflow:hidden;} +.mv-capbar div {height:100%;border-radius:6.75dp;background-color:var(--p-accent);} .mv-wx {display:flex;flex:none;align-items:center;gap:22.5dp;padding-left:36dp;border-left:3.38dp var(--p-div);} .mv-wx .v {display:block;} .mv-wx .t {display:block;font-family:Display;font-size:49.5dp;line-height:56.25dp;white-space:nowrap;} diff --git a/docs/new_engine/ui-anbindung.md b/docs/new_engine/ui-anbindung.md index 16cf5d8..5dfbed5 100644 --- a/docs/new_engine/ui-anbindung.md +++ b/docs/new_engine/ui-anbindung.md @@ -63,7 +63,7 @@ Die UI ruft diese über `DataSource::read_almanac` und `read_statistics` direkt `ModernSession::read_live` (für `DataSource::read_live`, Abfragen wie die Demo: `{kind: "fixture"}`, `{kind: "frame", sequence}`, optional `revision`, `fixture_id`). Die Engine rechnet einen Spieltag beim Anstoß im Ganzen; der Ticker spielt die **Aufzeichnung** der Spiele des letzten `session.advance` ab (`source: "engine-recording"`, Format `openbmh-live-fixture@1` der Demo): - `matches`: die Spiele mit menschlichem Manager (höchstens vier), `owners`: die Manager mit Team und `match_id` (`view` ist `null`; die Aufstellung kommt aus dem `lineup`-Read). -- `matches` (die Spiele des Tickers) mit `attendance` (Zuschauer) und `weather` (`temperature` in °C, `rain` das Wetterbild 0–7 des Originals; Hallenturnier `null`), schon vor dem Anpfiff; ebenso jede Partie des angehaltenen Live-Anstoßs (aus der Spielgruppe). +- `matches` (die Spiele des Tickers) mit `capacity` (Plätze des Heimstadions, nur wenn der Heimverein von einem Manager geführt wird, sonst `null`), `attendance` (Zuschauer) und `weather` (`temperature` in °C, `rain` das Wetterbild 0–7 des Originals; Hallenturnier `null`), schon vor dem Anpfiff; ebenso jede Partie des angehaltenen Live-Anstoßs (aus der Spielgruppe). - `frames` in Minutenfolge: Anpfiff, jedes Ereignis (Tor, Chance, Karten, Verletzung, Wechsel, Elfmeter), Halbzeit, Wiederanpfiff, Abpfiff; je Spiel Stand, Chancen, Gelb, Rot, Elfmeter, Spieler auf dem Feld. `events` (fortlaufend) mit Überschrift und Satz, Spieler, Seite, Stand. - `conference`: die übrigen Spiele des Tages im Almanach-Format. - `standings` (Live-Tabelle) je Frame: pro Liga eines Ticker-Spiels die Tabelle vor dem Spieltag plus alle Spiele dieser Runde im Anstoß mit dem Stand der Minute (beim Abpfiff das gewertete Ergebnis); Zeilen mit `rank`, `previousRank`, `team`, `played`, `won`, `drawn`, `lost`, `goalsFor`, `goalsAgainst`, `points`. In der Aufzeichnung trägt ein Frame nur die Tabellen, die sich in ihm geändert haben (der erste alle); `kind: frame` liefert den vollständigen Stand bis dahin. Der angehaltene Live-Anstoß liefert `standings` ebenso: je Ligagruppe mit einem Live-Spiel die Tabelle mit den Ständen der laufenden Spiele. Fehler: `live_unavailable` (noch kein Anstoß), `live_no_human_match`, `stale_live_revision`, `stale_live_fixture`, `invalid_live_sequence`. diff --git a/src/modern/app/modern_session.cpp b/src/modern/app/modern_session.cpp index 8b78fda..191a1e2 100644 --- a/src/modern/app/modern_session.cpp +++ b/src/modern/app/modern_session.cpp @@ -8793,6 +8793,12 @@ cli::Json ModernSession::read_live(const cli::Json& request) const { if (const int p = g_.squad_slots.at(range.first + s) & 0x0fff; p != 0x0fff) eleven.push_back(plain_name(p)); starters[side ? "away" : "home"] = std::move(eleven); } + cli::Json home_capacity(nullptr); + if (hm >= 0 && !g_.indoor && g_.manager_records.size() >= size_t(hm) * 0xb0c + 0x54) { + int64_t places = 0; + for (size_t block = 0; block < 8; ++block) places += int64_t(g_.manager_records[size_t(hm) * 0xb0c + 0x4c + block]) * 1000; + if (places > 0) home_capacity = cli::Json(places); + } matches.push_back(O{{"events", std::move(events)}, {"lineups", std::move(starters)}, {"home", O{{"id", modern::ui_team_id(g_, home)}, {"name", club_label(home)}}}, {"away", O{{"id", modern::ui_team_id(g_, away)}, {"name", club_label(away)}}}, @@ -8801,6 +8807,8 @@ cli::Json ModernSession::read_live(const cli::Json& request) const { // the crowd and the weather the kickoff set (descriptor +0x30 temperature, // +0x50 the weather picture 0-7) {"attendance", size_t(m) < grp.spectators.size() ? cli::Json(int64_t(grp.spectators[size_t(m)])) : cli::Json(nullptr)}, + // the places of a managed home ground: its eight stand blocks (record +0x4c.., thousands) + {"capacity", home_capacity}, {"weather", grp.desc.size() > 0x50 + size_t(m) ? cli::Json(cli::Json::Object{{"temperature", int(int8_t(grp.desc[0x30 + size_t(m)]))}, {"rain", int(grp.desc[0x50 + size_t(m)])}}) : cli::Json(nullptr)}, diff --git a/src/modern/ui/engine_live.cpp b/src/modern/ui/engine_live.cpp index bd2473e..7f939c4 100644 --- a/src/modern/ui/engine_live.cpp +++ b/src/modern/ui/engine_live.cpp @@ -320,7 +320,7 @@ Json engine_live_progress(const Json &previous, const Json &state, const Json &b } 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())}, + {"attendance", m.value("attendance", Json())}, {"weather", m.value("weather", Json())}, {"capacity", m.value("capacity", Json())}, {"lineups", m.value("lineups", Json())}}); } if (out.at("owners").empty() || out.at("matches").empty()) return failure("live_no_human_match"); diff --git a/src/modern/ui/engine_screens.inc b/src/modern/ui/engine_screens.inc index 02738e2..4a3b186 100644 --- a/src/modern/ui/engine_screens.inc +++ b/src/modern/ui/engine_screens.inc @@ -244,7 +244,7 @@ void App::engine_render() { const auto size = context_->GetDimensions(); // behind the match sheet lies a stadium that suits the crowd and the weather const std::string ground = live_backdrop(); - element("background")->SetInnerRML(img(ground.empty() ? "background" : ground, size.x / scale_, size.y / scale_, false, true, ground.empty() ? 2048 : 2400)); + element("background")->SetInnerRML(img(ground.empty() ? "background" : ground, size.x / scale_, size.y / scale_, false, true, ground.empty() ? 2048 : 4096)); element("background")->SetProperty("filter", !ground.empty() ? "brightness(0.78)" : theme_ == "silver" ? "saturate(0.2) brightness(0.9)" : theme_ == "matchday" ? "saturate(0.13) brightness(0.56)" : "saturate(0.34) brightness(0.70)"); if (!contracts_dialog_.empty()) { Rml::ElementList underlay; doc_->QuerySelectorAll(underlay, "#contracts-underlay button,.contracts-actions button,#window-close"); diff --git a/src/modern/ui/live_controls.inc b/src/modern/ui/live_controls.inc index 0f0a037..6144dd0 100644 --- a/src/modern/ui/live_controls.inc +++ b/src/modern/ui/live_controls.inc @@ -37,9 +37,18 @@ bool App::live_open() { refresh(); return true; } bool App::engine_live_open(const Json &recording) { - const auto fixture = engine_live_fixture(recording, engine_data_); + auto fixture = engine_live_fixture(recording, engine_data_); // after a kickoff that was followed live the ticker stays on the final whistle const bool at_end = engine_live_at_end_ && scene_ == "live"; + // ... and the manager's eleven stays the one that finished the match, whatever desk the day ends on + if (at_end && fixture.value("ok", false) && !engine_live_roster_.empty()) + for (auto &owner : fixture.at("owners")) + if (owner.at("id") == live_.owner() && owner.contains("view") && owner.at("view").is_object()) owner["view"]["rows"] = engine_live_roster_; + // ... and each ground keeps the places the running match knew + if (at_end && fixture.value("ok", false) && live_.available()) + for (auto &match : fixture.at("matches")) + for (const auto &known : live_.fixture().at("matches")) + if (known.at("home").at("id") == match.at("home").at("id") && known.contains("capacity") && !match.contains("capacity")) match["capacity"] = known.at("capacity"); engine_live_at_end_ = false; if (!fixture.value("ok", false) || !(at_end ? live_.follow(fixture) : live_.open(fixture, ""))) { engine_notice_ = "Spieltag gespielt · Der Ticker kann diese Aufzeichnung nicht zeigen (" + diff --git a/src/modern/ui/live_screens.inc b/src/modern/ui/live_screens.inc index b0dc996..642dadf 100644 --- a/src/modern/ui/live_screens.inc +++ b/src/modern/ui/live_screens.inc @@ -126,8 +126,9 @@ std::string App::live_weather_icon(int code, double size) { else g = cloud("#aeb6ba") + ""; return picture(renderer_.diagram("mv-weather-" + std::to_string(std::clamp(code, 0, 7)), "" + g + "", 160), size, size); } -// The picture behind the match sheet: a ground of about the crowd's size in about this -// weather. Empty when the match is played in a hall or the pictures are not installed. +// The picture behind the match sheet: one of the pitch photographs. The home club keeps its +// picture; in rain or snow it is the wet pitch at dusk. Empty when the match is played in a +// hall or the pictures are not installed. std::string App::live_backdrop() const { if (scene_ != "live" || !live_.available()) return {}; try { @@ -137,35 +138,17 @@ std::string App::live_backdrop() const { const Json *match = &fixture.at("matches").front(); if (owner.is_object()) for (const auto &row : fixture.at("matches")) if (row.at("id") == owner.at("match_id")) match = &row; - const int64_t crowd = match->contains("attendance") && match->at("attendance").is_number_integer() ? match->at("attendance").get() : 20000; - const int size = crowd < 8000 ? 0 : crowd < 20000 ? 1 : crowd < 40000 ? 2 : 3; - int code = 2; + int code = 0; if (match->contains("weather") && match->at("weather").is_object() && match->at("weather").value("rain", Json()).is_number_integer()) code = match->at("weather").at("rain").get(); - // the eight weather pictures as five kinds of sky: sun, fair, cloud, rain, snow - static constexpr std::array kSky{0, 1, 2, 2, 3, 3, 4, 4}; - const int sky = kSky[size_t(std::clamp(code, 0, 7))]; - struct Ground { int size, sky; const char *key; }; - static constexpr std::array grounds{{ - {0, 0, "match.0-sun-a"}, {0, 2, "match.0-cloud-a"}, {0, 3, "match.0-rain-a"}, - {1, 0, "match.1-sun-a"}, {1, 0, "match.1-sun-b"}, {1, 0, "match.1-sun-c"}, {1, 1, "match.1-fair-a"}, {1, 1, "match.1-fair-b"}, - {1, 2, "match.1-cloud-a"}, {1, 2, "match.1-cloud-b"}, {1, 3, "match.1-rain-a"}, {1, 4, "match.1-snow-a"}, {1, 4, "match.1-snow-b"}, - {2, 0, "match.2-sun-a"}, {2, 0, "match.2-sun-b"}, {2, 0, "match.2-sun-c"}, {2, 1, "match.2-fair-a"}, - {3, 1, "match.3-fair-a"}, {3, 1, "match.3-fair-b"}, {3, 1, "match.3-fair-c"}, {3, 2, "match.3-cloud-a"}, - {3, 3, "match.3-rain-a"}, {3, 3, "match.3-rain-b"}, {3, 4, "match.3-snow-a"}}}; - // the nearest in size and sky; among equals the home club keeps its ground - int best = 99; - std::vector nearest; - for (const auto &ground : grounds) { - if (!gui_.contains(ground.key)) continue; - const int cost = std::abs(ground.size - size) + std::abs(ground.sky - sky); - if (cost < best) { best = cost; nearest.clear(); } - if (cost == best) nearest.push_back(ground.key); - } - if (nearest.empty()) return {}; + if (code >= 4 && gui_.contains("match.pitch-2")) return "match.pitch-2"; + std::vector fair; + for (const int number : {1, 3, 4, 5, 6, 7, 8, 9}) + if (const std::string key = "match.pitch-" + std::to_string(number); gui_.contains(key)) fair.push_back(key); + if (fair.empty()) return {}; size_t hash = 2166136261u; for (const unsigned char c : match->at("home").at("id").get()) hash = (hash ^ c) * 16777619u; - return nearest[hash % nearest.size()]; + return fair[hash % fair.size()]; } catch (const std::exception &) { return {}; } } // Played in a hall: the fixture says so, or the engine named the competition a hall tournament. @@ -606,8 +589,16 @@ std::string App::live_sheet(const std::string &over) { const Json *match = &fixture.at("matches").front(); for (const auto &row : fixture.at("matches")) if (row.at("id") == owner.at("match_id")) match = &row; std::string crowd = live_attendance_text(*match); + std::string filling, bar; + if (!indoor && match->contains("capacity") && match->at("capacity").is_number_integer() && match->at("capacity").get() > 0 && + match->contains("attendance") && match->at("attendance").is_number_integer()) { + const int64_t places = match->at("capacity").get(), seen = std::min(places, match->at("attendance").get()); + const int percent = int(std::lround(100.0 * seen / places)); + filling = "von " + number(places) + " Plätzen · " + std::to_string(percent) + " % ausgelastet · "; + bar = "
"; + } out += "
" + esc(pg_upper(indoor ? "Halle" : "Stadion")) + "" + esc(crowd) + - "" + esc("Heimspiel von " + match->at("home").at("name").get()) + "
"; + "" + bar + "" + esc(filling + "Heimspiel von " + match->at("home").at("name").get()) + "
"; const auto weather = match->value("weather", Json()); if (!indoor && weather.is_object()) { const Json rain = weather.value("rain", Json()), temperature = weather.value("temperature", Json()); diff --git a/src/modern/ui/view.cpp b/src/modern/ui/view.cpp index d7ef423..d8e6bc6 100644 --- a/src/modern/ui/view.cpp +++ b/src/modern/ui/view.cpp @@ -1279,7 +1279,7 @@ class App final : public Rml::EventListener { // behind the match sheet lies a stadium that suits the crowd and the weather const std::string ground = live_backdrop(); const auto background = - img(ground.empty() ? "background" : ground, size.x / scale_, size.y / scale_, false, true, ground.empty() ? 2048 : 2400); + img(ground.empty() ? "background" : ground, size.x / scale_, size.y / scale_, false, true, ground.empty() ? 2048 : 4096); element("background")->SetInnerRML(background); element("background") ->SetProperty("filter", !ground.empty() ? "brightness(0.78)" : scene_ == "main" ? "none"