diff --git a/assets/modern/pages.rcss b/assets/modern/pages.rcss
index 542cf6e..a63c3ee 100644
--- a/assets/modern/pages.rcss
+++ b/assets/modern/pages.rcss
@@ -507,3 +507,52 @@ body .pg-btn.pg-go[disabled] {opacity:1;background-color:var(--p-a3);border-colo
.st-td .pg-link {max-width:100%;}
.st-text {display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.pg-root .pg-dd .report-picker-popup {min-width:560dp;}
+
+/* --- stadium and surroundings: the model on its stage, the part's card, the figures, the offer --- */
+.sd-stage {position:relative;display:block;flex:1;min-height:0;overflow:hidden;clip:always;border:2dp var(--p-div);border-radius:45dp;background-color:#eef1e1;}
+body.midnight .sd-stage,body.matchday .sd-stage {background-color:var(--p-n2);}
+.sd-world {position:absolute;display:block;width:2799dp;height:1512dp;transform-origin:left top;pointer-events:none;}
+.sd-world img {position:absolute;left:0;top:0;}
+.sd-ground,.sd-ground:hover,.sd-ground:focus {position:absolute;left:0;top:0;width:100%;height:100%;display:block;padding:0;border:0dp;background-color:transparent;decorator:none;}
+.sd-hot,.sd-hot:hover,.sd-hot:focus {position:absolute;left:0;top:0;width:0dp;height:0dp;min-width:0dp;min-height:0dp;display:block;padding:0;margin:0;border:0dp;background-color:transparent;decorator:none;overflow:visible;pointer-events:none;}
+.sd-q {position:absolute;display:block;width:100dp;height:100dp;transform-origin:left top;background-color:transparent;pointer-events:none;}
+.sd-hot.hover .sd-q,.sd-hot:focus .sd-q {background-color:#ffffff66;}
+.sd-hot.sel .sd-q,.sd-hot.sel.hover .sd-q {background-color:#c8733c66;}
+.sd-letter {position:absolute;display:block;pointer-events:none;width:43dp;height:43dp;line-height:39dp;border:2.5dp #3a332b;border-radius:22dp;background-color:#f9f4ed;font-family:Display;font-size:27dp;text-align:center;color:#3a332b;}
+.sd-chips {position:absolute;left:32dp;bottom:27dp;display:flex;flex-wrap:wrap;gap:11dp;max-width:1935dp;}
+.pg-root .pg-btn.sd-chip {height:52dp;padding:0 22dp;gap:10dp;font-family:Modern;font-size:27dp;font-weight:bold;}
+.pg-root .pg-btn.sd-chip .pg-mut {font-weight:normal;}
+.sd-card {position:absolute;right:32dp;top:32dp;width:675dp;gap:22dp;}
+.sd-card .pg-kv {line-height:50dp;}
+.sd-tip {position:absolute;display:none;pointer-events:none;left:0;top:0;padding:9dp 22dp;border-radius:18dp;background-color:#2e2b25;font-size:27dp;line-height:36dp;color:#f9f4ed;white-space:nowrap;}
+.sd-tip strong {display:block;font-weight:bold;}
+.sd-tip span {display:block;}
+/* the figures */
+.sd-chart {display:block;flex:1;min-height:0;overflow:hidden;}
+.sd-mark {display:block;width:32dp;height:9dp;margin-right:14dp;border-radius:5dp;}
+.pg-root .pg-btn.sd-curve {height:60dp;padding:0 25dp;font-size:28dp;}
+.sd-prices {display:flex;gap:7dp;}
+.pg-root .pg-btn.sd-price {flex:1;min-width:0;height:62dp;padding:0;font-family:Modern;font-size:27dp;}
+.sd-table {width:900dp;flex:none;align-self:flex-start;padding:14dp 27dp;}
+.sd-row {display:flex;align-items:center;min-height:86dp;padding:11dp 0;border-top:2dp var(--p-row);font-size:27dp;line-height:34dp;}
+.sd-row.head {min-height:60dp;border-top-width:0dp;font-size:24dp;font-weight:bold;letter-spacing:1dp;color:var(--p-n7);}
+.sd-cell {display:block;flex:1;min-width:0;overflow:hidden;text-align:right;}
+.sd-cell span {display:block;}
+.sd-cell.first {flex:none;width:215dp;text-align:left;font-weight:bold;}
+.sd-row.head .sd-cell.first {font-weight:normal;}
+.sd-sub {font-size:21dp;line-height:27dp;}
+/* the building firm's offer */
+.pg-ov .pg-btn.sd-number {height:76dp;font-size:41dp;}
+.pg-ov .sd-range {display:block;width:100%;height:54dp;}
+.pg-ov .sd-range slidertrack {height:9dp;margin:22dp 0;border-radius:5dp;background-color:var(--p-n3);}
+.pg-ov .sd-range sliderbar {width:40dp;height:40dp;margin-top:7dp;border:4dp var(--p-bg);border-radius:20dp;background-color:var(--p-accent);}
+.sd-check {display:flex;align-items:center;gap:16dp;}
+.sd-check span {display:block;}
+.sd-check input {display:block;flex:none;width:40dp;height:40dp;border:2dp var(--p-n5);border-radius:11dp;background-color:var(--p-n1);}
+.sd-check input:checked {background-color:var(--p-accent);border-color:var(--p-accent);}
+.sd-check input:disabled {opacity:.55;}
+.pg-ov .pg-card.sd-option {flex:1;min-width:0;align-items:center;text-align:center;}
+.sd-option-art,.sd-preview {display:block;flex:none;overflow:hidden;border-radius:27dp;}
+.sd-option .pg-h,.sd-option .pg-mut {display:block;}
+.pg-ov .sd-feedback {max-width:none;white-space:normal;height:auto;min-height:60dp;line-height:40dp;padding:10dp 27dp;}
+.sd-card .pg-bar {flex:none;}
diff --git a/assets/modern/stadium.rcss b/assets/modern/stadium.rcss
index 30489c6..8a51e4b 100644
--- a/assets/modern/stadium.rcss
+++ b/assets/modern/stadium.rcss
@@ -1,232 +1 @@
-/* SPDX-License-Identifier: GPL-3.0-only */
-.stadium-screen {position:absolute;left:0;top:0;width:2612dp;height:1864dp;color:var(--text);}
-.stadium-empty {font-size:30dp;padding:40dp;color:var(--muted);}
-.stadium-heading {position:absolute;left:0;top:0;width:2612dp;height:106dp;display:flex;align-items:center;justify-content:space-between;color:#d4e2ed;}
-.stadium-heading-copy {height:83dp;}
-.stadium-heading h2 {font-size:36dp;font-weight:normal;line-height:41dp;height:41dp;margin:0 0 12dp;white-space:nowrap;}
-.stadium-heading p {font-size:28dp;color:#91adbf;line-height:30dp;height:30dp;margin:0;}
-.stadium-summary {display:flex;align-items:center;}
-.stadium-summary>div {display:flex;flex-direction:column;align-items:flex-end;margin-left:65dp;}
-.stadium-summary>div>span {display:block;font-size:28dp;color:#91adbf;height:28dp;line-height:28dp;}
-.stadium-summary strong {display:block;font-size:38dp;font-weight:normal;color:#b8dfd0;height:44dp;line-height:44dp;margin-top:10dp;white-space:nowrap;}
-.stadium-summary small {font-size:28dp;color:#b7cddc;}
-.stadium-bowl {position:absolute;left:100dp;top:134dp;width:1430dp;height:992.923588dp;border:2dp #c5d9e726;border-radius:18dp;overflow:hidden;}
-.stadium-letter {position:absolute;display:flex;align-items:center;justify-content:center;width:96dp;height:92dp;padding:0;border:2dp #e4b3a06b;border-radius:18dp;background-color:#14222ae6;color:#f0a99b;font-size:58dp;line-height:1;font-weight:bold;}
-.stadium-letter .control-label {width:100%;text-align:center;white-space:nowrap;}
-.stadium-letter:hover {background-color:#33434ae6;border-color:#f6c6ba;color:#ffdbcf;}
-.stadium-letter.building {border-color:#d8b77f;color:#e9cb9b;opacity:.85;}
-.stadium-block {position:absolute;display:block;padding:18dp 28dp;border:2dp #c5d9e726;border-radius:14dp;background-color:#12243140;color:#b8d0e0;font-size:28dp;text-align:left;}
-.stadium-block:hover {background-color:#c5d9e712;}
-.stadium-block:disabled {opacity:.85;border-color:#d8b77f52;background-color:#b6955d0d;}
-.stadium-block-copy {position:absolute;left:28dp;width:540dp;height:116dp;}
-.stadium-block-copy strong {position:absolute;left:0;top:0;display:block;width:540dp;height:36dp;line-height:36dp;font-size:31dp;font-weight:normal;color:#d7e5ef;white-space:nowrap;}
-.stadium-block-copy>span {position:absolute;left:0;top:46dp;display:block;width:540dp;height:32dp;line-height:32dp;white-space:nowrap;}
-.stadium-block-copy small {position:absolute;left:0;top:88dp;display:block;width:540dp;height:28dp;line-height:28dp;font-size:28dp;color:#8faabd;white-space:nowrap;}
-.stadium-block-icons {position:absolute;right:20dp;top:22dp;display:flex;width:162dp;height:76dp;}
-.stadium-block-icons .image-frame {margin-right:10dp;flex-shrink:0;}
-.stadium-block-icons .image-frame:last-child {margin-right:0;}
-.stadium-facility {position:absolute;display:block;padding:0;border:2dp #c5d9e726;border-radius:14dp;background-color:#12243140;color:#cbdde9;overflow:hidden;}
-.stadium-facility:hover {background-color:#c5d9e712;border-color:#c5d9e752;}
-.stadium-facility:disabled {opacity:.7;}
-.stadium-facility-picture {position:absolute;left:0;top:0;display:block;width:391dp;height:125dp;overflow:hidden;background-color:#10232e60;}
-.stadium-facility-art {position:absolute;display:block;}
-.stadium-art-overlay {position:absolute;display:block;pointer-events:none;}
-.stadium-facility>strong {position:absolute;left:0;top:133dp;display:block;width:391dp;height:31.2dp;line-height:31.2dp;font-size:28dp;font-weight:normal;text-align:center;white-space:nowrap;color:#d3e2ed;}
-.stadium-facility-caption {position:absolute;left:0;top:168.2dp;display:block;width:391dp;height:25.3dp;line-height:25.3dp;font-size:25dp;text-align:center;white-space:nowrap;color:#95b7c2;}
-.stadium-nav {position:absolute;left:0;top:1772dp;width:2612dp;height:92dp;display:flex;}
-.stadium-nav-button {width:856dp;height:92dp;padding:12dp 24dp;margin-right:22dp;font-size:29dp;border:2dp #c5d9e726;border-radius:12dp;background-color:#b6cad510;flex-shrink:0;}
-.stadium-nav-button:last-child {margin-right:0;}
-.stadium-nav-button.wide {width:2612dp;}
-.stadium-nav-button .control-label {width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
-.stadium-panorama {position:absolute;left:0;top:134dp;width:2612dp;height:1470.031100478dp;border:2dp #c5d9e726;border-radius:18dp;overflow:hidden;}
-.stadium-graph {position:absolute;left:0;top:134dp;width:2612dp;height:500dp;border:2dp #c5d9e726;border-radius:18dp;background-color:#12243140;}
-.stadium-graph-art {position:absolute;left:24dp;top:20dp;width:2560dp;height:456dp;pointer-events:none;}
-.stadium-curve,.stadium-scale {position:absolute;padding:10dp 20dp 10dp 38dp;height:74dp;border:2dp #c5d9e726;border-radius:12dp;background-color:#b6cad510;font-size:28dp;color:#cbdde9;}
-.stadium-curve {display:flex;align-items:center;justify-content:center;}
-.stadium-curve[aria-pressed=false] {opacity:.5;}
-.stadium-curve[aria-pressed=true],.stadium-scale[aria-pressed=true] {background-color:#b6cad51f;border-color:#c5d9e744;}
-.stadium-curve-color {position:absolute;left:12dp;top:16dp;width:6dp;height:34dp;border-radius:3dp;}
-.stadium-curve-label {display:block;width:100%;white-space:nowrap;text-align:center;}
-.stadium-scale {padding:12dp 24dp;font-size:28dp;}
-.stadium-scale .control-label {width:100%;white-space:nowrap;}
-.stadium-data-table {position:absolute;left:0;top:875dp;width:2612dp;height:432dp;}
-.stadium-data-row {display:flex;align-items:center;width:2612dp;height:72dp;font-size:29dp;color:#d0e0eb;}
-.stadium-data-row.head {font-size:28dp;color:#95afc2;border-bottom:2dp #c5d9e72b;}
-.stadium-data-row.striped {background-color:#e3edf605;}
-.stadium-data-cell {display:flex;align-items:center;justify-content:center;width:661.706667dp;height:72dp;padding:12dp 14dp;flex-shrink:0;min-width:0;}
-.stadium-data-cell.first {width:626.88dp;justify-content:flex-start;}
-.stadium-data-cell>span {display:block;width:100%;white-space:nowrap;text-align:center;overflow:hidden;text-overflow:ellipsis;}
-.stadium-data-cell.first>span {text-align:left;color:#a7c1d3;}
-.stadium-required {position:absolute;left:0;top:1335dp;width:2612dp;height:34dp;line-height:34dp;margin:0;display:flex;align-items:center;justify-content:center;font-size:29dp;color:#a1bccc;}
-.stadium-required>span {display:block;white-space:nowrap;}
-.stadium-required-value {color:#b8dfd0;margin-left:8dp;}
-.stadium-ticket {position:absolute;left:0;top:1415dp;width:2612dp;height:80dp;display:flex;align-items:center;font-size:28dp;color:#bed3e1;}
-.stadium-ticket>strong {display:block;width:87.14dp;flex-shrink:0;margin-right:20dp;font-size:28dp;font-weight:normal;}
-.stadium-ticket-price {width:88.6484615dp;height:66dp;padding:8dp 0;margin-right:8dp;border:2dp #c5d9e726;border-radius:10dp;background-color:#b6cad510;font-size:28dp;color:#bed3e1;flex-shrink:0;}
-.stadium-ticket-price:last-child {margin-right:0;}
-.stadium-ticket-price .control-label {width:100%;white-space:nowrap;}
-.stadium-ticket-price[aria-pressed=true] {background-color:#78b9a52b;border-color:#a9dccb73;color:#c8e8dc;}
-.stadium-modal {position:absolute;left:0;top:0;width:2612dp;height:1864dp;background-color:#08101980;z-index:20;}
-.stadium-draft {position:absolute;border:2dp #e1ecf429;border-radius:22dp;background-color:#283542f5;color:#d2e2ed;font-size:30dp;overflow:hidden;}
-.stadium-draft h2 {position:absolute;left:52dp;top:40dp;width:2052dp;height:45dp;line-height:45dp;font-size:40dp;font-weight:bold;text-align:center;margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#e3ecf3;}
-.stadium-draft-summary {position:absolute;left:52dp;top:113dp;width:2052dp;height:31dp;line-height:31dp;display:flex;align-items:center;justify-content:space-between;font-size:28dp;color:#9db7ca;}
-.stadium-draft-summary>span {display:block;white-space:nowrap;}
-.stadium-place-field {position:absolute;left:52dp;top:174dp;width:1233.230769dp;height:307dp;padding:26dp 30dp;border:2dp #c5d9e726;border-radius:14dp;background-color:#12243140;}
-.stadium-place-field>strong {position:absolute;left:30dp;top:26dp;font-size:34dp;font-weight:normal;height:39dp;line-height:39dp;}
-.stadium-place-field>p {position:absolute;left:30dp;top:83dp;font-size:28dp;height:30dp;line-height:30dp;color:#9db7ca;margin:0;}
-.stadium-place-label {position:absolute;left:30dp;top:140dp;display:flex;align-items:center;width:789.230769dp;height:80dp;line-height:80dp;font-size:28dp;white-space:nowrap;}
-.stadium-place-number {position:absolute;right:30dp;top:140dp;width:340dp;height:80dp;padding:12dp 20dp;border:2dp #c5d9e738;border-radius:12dp;background-color:#111f2a80;color:#e3ecf5;font-size:34dp;text-align:right;justify-content:flex-end;}
-.stadium-place-number .control-label {width:100%;white-space:nowrap;text-align:right;}
-#stadium-place-range {position:absolute;left:30dp;top:252dp;width:1169.230769dp;height:18dp;margin:0;padding:0;}
-#stadium-place-range slidertrack {height:4dp;margin:7dp 0;}
-#stadium-place-range sliderbar {width:18dp;height:18dp;margin:0;border:0;border-radius:9dp;}
-.stadium-features {position:absolute;left:1333.230769dp;top:196.5dp;width:770.769231dp;height:262dp;}
-.stadium-feature-row {display:flex;align-items:center;width:770.769231dp;height:116dp;margin-bottom:30dp;font-size:32dp;}
-.stadium-feature-row>input {width:38dp;height:38dp;flex-shrink:0;margin-right:24dp;}
-.stadium-feature-image {display:block;width:116dp;height:116dp;margin-right:24dp;flex-shrink:0;}
-.stadium-feature-row>span:last-child {display:block;white-space:nowrap;}
-.stadium-costs {position:absolute;left:52dp;top:511dp;width:2052dp;height:146.5dp;margin:0;}
-.stadium-cost-row {position:absolute;left:0;width:2052dp;height:43.5dp;}
-.stadium-cost-row dt,.stadium-cost-row dd {position:absolute;top:0;height:43.5dp;line-height:43.5dp;width:1022dp;font-size:29dp;margin:0;}
-.stadium-cost-row dt {left:0;color:#a9c1d2;}
-.stadium-cost-row dd {right:0;text-align:right;color:#d2e4ee;}
-.stadium-draft-total {position:absolute;left:52dp;width:2052dp;height:69dp;border-top:2dp #c5d9e726;padding-top:25dp;display:flex;align-items:center;justify-content:space-between;font-size:36dp;}
-.stadium-draft-total>span {display:block;white-space:nowrap;}
-#stadium-quote-total {color:#b8dfd0;}
-#stadium-draft-feedback {position:absolute;left:52dp;width:2052dp;height:48dp;font-size:28dp;line-height:1.4;color:#94afc3;margin:0;}
-.stadium-draft-actions {position:absolute;left:52dp;width:2052dp;height:84dp;display:flex;}
-.stadium-dialog-action {width:1014dp;height:84dp;padding:12dp 24dp;margin-right:24dp;border:2dp #c5d9e726;border-radius:12dp;font-size:30dp;background-color:#12243140;flex-shrink:0;}
-.stadium-dialog-action:last-child {margin-right:0;}
-.stadium-dialog-action .control-label {width:100%;white-space:nowrap;}
-.stadium-option {position:absolute;padding:22dp;display:block;border:2dp #c5d9e726;border-radius:16dp;background-color:#12243140;overflow:hidden;}
-.stadium-option[aria-pressed=true] {background-color:#78b9a51f;border-color:#a9dccb73;}
-.stadium-option-art {position:absolute;left:22dp;top:22dp;display:block;width:592dp;overflow:hidden;border-radius:10dp;}
-.stadium-option>strong {position:absolute;left:22dp;width:592dp;height:37dp;line-height:37dp;font-size:32dp;font-weight:normal;white-space:nowrap;text-align:center;}
-.stadium-option-price {position:absolute;left:22dp;width:592dp;height:34dp;line-height:34dp;font-size:30dp;white-space:nowrap;text-align:center;color:#b8dfd0;}
-body.silver .stadium-heading,body.matchday .stadium-heading,body.silver .stadium-block,body.matchday .stadium-block,body.silver .stadium-block-copy strong,body.matchday .stadium-block-copy strong,body.silver .stadium-facility>strong,body.matchday .stadium-facility>strong,body.silver .stadium-summary small,body.matchday .stadium-summary small,body.silver .stadium-data-row,body.matchday .stadium-data-row,body.silver .stadium-data-cell.first>span,body.matchday .stadium-data-cell.first>span {color:var(--text);}
-body.silver .stadium-heading p,body.matchday .stadium-heading p,body.silver .stadium-summary>div>span,body.matchday .stadium-summary>div>span,body.silver .stadium-block-copy small,body.matchday .stadium-block-copy small,body.silver .stadium-facility-caption,body.matchday .stadium-facility-caption,body.silver .stadium-required,body.matchday .stadium-required,body.silver .stadium-draft-summary,body.matchday .stadium-draft-summary,body.silver .stadium-place-field>p,body.matchday .stadium-place-field>p,body.silver #stadium-draft-feedback,body.matchday #stadium-draft-feedback {color:var(--muted);}
-body.silver .stadium-summary strong,body.matchday .stadium-summary strong,body.silver .stadium-required-value,body.matchday .stadium-required-value,body.silver .stadium-option-price,body.matchday .stadium-option-price,body.silver #stadium-quote-total,body.matchday #stadium-quote-total {color:var(--accent);}
-body.silver .stadium-bowl,body.matchday .stadium-bowl,body.silver .stadium-panorama,body.matchday .stadium-panorama,body.silver .stadium-graph,body.matchday .stadium-graph,body.silver .stadium-block,body.matchday .stadium-block,body.silver .stadium-facility,body.matchday .stadium-facility,body.silver .stadium-option,body.matchday .stadium-option,body.silver .stadium-place-field,body.matchday .stadium-place-field {border-color:var(--border);background-color:var(--panel);}
-body.silver .stadium-facility-picture,body.matchday .stadium-facility-picture {background-color:var(--panel);}
-body.silver .stadium-nav-button,body.matchday .stadium-nav-button,body.silver .stadium-curve,body.matchday .stadium-curve,body.silver .stadium-scale,body.matchday .stadium-scale,body.silver .stadium-ticket-price,body.matchday .stadium-ticket-price,body.silver .stadium-dialog-action,body.matchday .stadium-dialog-action {border-color:var(--border);background-color:var(--soft);color:var(--text);}
-body.silver .stadium-nav-button:hover,body.matchday .stadium-nav-button:hover,body.silver .stadium-curve:hover,body.matchday .stadium-curve:hover,body.silver .stadium-scale:hover,body.matchday .stadium-scale:hover {background-color:var(--hover);}
-body.silver .stadium-curve[aria-pressed=true],body.matchday .stadium-curve[aria-pressed=true],body.silver .stadium-scale[aria-pressed=true],body.matchday .stadium-scale[aria-pressed=true],body.silver .stadium-ticket-price[aria-pressed=true],body.matchday .stadium-ticket-price[aria-pressed=true],body.silver .stadium-option[aria-pressed=true],body.matchday .stadium-option[aria-pressed=true] {background-color:var(--selected);border-color:var(--accent);}
-body.silver .stadium-draft {background-color:#f7f3e9fc;border-color:var(--border);color:var(--text);}
-body.matchday .stadium-draft {background-color:#2c2c32fc;border-color:var(--border);color:var(--text);}
-body.silver .stadium-draft h2,body.matchday .stadium-draft h2,body.silver .stadium-place-number,body.matchday .stadium-place-number,body.silver .stadium-cost-row dt,body.matchday .stadium-cost-row dt,body.silver .stadium-cost-row dd,body.matchday .stadium-cost-row dd {color:var(--text);}
-body.silver .stadium-place-number,body.matchday .stadium-place-number {background-color:var(--input);border-color:var(--border);}
-body.silver .stadium-data-row.head,body.matchday .stadium-data-row.head {color:var(--muted);border-color:var(--border);}
-body.silver .stadium-data-row.striped {background-color:#6b552a0c;}
-body.matchday .stadium-data-row.striped {background-color:#f8e7e00a;}
-/* Ordinary Gold buttons retain their gradient; construction previews use separate palettes. */
-.stadium-nav-button,.stadium-scale,.stadium-dialog-action {background-color:transparent;decorator:linear-gradient(180deg,#c1d1e31c,#869eb312);color:#e0e6ec;}
-.stadium-nav-button:hover,.stadium-scale:hover,.stadium-dialog-action:hover {decorator:none;background-color:#d0e2f226;}
-.stadium-nav-button[aria-pressed=true],.stadium-scale[aria-pressed=true] {decorator:none;background-color:#9cafc240;border-color:#dce9f047;color:#f5f8fc;}
-.stadium-dialog-action.primary:not([disabled]) {decorator:none;background-color:#78b9a533;border-color:#a9dccb52;color:#d7efe5;}
-.stadium-block[disabled] {opacity:.85;border-color:#d8b77f52;background-color:#b6955d0d;}
-.stadium-facility[disabled] {opacity:.7;}
-body.silver .stadium-nav-button,body.silver .stadium-scale,body.silver .stadium-dialog-action {decorator:linear-gradient(180deg,#ffffffd8,#e9e1cf99);background-color:transparent;color:var(--text);border-color:var(--border);}
-body.matchday .stadium-nav-button,body.matchday .stadium-scale,body.matchday .stadium-dialog-action {decorator:linear-gradient(180deg,#e8d6dc12,#a1a0aa0d);background-color:transparent;color:var(--text);border-color:var(--border);}
-body.silver .stadium-nav-button:hover,body.silver .stadium-scale:hover,body.silver .stadium-dialog-action:hover,body.matchday .stadium-nav-button:hover,body.matchday .stadium-scale:hover,body.matchday .stadium-dialog-action:hover {decorator:none;background-color:var(--hover);}
-body.silver .stadium-nav-button[aria-pressed=true],body.silver .stadium-scale[aria-pressed=true] {decorator:none;background-color:#e3d3a878;border-color:#8a7a5570;color:#193b52;}
-body.matchday .stadium-nav-button[aria-pressed=true],body.matchday .stadium-scale[aria-pressed=true] {decorator:none;background-color:#d48c7b26;border-color:#e5a19770;color:#ffe5de;}
-body.silver .stadium-dialog-action.primary:not([disabled]) {decorator:none;background-color:#e3d3a878;border-color:#8a7a5570;color:#25617a;}
-body.matchday .stadium-dialog-action.primary:not([disabled]) {decorator:none;background-color:#d48c7b26;border-color:#e5a19770;color:#efb2aa;}
-body.silver .stadium-block[disabled],body.matchday .stadium-block[disabled] {opacity:.85;border-color:#d8b77f52;background-color:#b6955d0d;}
-
-.stadium-place-label>span {display:block;width:100%;white-space:nowrap;}
-
-.stadium-periphery-scene {position:absolute;left:0;top:67.375dp;width:2612dp;height:1469.25dp;overflow:hidden;}
-.stadium-scene-sprite,.stadium-periphery-preview {position:absolute;display:block;pointer-events:none;}
-.stadium-periphery-hit,.stadium-periphery-hit:hover,.stadium-periphery-hit:focus,.stadium-periphery-hit:active {position:absolute;display:block;box-sizing:border-box;padding:0;margin:0;border:0;border-radius:0;background-color:transparent;decorator:none;opacity:1;}
-.stadium-periphery-hit .control-label {display:none;}
-#stadium-interaction-hint {position:absolute;left:0;top:1568.625dp;width:2612dp;height:56dp;line-height:56dp;text-align:center;font-size:29dp;color:var(--muted);margin:0;}
-#stadium-interaction-hint>span {display:block;width:100%;white-space:nowrap;}
-.stadium-nav-button.half {width:1295dp;}
-
-.stadium-screen.periphery .stadium-nav {top:1704.625dp;}
-
-body.midnight .stadium-summary strong.money-amount,body.silver .stadium-summary strong.money-amount,body.matchday .stadium-summary strong.money-amount {color:var(--money);}
-body .stadium-summary strong.money-amount.is-negative {color:var(--danger);}
-
-/* the stadium as a plan drawn from its blocks */
-.stadium-bowl.stadium-plan,body.silver .stadium-bowl.stadium-plan,body.matchday .stadium-bowl.stadium-plan {border:2dp var(--paper-edge);border-radius:8dp;}
-.stadium-letter,body.silver .stadium-letter,body.matchday .stadium-letter {width:76dp;height:76dp;border:3dp #3d362a;border-radius:38dp;background-color:#fdfaf2;color:#3d362a;font-family:Display;font-size:44dp;font-weight:bold;decorator:none;}
-.stadium-letter:hover,body.silver .stadium-letter:hover {background-color:#ffffff;border-color:#25617a;color:#25617a;}
-.stadium-letter.building {border-color:#c9962e;color:#8a6414;opacity:1;}
-.stadium-plan-legend {position:absolute;left:24dp;bottom:16dp;height:40dp;display:flex;align-items:center;font-size:24dp;color:#3d362a;}
-body.midnight .stadium-plan-legend,body.matchday .stadium-plan-legend {color:#d5dde3;}
-.stadium-plan-legend span {display:block;flex-shrink:0;}
-.stadium-plan-legend .key {width:34dp;height:22dp;margin:0 10dp 0 26dp;border:2dp #3d362a;border-radius:3dp;}
-.stadium-plan-legend .key.seats {margin-left:0;}
-.stadium-plan-legend .key.terrace {background-color:#d8cfb9;}
-.stadium-plan-legend .key.roof {background-color:#4d5660;}
-.stadium-plan-legend .key.most {background-color:transparent;border:2dp #3d362a88;}
-.stadium-plan-legend .key.building {background-color:#c9962e40;border-color:#c9962e;}
-.stadium-plan-total {position:absolute;right:24dp;top:18dp;width:420dp;text-align:right;color:#3d362a;}
-body.midnight .stadium-plan-total,body.matchday .stadium-plan-total {color:#d5dde3;}
-.stadium-plan-total strong {display:block;font-family:Display;font-size:64dp;line-height:70dp;font-weight:bold;}
-.stadium-plan-total span {display:block;font-size:26dp;line-height:34dp;margin-bottom:8dp;}
-.stadium-block-bar {position:absolute;left:28dp;right:220dp;bottom:10dp;height:8dp;border-radius:4dp;background-color:var(--rule);overflow:hidden;display:block;}
-.stadium-block-bar span {display:block;height:8dp;border-radius:4dp;background-color:#9a7a3a;}
-.stadium-block-copy strong {font-family:Display;font-size:34dp;font-weight:bold;}
-.stadium-plan-total {right:auto;left:24dp;top:16dp;text-align:left;width:380dp;}
-
-/* the card model */
-.stadium-model {position:absolute;left:0;top:134dp;width:1790dp;height:1600dp;border:2dp var(--paper-edge);border-radius:8dp;overflow:hidden;}
-#stadium-model-art {position:absolute;left:0;top:0;width:1790dp;height:1600dp;}
-.stadium-model-back,.stadium-model-back:hover {position:absolute;padding:0;border:0dp;border-radius:0dp;background-color:transparent;decorator:none;}
-.stadium-model-hit {position:absolute;padding:0;border:3dp transparent;border-radius:12dp;background-color:transparent;decorator:none;}
-.stadium-model-hit:hover,.stadium-model-hit:focus-visible {border-color:#25617a;background-color:#25617a1c;}
-.stadium-model-hit.chosen {border-color:transparent;background-color:transparent;}
-.stadium-model-hit.bowl {display:flex;align-items:flex-start;justify-content:center;font-family:Display;font-size:44dp;color:#25617a;border:3dp #25617a55;}
-.stadium-model-tag {position:absolute;width:0;height:0;pointer-events:none;}
-.stadium-model-tag>span {display:block;position:absolute;left:-150dp;top:-22dp;width:300dp;height:44dp;line-height:44dp;text-align:center;font-size:26dp;color:#3d362a;white-space:nowrap;}
-.stadium-model-tag.letter>span {left:-30dp;top:-30dp;width:60dp;height:60dp;line-height:54dp;border:3dp #3d362a;border-radius:30dp;background-color:#fdfaf2;font-family:Display;font-size:38dp;font-weight:bold;}
-.stadium-model-path {position:absolute;left:20dp;top:18dp;height:64dp;display:flex;gap:12dp;}
-.stadium-model-crumb {height:60dp;padding:0 28dp;border:2dp var(--rule);border-radius:30dp;background-color:#fdfaf2e0;decorator:none;font-size:30dp;color:#3d362a;display:flex;align-items:center;}
-.stadium-model-crumb.here {background-color:#9a7a3a;border-color:#9a7a3a;color:#ffffff;}
-.stadium-model-crumb span {display:block;}
-.stadium-card {position:absolute;left:1822dp;top:134dp;width:790dp;height:1600dp;border:2dp var(--rule);border-radius:10dp;background-color:var(--panel);padding:36dp;}
-.stadium-card h3 {display:block;margin:0 0 20dp 0;font-family:Display;font-size:60dp;line-height:72dp;font-weight:bold;}
-.stadium-card .bank-fact {height:84dp;font-size:36dp;}
-.stadium-card .bank-fact strong {font-size:42dp;}
-.stadium-card .bank-part-track {margin:6dp 0 14dp 0;}
-.stadium-card-pips {display:flex;gap:12dp;margin:16dp 0;}
-.stadium-card-pips .pip {width:44dp;height:44dp;border:3dp var(--rule);border-radius:8dp;}
-.stadium-card-pips .pip.on {background-color:#9a7a3a;border-color:#9a7a3a;}
-.stadium-card-note {margin:30dp 0;font-size:32dp;line-height:44dp;color:var(--muted);}
-.stadium-card-build {display:flex;align-items:center;justify-content:center;width:100%;height:110dp;font-size:42dp;margin-bottom:20dp;}
-.stadium-card-back {display:flex;align-items:center;justify-content:center;width:100%;height:84dp;font-size:34dp;}
-.stadium-model-tag>span {left:-160dp;top:-20dp;width:320dp;height:40dp;line-height:40dp;}
-.stadium-model-hit,.stadium-model-hit:focus-visible {border-radius:40dp;}
-.stadium-model-hit:focus-visible {border-color:transparent;background-color:transparent;}
-.stadium-model-tag.letter>span {left:-30dp;top:-30dp;width:60dp;height:60dp;line-height:54dp;}
-.stadium-model-tag>span {font-size:28dp;font-weight:bold;}
-
-/* names on the model stand on a framed field; the list of the surroundings */
-.stadium-model-tag>span {left:-170dp;top:-22dp;width:340dp;height:44dp;line-height:44dp;font-size:30dp;font-weight:bold;color:#3d362a;font-effect:outline(3dp #fffbf2);}
-.stadium-model-tag.chosen>span {color:#25617a;}
-.stadium-model-tag.letter>span {font-effect:none;}
-.stadium-list {padding:28dp 32dp;}
-.stadium-list h3 {margin-bottom:10dp;}
-.stadium-row {display:flex;align-items:center;width:100%;height:98dp;padding:0 16dp;border:0dp;border-bottom:2dp var(--rule);border-radius:0dp;background-color:transparent;decorator:none;font-size:36dp;text-align:left;}
-.stadium-row:hover {background-color:var(--hover);}
-.stadium-row span {display:block;flex-shrink:0;}
-.stadium-row .name {flex:1;}
-.stadium-row .job {margin-right:20dp;font-size:28dp;color:#8a6414;}
-.stadium-row-pips {display:flex;gap:8dp;}
-.stadium-row-pips .pip {width:30dp;height:30dp;border:3dp var(--rule);border-radius:6dp;}
-.stadium-row-pips .pip.on {background-color:#9a7a3a;border-color:#9a7a3a;}
-.stadium-row .stadium-row-pips {display:flex;}
-
-/* --- The model fills the window; the pointer names a part, the card lies over the picture. --- */
-.stadium-model,#stadium-model-art {width:2612dp;}
-.stadium-model-hit {overflow:visible;}
-.stadium-model-hit:hover {z-index:6;}
-.stadium-tip {display:none;position:absolute;width:620dp;height:128dp;padding:14dp 24dp;border:3dp #3d362a;border-radius:10dp;background-color:#fffbf2;color:#3d362a;text-align:left;pointer-events:none;}
-.stadium-model-hit:hover .stadium-tip {display:block;}
-.stadium-tip strong {display:block;font-family:Display;font-size:38dp;line-height:46dp;white-space:nowrap;}
-.stadium-tip span {display:block;font-size:30dp;line-height:40dp;white-space:nowrap;}
-.stadium-card {top:166dp;width:800dp;height:auto;z-index:8;}
-body.silver .stadium-card {background-color:#fffbf2f6;border-color:#3d362a;}
+/* The stadium is a page of the notebook now: its styles are the sd-* rules in pages.rcss. */
diff --git a/src/modern/ui/controls.inc b/src/modern/ui/controls.inc
index 781341f..d907f70 100644
--- a/src/modern/ui/controls.inc
+++ b/src/modern/ui/controls.inc
@@ -123,6 +123,11 @@ void App::drag_event(Rml::Event &event) {
}
void App::ProcessEvent(Rml::Event &event) try {
const auto type = event.GetType();
+ // the wheel is only listened to for the stadium's model
+ if (type == "mousescroll") {
+ if (menu_ == "stadium" && popup_.empty() && !amount_ && stadium_view_.value("dialog", std::string()).empty()) stadium_stage_event(event);
+ return;
+ }
if (notebook_home_event(event)) return;
if (tactics_page_event(event)) return;
if (engine_mode_) { engine_event(event); return; }
@@ -691,7 +696,10 @@ void App::dispatch(const std::string &action, Rml::Element *target) {
return;
}
if (action.starts_with("open:")) {
- const auto route = action.substr(5);
+ auto route = action.substr(5);
+ // the surroundings are the second page of the stadium
+ const bool surroundings = route == "periphery";
+ if (surroundings) route = "stadium";
if(source_&&!demo_career_menu_available(snap().state,route)){message(snap().state.at("career").value("ended",false)?"Diese Partie ist beendet. Bitte ein neues Spiel beginnen oder einen Spielstand laden.":"Dieses Vereinsmenü ist für die Nationalmannschaft nicht verfügbar.");return;}
if (route == "kickoff")
return;
@@ -707,6 +715,7 @@ void App::dispatch(const std::string &action, Rml::Element *target) {
return;
}
if (route == "bank") { bank_view_ = "entrance"; bank_hint_.clear(); }
+ if (route == "stadium") { if (!stadium_view_.is_object()) stadium_view_ = Json::object(); stadium_view_["view"] = surroundings ? "panorama" : "inside"; stadium_focus_.clear(); }
menu_ = route;
report_picker_.clear();
report_detail_kind_.clear();
diff --git a/src/modern/ui/engine_controls.inc b/src/modern/ui/engine_controls.inc
index 31e164e..1c343bf 100644
--- a/src/modern/ui/engine_controls.inc
+++ b/src/modern/ui/engine_controls.inc
@@ -481,7 +481,7 @@ void App::engine_event(Rml::Event &event) {
else if(action=="engine-open"&&id=="news"){menu_=id;news_dialog_.clear();refresh();}
else if(action=="engine-open"&&id=="achievements"){menu_=id;career_view_=Json::object();refresh();}
else if(action=="engine-open"&&id=="transfer"){menu_=id;transfer_view_=Json::object();transfer_dialog_.clear();engine_transfer_sync();refresh();}
- else if(action=="engine-open"&&id=="stadium"){menu_=id;stadium_view_=Json::object();stadium_view_defaults(stadium_view_);engine_stadium_sync();refresh();}
+ else if(action=="engine-open"&&(id=="stadium"||id=="periphery")){menu_="stadium";stadium_view_=Json::object();stadium_view_defaults(stadium_view_);if(id=="periphery")stadium_view_["view"]="panorama";stadium_focus_.clear();engine_stadium_sync();refresh();}
else if(action=="engine-open"&&id=="toto"){menu_=id;engine_toto_sync();refresh();}
else if(action=="engine-open"&&(id=="statistics"||id.starts_with("stat-"))){statistics_open(id);}
else if(action=="engine-open"&&id=="load"){engine_files_begin("load");}
diff --git a/src/modern/ui/engine_stadium.inc b/src/modern/ui/engine_stadium.inc
index b4f989a..15118c6 100644
--- a/src/modern/ui/engine_stadium.inc
+++ b/src/modern/ui/engine_stadium.inc
@@ -127,96 +127,6 @@ void App::engine_stadium_send(const Json &request, const std::string &operation)
return EngineReply{link, link->snapshot(), response, nullptr};
});
}
-std::string App::engine_stadium_data() {
- const auto &data = engine_data_.at("stadium").at("data");
- std::string svg = "";
- std::string out = "
" +
- picture(renderer_.diagram("stadium-engine-graph", svg, 5120), 2560, 456) +
- "
";
- for (size_t i = 0; i < 6; ++i)
- out += btn("stadium-curve",
- "" +
- esc(data.at("history")[i].value("name", std::string(names[i]))) + "",
- "stadium-curve",
- "id=\"stadium-curve-" + std::to_string(i) + "\" data-id=\"" + std::to_string(i) +
- "\" aria-pressed=\"" +
- (stadium_view_.at("curves")[i] == true ? "true" : "false") + "\" style=\"" +
- rect((i % 3) * 754.666666667, 660 + (i / 3) * 90, 732.666666667, 74) + "\"");
- for (int i = 0; i < 2; ++i)
- out += btn("stadium-scale", i ? "Relativ" : "Absolut", "stadium-scale",
- "id=\"stadium-scale-" + std::to_string(i) + "\" data-id=\"" + std::to_string(i) +
- "\" aria-pressed=\"" +
- (stadium_view_.at("relative") == bool(i) ? "true" : "false") + "\" style=\"" +
- rect(2282, 660 + i * 90, 330, 74) + "\"");
- const std::array labels{"", "Max. Zuschauer", "Max. Einnahmen (€)",
- "Heimspiele", "Ø Zuschauer", "Ges. Einnahmen (€)"};
- out += "";
- for (size_t row = 0; row < 6; ++row) {
- out += "
";
- for (size_t col = 0; col < 4; ++col) {
- std::string value;
- if (!col)
- value = labels[row];
- else if (!row)
- value = col == 1 ? "Liga" : col == 2 ? "DFB-Pokal" : "Europapokal";
- else {
- const size_t source = row == 1 ? 0 : row == 2 ? 2 : row + 1;
- value = data.at("table")[source][col - 1];
- if (row <= 2) {
- const auto other = data.at("table")[source + 1][col - 1].get
();
- if (!other.empty())
- value += " · " + other;
- }
- }
- out += "" +
- esc(value) + "
";
- }
- out += "";
- }
- out += "
";
- const int ticket = int(engine_money_minor(data.at("ticketPrice")) / 100);
- out += "Benötigter Zuschauerschnitt bei " +
- std::to_string(ticket) + " € Eintritt: " +
- esc(data.at("requiredAttendanceText").get()) +
- "
Eintritt:";
- const int low = int(engine_money_minor(data.at("ticketPriceRange").at("min")) / 100),
- high = int(engine_money_minor(data.at("ticketPriceRange").at("max")) / 100);
- for (int price = low; price <= high; ++price)
- out += btn(
- "stadium-ticket", (price < 10 ? "0" : "") + std::to_string(price), "stadium-ticket-price",
- "id=\"stadium-ticket-" + std::to_string(price) + "\" data-id=\"" + std::to_string(price) +
- "\" aria-pressed=\"" + (ticket == price ? "true" : "false") + "\"");
- return out + "
";
-}
bool App::engine_stadium_action(const std::string &action, Rml::Element *target) {
if (!action.starts_with("stadium-"))
return false;
@@ -387,25 +297,7 @@ bool App::engine_stadium_event(Rml::Event &event) {
event.StopImmediatePropagation();
return true;
}
- if (!dialog && stadium_view_.at("view") == "panorama" &&
- (type == "mousemove" || type == "focus" || type == "blur")) {
- std::string hint;
- for (auto *n = target; n && n != doc_; n = n->GetParentNode())
- if (n->HasAttribute("data-stadium-hint")) {
- hint = n->GetAttribute("data-stadium-hint", "");
- break;
- }
- if (type == "blur")
- hint.clear();
- if (stadium_view_.at("hint") != hint) {
- stadium_view_["hint"] = hint;
- if (auto *n = element("stadium-interaction-hint"))
- n->SetInnerRML("" +
- esc(hint.empty() ? "Ein Element im Stadionumfeld auswählen." : hint) +
- "");
- dirty_ = true;
- }
- }
+ if (!dialog && stadium_stage_event(event)) return true;
Rml::Element *range = nullptr;
for (auto *n = target; n && n != doc_; n = n->GetParentNode())
if (n->GetId() == "stadium-place-range") {
diff --git a/src/modern/ui/engine_state.inc b/src/modern/ui/engine_state.inc
index d5d300c..3f2e8de 100644
--- a/src/modern/ui/engine_state.inc
+++ b/src/modern/ui/engine_state.inc
@@ -120,7 +120,6 @@
Json stadium_quote_value() const;
std::string stadium_cash(const Json &) const;
std::string stadium_offer_feedback(const Json &,bool) const;
- std::string engine_stadium_data();
void engine_stadium_sync();
void engine_stadium_poll();
void engine_stadium_send(const Json &,const std::string &);
diff --git a/src/modern/ui/notebook.inc b/src/modern/ui/notebook.inc
index f767d1a..7dbfb03 100644
--- a/src/modern/ui/notebook.inc
+++ b/src/modern/ui/notebook.inc
@@ -14,7 +14,7 @@ const std::vector ¬ebook_sections() {
{"home", "Hauptseite", {}},
{"team", "Mannschaft", {"lineup", "tactics", "training", "camp", "strengths", "scorers"}},
{"transfers", "Transfers", {"transfer", "contracts"}},
- {"club", "Verein", {"stadium", "environment", "advertising"}},
+ {"club", "Verein", {"stadium", "periphery", "environment", "advertising"}},
{"finance", "Finanzen", {"balance", "bank", "toto"}},
{"fixtures", "Spielplan", {"calendar", "league", "tables", "other", "friendlies", "postpone", "indoor"}},
{"records", "Statistik", {"statistics", "stat-trend", "stat-winners", "stat-records", "stat-players", "achievements", "almanac", "fairplay", "highscore"}},
@@ -25,7 +25,7 @@ const std::vector ¬ebook_sections() {
std::string notebook_page_label(const std::string &route) {
static const std::map labels = {
{"lineup", "Aufstellung"}, {"tactics", "Taktik"}, {"training", "Training"}, {"camp", "Trainingslager"}, {"strengths", "Stärken"},
- {"scorers", "Spielerstatistik"}, {"transfer", "Transfermarkt"}, {"contracts", "Verträge"}, {"stadium", "Stadion"}, {"environment", "Umfeld"},
+ {"scorers", "Spielerstatistik"}, {"transfer", "Transfermarkt"}, {"contracts", "Verträge"}, {"stadium", "Stadion"}, {"periphery", "Peripherie"}, {"environment", "Umfeld"},
{"advertising", "Werbung"}, {"balance", "Bilanz"}, {"bank", "Bank"}, {"toto", "Toto"}, {"calendar", "Kalender"}, {"league", "Ligaspiele"},
{"tables", "Tabellen"}, {"other", "Übrige Spiele"}, {"friendlies", "Testspiele"}, {"postpone", "Verlegen"}, {"indoor", "Halle"},
{"statistics", "Analyse"}, {"stat-trend", "Verlauf"}, {"stat-winners", "Sieger"}, {"stat-records", "Rekorde"}, {"stat-players", "Spieler"}, {"achievements", "Erfolge"}, {"almanac", "Almanach"}, {"fairplay", "Fairplay"}, {"highscore", "Highscore"},
@@ -201,7 +201,10 @@ std::string App::notebook_shell(const std::function &
// the statistics are one menu with several pages; the demo has only its first
const bool part = std::string_view(r).starts_with("stat-") || std::string_view(r) == "statistics";
if (!engine_mode_ && std::string_view(r).starts_with("stat-")) continue;
- const bool here = part && engine_mode_ ? menu_ == "statistics" && statistics_page_ == r : menu_ == r;
+ // the ground is one menu with two pages: the stadium and what stands around it
+ const bool ground = std::string_view(r) == "stadium" || std::string_view(r) == "periphery";
+ const bool here = ground ? menu_ == "stadium" && (stadium_view_.value("view", std::string("inside")) == "panorama") == (std::string_view(r) == "periphery")
+ : part && engine_mode_ ? menu_ == "statistics" && statistics_page_ == r : menu_ == r;
if (here) {
kicker = std::string(section.label) + " · " + std::to_string(n + 1) + " / " + std::to_string(section.routes.size());
heading = notebook_page_label(r);
@@ -210,7 +213,7 @@ std::string App::notebook_shell(const std::function &
std::string("nb-sub") + (here ? " active" : ""),
"id=\"page-" + std::string(r) + "\" aria-pressed=\"" + (here ? "true" : "false") + "\" style=\"transform:translateY(" + (here ? std::string("-13") : std::to_string(sub_rest[n % sub_rest.size()])) + "dp) rotate(" +
scalar(sub_turns[n % sub_turns.size()]) + "deg);\"",
- enabled(part ? "statistics" : r));
+ enabled(part ? "statistics" : ground ? "stadium" : r));
++n;
}
}
diff --git a/src/modern/ui/pages.inc b/src/modern/ui/pages.inc
index 092fd86..44563e0 100644
--- a/src/modern/ui/pages.inc
+++ b/src/modern/ui/pages.inc
@@ -5,7 +5,7 @@
// The menus that are laid out as a page of the notebook. Every other career menu is still a
// sheet of the old format, shown scaled inside the book.
bool App::page_native() const {
- static const std::set native{"statistics", "news", "transfer", "training", "almanac", "tactics", "achievements", "highscore", "balance", "contracts", "environment", "tables", "league", "other", "strengths", "fairplay", "indoor", "scorers"};
+ static const std::set native{"stadium", "statistics", "news", "transfer", "training", "almanac", "tactics", "achievements", "highscore", "balance", "contracts", "environment", "tables", "league", "other", "strengths", "fairplay", "indoor", "scorers"};
if (menu_ == "calendar" || menu_ == "postpone" || menu_ == "lineup") return notebook_page() && engine_mode_;
// a national coach arranges friendlies on the older sheet
if (menu_ == "friendlies") return notebook_page() && engine_mode_ && engine_data_.contains("desktop") && engine_data_.at("desktop").at("meta").at("scope").at("role") == "club";
diff --git a/src/modern/ui/stadium_controls.inc b/src/modern/ui/stadium_controls.inc
index 5497ac5..165e349 100644
--- a/src/modern/ui/stadium_controls.inc
+++ b/src/modern/ui/stadium_controls.inc
@@ -25,36 +25,111 @@ void App::sync_stadium_draft() {
if(stadium_view_.at("dialog")=="block")if(auto *button=element("stadium-place-number"))button->SetInnerRML(""+std::to_string(stadium_view_.at("draft").at("places").get())+"");
dirty_=true;
}
-// The camera of the card model: a new focus starts a flight of 0.6 seconds, during which
-// only the picture is drawn anew; reduced motion jumps.
+// Choosing a part of the model, and laying the view back to where it started.
bool App::stadium_focus_action(const std::string &action,Rml::Element *target) {
- if(action!="stadium-focus"||!target)return false;
- // the camera stands still: a click only chooses the part (the screen drops a part that
- // does not belong to its view)
- const auto next=std::string(target->GetAttribute("data-id",""));
+ if(action=="stadium-reset") {
+ stadium_view_defaults(stadium_view_);
+ stadium_cams_.erase(stadium_view_.at("view")=="panorama"?"panorama":"inside");
+ focus_after_render_="stadium-reset";refresh();return true;
+ }
+ if((action!="stadium-focus"&&action!="stadium-pick")||!target)return false;
+ // the click that ends a drag of the view chooses nothing
+ if(stadium_dragged_){stadium_dragged_=false;return true;}
+ // a click on the stage chooses what lies under the pointer, or lets go of the chosen part
+ const auto next=action=="stadium-pick"?stadium_hover_:std::string(target->GetAttribute("data-id",""));
if(next==stadium_focus_)return true;
- stadium_flying_=false;
stadium_focus_=next;
focus_after_render_=next.find(':')!=std::string::npos?"stadium-card-build":"";
refresh();
return true;
}
-void App::stadium_camera_tick() {
- if(!stadium_flying_)return;
- if(menu_!="stadium"||!world_){stadium_flying_=false;return;}
- const double t=std::min(1.0,double(SDL_GetTicks64()-stadium_flight_start_)/600.0);
- stadium_camera_=stadium3d::mix(stadium_camera_from_,stadium_camera_to_,t);
- if(t>=1){stadium_flying_=false;refresh();return;}
- stadium_view_defaults(stadium_view_);
- const auto overview=stadium_overview(stadium_view_.at("future").get());
- auto *art=element("stadium-model-art");
- if(!overview.value("ok",false)||!art){stadium_flying_=false;refresh();return;}
- std::string seat_colour;
- if(const auto *own=world_->find("clubs",overview.value("club",std::string()));own&&!own->value("crest","").empty())seat_colour=renderer_.crest_colour(own->value("crest",""));
- if(seat_colour.empty())seat_colour="#3d6f8f";
- const auto drawing=stadium3d::draw(stadium3d::build(overview,seat_colour,theme_=="silver"),stadium_camera_,1790,1600);
- art->SetInnerRML(picture(renderer_.diagram("stadium-model",drawing.svg,1790),1790,1600));
+// Looking around on the stage: the wheel zooms towards the pointer, dragging moves the view,
+// and the pointer over a part shows what stands there. Only the place of the picture changes;
+// nothing is drawn anew.
+bool App::stadium_stage_event(Rml::Event &event) {
+ auto *stage=element("stadium-stage");auto *world=element("stadium-world");
+ if(!stage||!world)return false;
+ const auto type=event.GetType();
+ if(type!="mousemove"&&type!="mousedown"&&type!="mouseup"&&type!="mousescroll")return false;
+ const bool outer=stadium_view_.value("view",std::string())=="panorama";
+ // the pointer on the stage, in units of the page
+ const double mx=(event.GetParameter("mouse_x",0)-stage->GetAbsoluteLeft())/scale_/2.25,my=(event.GetParameter("mouse_y",0)-stage->GetAbsoluteTop())/scale_/2.25;
+ const bool on_world=event.GetTargetElement()&&event.GetTargetElement()->GetId()=="stadium-model-ground";
+ // the part under the pointer: the one in front wins
+ const auto under=[&](const std::array &cam)->std::string {
+ if(!on_world)return {};
+ const double x=(mx-cam[1])/cam[0],y=(my-cam[2])/cam[0];std::string found;
+ for(const auto &part:stadium_hots_)
+ for(const auto &quad:part.quads) {
+ const auto a=stadium_scene::project(quad.a),b=stadium_scene::project(quad.b),d=stadium_scene::project(quad.d);
+ const double ux=b.x-a.x,uy=b.y-a.y,vx=d.x-a.x,vy=d.y-a.y,det=ux*vy-uy*vx;
+ if(std::abs(det)<1e-6)continue;
+ const double s=((x-a.x)*vy-(y-a.y)*vx)/det,t=(ux*(y-a.y)-uy*(x-a.x))/det;
+ if(s>=0&&s<=1&&t>=0&&t<=1){found=part.id;break;}
+ }
+ return found;
+ };
+ const auto part_element=[&](const std::string &id){return id.empty()?nullptr:element("stadium-part-"+id.substr(0,id.find(':'))+"-"+id.substr(id.find(':')+1));};
+ const auto hover=[&](const std::string &id) {
+ if(id==stadium_hover_)return;
+ if(auto *old=part_element(stadium_hover_))old->SetClass("hover",false);
+ if(auto *now=part_element(id))now->SetClass("hover",true);
+ stadium_hover_=id;dirty_=true;
+ };
+ const auto place=[&](std::array cam) {
+ constexpr double w=stadium_scene::width,h=stadium_scene::height;
+ cam[0]=std::clamp(cam[0],.75,3.2);
+ cam[1]=std::clamp(cam[1],std::min(240.0,w-w*cam[0]-240),std::max(240.0,w-w*cam[0]-240));
+ cam[2]=std::clamp(cam[2],std::min(240.0,h-h*cam[0]-240),std::max(240.0,h-h*cam[0]-240));
+ stadium_cams_[outer?"panorama":"inside"]=cam;
+ world->SetProperty("left",pg(cam[1]));world->SetProperty("top",pg(cam[2]));world->SetProperty("transform","scale("+scalar(cam[0])+")");
+ dirty_=true;
+ };
+ auto *tip=element("stadium-tip");
+ if(type=="mousescroll") {
+ if(!on_world)return false;
+ auto cam=stadium_cam(outer);
+ const double zoom=std::clamp(cam[0]*std::exp(-event.GetParameter("wheel_delta_y",0)*.16),.75,3.2);
+ cam[1]=mx-(mx-cam[1])*zoom/cam[0];cam[2]=my-(my-cam[2])*zoom/cam[0];cam[0]=zoom;
+ place(cam);
+ if(tip)tip->SetProperty("display","none");
+ event.StopImmediatePropagation();return true;
+ }
+ if(type=="mousedown") {
+ stadium_dragged_=false;hover(under(stadium_cam(outer)));
+ if(on_world&&event.GetParameter("button",0)==0)stadium_drag_={{"x",mx},{"y",my},{"moved",false}};
+ return false;
+ }
+ if(type=="mouseup") {
+ if(stadium_drag_.is_object()&&stadium_drag_.at("moved")==true)stadium_dragged_=true;
+ stadium_drag_=Json();
+ return false;
+ }
+ if(stadium_drag_.is_object()) {
+ const double dx=mx-stadium_drag_.at("x").get(),dy=my-stadium_drag_.at("y").get();
+ if(stadium_drag_.at("moved")!=true&&std::hypot(dx,dy)<5)return false;
+ auto cam=stadium_cam(outer);cam[1]+=dx;cam[2]+=dy;
+ stadium_drag_={{"x",mx},{"y",my},{"moved",true}};
+ place(cam);hover({});
+ if(tip)tip->SetProperty("display","none");
+ return true;
+ }
+ // what the pointer is on
+ hover(under(stadium_cam(outer)));
+ if(!tip)return false;
+ std::string name,state;
+ if(auto *n=part_element(stadium_hover_)){name=n->GetAttribute("data-tip-name","");state=n->GetAttribute("data-tip-state","");}
+ const auto shown=name+"|"+state;
+ if(name.empty()) {
+ if(!stadium_tip_.empty()){stadium_tip_.clear();tip->SetProperty("display","none");dirty_=true;}
+ return false;
+ }
+ if(stadium_tip_!=shown){stadium_tip_=shown;tip->SetInnerRML(""+esc(name)+""+esc(state)+"");}
+ tip->SetProperty("display","block");
+ stadium_tip_at_={std::min(mx+16,stadium_scene::width-330),std::max(4.0,my-34)};
+ tip->SetProperty("left",pg(stadium_tip_at_[0]));tip->SetProperty("top",pg(stadium_tip_at_[1]));
dirty_=true;
+ return false;
}
bool App::stadium_action(const std::string &action,Rml::Element *target) {
if(engine_mode_)return engine_stadium_action(action,target);
@@ -154,13 +229,7 @@ bool App::stadium_event(Rml::Event &event) {
else return false;
event.StopImmediatePropagation();return true;
}
- if(!dialog&&stadium_view_.at("view")=="panorama"&&(type=="mousemove"||type=="focus"||type=="blur")) {
- const auto hint=[&](Rml::Element *from) {for(auto *n=from;n&&n!=doc_;n=n->GetParentNode())if(n->HasAttribute("data-stadium-hint"))return n->GetAttribute("data-stadium-hint","");return Rml::String();};
- auto text=hint(target);
- if(type=="focus"&&text.empty()&&target&&target->GetId()!="stadium-back"&&target->GetId()!="stadium-future"&&target->GetId()!="window-close")return false;
- if(type=="blur")text="";
- if(stadium_view_.at("hint")!=text) {stadium_view_["hint"]=text;if(auto *n=element("stadium-interaction-hint"))n->SetInnerRML(""+esc(text.empty()?"Ein Element im Stadionumfeld auswählen.":text)+"");dirty_=true;}
- }
+ if(!dialog&&stadium_stage_event(event))return true;
Rml::Element *place_range=nullptr;
for(auto *node=target;node&&node!=doc_;node=node->GetParentNode())if(node->GetId()=="stadium-place-range"){place_range=node;break;}
if(dialog&&type=="keydown"&&place_range&&stadium_view_.at("dialog")=="block"&&(key==Rml::Input::KI_HOME||key==Rml::Input::KI_END)) {
@@ -192,7 +261,6 @@ bool App::stadium_event(Rml::Event &event) {
if(target->HasAttribute("data-stadium-feature")) {
const auto field=target->GetAttribute("data-stadium-feature","");if(field!="seats"&&field!="roof")return true;
stadium_view_["draft"][field]=target->HasAttribute("checked");stadium_view_["feedback"]="";
- if(auto *image=element("stadium-feature-image-"+field)){const bool checked=stadium_view_.at("draft").at(field).get();image->SetInnerRML(picture(renderer_.diagram("stadium-feature-"+field+(checked?"-built-":"-empty-")+theme_,stadium_feature_svg(field,checked,theme_),232),116,116));}
sync_stadium_draft();event.StopImmediatePropagation();return true;
}
}
diff --git a/src/modern/ui/stadium_model.hpp b/src/modern/ui/stadium_model.hpp
deleted file mode 100644
index 04e90e1..0000000
--- a/src/modern/ui/stadium_model.hpp
+++ /dev/null
@@ -1,518 +0,0 @@
-// SPDX-License-Identifier: GPL-3.0-only
-#pragma once
-// The stadium and its surroundings as a card model: bodies built from the blocks,
-// facilities and periphery of the stadium overview, seen through a camera, sorted by depth
-// and drawn as a vector picture. No renderer is involved: the same picture comes out on
-// every platform, and the same input always gives the same picture.
-//
-// World: x east, y north, z up, the centre spot at the origin; lengths roughly in metres.
-// Camera: an axonometric view (no perspective) turned by `yaw` around the vertical axis and
-// raised by `pitch` above the ground, both in degrees.
-#include "modern/ui/catalog.hpp"
-#include
-#include
-#include
-#include