The entry into the game on a pad: main menu, new game, managers, clubs, the season's opening
The main menu and everything up to the first day are written on one pad that lies in the middle of a table: the settings of a new game, the managers with their portraits, the clubs of a league, the entrants of the European cups, the cup draw and its overview. Saved games, mods and the sound open on the same pad. The table fills the window at any aspect while the pad stays whole. There is one style of portrait. The main menu asks before it leaves, and the ribbon of the notebook leads back to it. A stage that changes its height while it is drawn is now drawn once more; before, the notebook kept the height of the screen it came from. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
1 parent
f25abc2e16
commit
048ccbecaa
20 files changed
+637
-812
No files matched your search
Binary file not shown.
|
After Width: | Height: | Size: 894 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.5 MiB |
Binary file not shown.
|
After Width: | Height: | Size: 947 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.5 MiB |
@@ -301,6 +301,46 @@
|
|||||||
1,
|
1,
|
||||||
1
|
1
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
"entry.table": {
|
||||||
|
"file": "entry-table.png",
|
||||||
|
"sha256": "a2e38dc9233af4516fb08607af2191a142ff49f785e6852fc97bf3afcf7ccacb",
|
||||||
|
"crop": [
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
1
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"entry.club": {
|
||||||
|
"file": "entry-club.png",
|
||||||
|
"sha256": "edcac6345c07bfb98e4d23851a2f69c91920f6df4f6fb83706ab15542c08fe2b",
|
||||||
|
"crop": [
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
1
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"entry.international": {
|
||||||
|
"file": "entry-international.png",
|
||||||
|
"sha256": "e0cea088f29ebf392da363e4130445e2199c0eecb98d5f8051dd621922ad5fb9",
|
||||||
|
"crop": [
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
1
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"entry.draw": {
|
||||||
|
"file": "entry-draw.png",
|
||||||
|
"sha256": "66767efc37a0fde3a1297f854353af7e0cbf439c58a12fe238b48147eeac7c45",
|
||||||
|
"crop": [
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
1
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -319,3 +319,6 @@ body.midnight .hw-item,body.matchday .hw-item {background-color:#ffffff14;} body
|
|||||||
.nb-whistle,.nb-whistle:hover,.nb-whistle:disabled {left:3298.5dp;top:1845dp;width:1012.5dp;height:589.5dp;transform-origin:355.5dp 184.5dp;transform:rotate(115deg) scale(0.64);}
|
.nb-whistle,.nb-whistle:hover,.nb-whistle:disabled {left:3298.5dp;top:1845dp;width:1012.5dp;height:589.5dp;transform-origin:355.5dp 184.5dp;transform:rotate(115deg) scale(0.64);}
|
||||||
.nb-whistle:hover {transform:rotate(108deg) scale(0.7);filter:brightness(1.07);}
|
.nb-whistle:hover {transform:rotate(108deg) scale(0.7);filter:brightness(1.07);}
|
||||||
.nb-whistle-art {width:1012.5dp;height:589.5dp;}
|
.nb-whistle-art {width:1012.5dp;height:589.5dp;}
|
||||||
|
/* the ribbon is a button: back to the main menu */
|
||||||
|
.nb-ribbon,.nb-ribbon:hover,.nb-ribbon:focus {display:block;padding:0;margin:0;border:0dp;border-radius:0dp;background-color:transparent;decorator:none;}
|
||||||
|
.nb-ribbon:hover {top:2014dp;}
|
||||||
@@ -840,3 +840,193 @@ body.midnight .cp-map-name,body.matchday .cp-map-name {color:#f0ece2;font-effect
|
|||||||
.bk-move.flat {color:var(--p-n7);font-weight:normal;}
|
.bk-move.flat {color:var(--p-n7);font-weight:normal;}
|
||||||
.ad-memo.bk-rates strong {font-size:62dp;line-height:72dp;}
|
.ad-memo.bk-rates strong {font-size:62dp;line-height:72dp;}
|
||||||
.ad-memo.bk-rates span {font-size:50dp;line-height:66dp;}
|
.ad-memo.bk-rates span {font-size:50dp;line-height:66dp;}
|
||||||
|
|
||||||
|
/* --- the entry into the game: main menu, settings of a new game, managers, clubs, the season's
|
||||||
|
opening. Everything is written on one pad that lies in the middle of a table (the picture
|
||||||
|
entry.table, 1672 x 941 design units; 1 unit = 2.29665 dp). The pad is always paper, whatever
|
||||||
|
the skin of the career. --- */
|
||||||
|
.es-stage {position:absolute;left:0;top:0;width:3840dp;height:2161.15dp;overflow:hidden;background-color:#3a2414;
|
||||||
|
--p-bg:#f5ead8;--p-surf:#ebddc5;--p-text:#201e1d;--p-div:#201e1d29;--p-shade:#2e2b2557;
|
||||||
|
--p-n1:#f9f4ed;--p-n2:#eee7db;--p-n3:#dcd3c4;--p-n4:#c0b6a5;--p-n5:#a19786;--p-n6:#82796a;--p-n7:#645c50;--p-n8:#474238;--p-n9:#2e2b25;
|
||||||
|
--p-a1:#fff2eb;--p-a2:#ffe1d0;--p-a3:#ffc6a5;--p-a4:#f6a06b;--p-a5:#d67f48;--p-a6:#b2622d;--p-a7:#8c491a;--p-a8:#643312;--p-a9:#402310;
|
||||||
|
--p-s1:#f0fae1;--p-s2:#e1eecc;--p-s3:#ccdbb2;--p-s4:#aebf92;--p-s5:#8fa073;--p-s6:#728157;--p-s7:#56633f;--p-s8:#3d472b;--p-s9:#272e1b;
|
||||||
|
--p-accent:#c67139;--p-on-accent:#f9f4ed;--p-row:#201e1d0a;--p-rule:#201e1d17;
|
||||||
|
--text:#2a211a;--muted:#645c50;--border:#2a211a4d;--accent:#8c491a;--input:#fffdf6;--strong:#fffdf6;--selected:#ffe1d0;--hover:#f9f4ed;--soft:#f9f4ed;}
|
||||||
|
.es-table {position:absolute;left:0;top:0;width:3840dp;height:2161.15dp;}
|
||||||
|
.es-paper {position:absolute;left:996.75dp;top:454.74dp;width:1841.91dp;height:1276.94dp;display:flex;flex-direction:column;gap:22.97dp;font-family:Modern;font-size:31dp;line-height:41.34dp;color:#2a211a;}
|
||||||
|
.es-under {display:flex;flex:1;flex-direction:column;gap:22.97dp;min-height:0;min-width:0;}
|
||||||
|
.es-head {display:flex;flex:none;align-items:flex-end;gap:22.97dp;}
|
||||||
|
.es-clip {display:block;flex:none;width:137.8dp;height:9.19dp;}
|
||||||
|
.es-grow {display:block;flex:1;min-width:0;}
|
||||||
|
.es-k {display:block;font-size:24.11dp;line-height:32.15dp;letter-spacing:3.22dp;font-weight:bold;color:#8c491a;white-space:nowrap;}
|
||||||
|
.es-h1 {display:block;margin:0;font-family:Display;font-weight:normal;font-size:73.49dp;line-height:82.68dp;white-space:nowrap;color:#2a211a;}
|
||||||
|
.es-h {display:block;margin:0;font-family:Display;font-weight:normal;color:#2a211a;}
|
||||||
|
.es-rule {display:block;flex:none;height:3.44dp;background-color:#8c491a59;}
|
||||||
|
.es-foot {display:flex;flex:none;justify-content:flex-end;align-items:center;gap:18.37dp;height:82.68dp;padding-right:160.77dp;}
|
||||||
|
.es-foot .es-note {display:block;flex:1;font-size:27.56dp;color:#645c50;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
|
||||||
|
.es-fill {display:flex;flex:1;min-height:0;min-width:0;}
|
||||||
|
.es-row {display:flex;align-items:center;gap:22.97dp;min-width:0;}
|
||||||
|
.es-col {display:flex;flex-direction:column;min-width:0;min-height:0;}
|
||||||
|
.es-mut {color:#645c50;}
|
||||||
|
.es-box {display:block;border:3.44dp #2a211a33;border-radius:32.15dp;background-color:#fffdf680;padding:22.97dp 27.56dp;min-width:0;}
|
||||||
|
.es-box.es-row,.es-box.es-col {display:flex;}
|
||||||
|
.es-paper .pg-btn,.es-veil .pg-btn {height:78.09dp;padding:0 41.34dp;border-radius:39.04dp;font-size:34.45dp;line-height:45.93dp;}
|
||||||
|
.es-paper .pg-btn.sm,.es-veil .pg-btn.sm {height:64.31dp;padding:0 29.86dp;font-size:29.86dp;}
|
||||||
|
.es-paper .pg-tabs {gap:13.78dp;}
|
||||||
|
.es-paper .pg-tabs button,.es-paper .pg-tabs button:disabled {height:68.9dp;line-height:68.9dp;padding:0 36.75dp;border-radius:34.45dp;font-size:32.15dp;}
|
||||||
|
|
||||||
|
/* the main menu */
|
||||||
|
.es-title {display:block;flex:none;margin:0;padding-top:9.19dp;font-family:Display;font-weight:normal;font-size:114.83dp;line-height:128.61dp;white-space:nowrap;color:#2a211a;}
|
||||||
|
.es-gold {display:block;flex:none;width:252.63dp;height:11.48dp;border-radius:6.89dp;background-color:#d9a441;margin:-4.59dp 0 4.59dp;}
|
||||||
|
.es-menu {display:flex;flex:none;flex-direction:column;width:918.66dp;}
|
||||||
|
.es-stage .es-mb,.es-stage .es-mb:hover,.es-stage .es-mb:focus,.es-stage .es-mb:disabled {display:flex;flex:none;align-items:center;width:918.66dp;height:114.83dp;padding:0 32.15dp 0 45.93dp;margin:0;border:0dp;border-bottom:3.44dp #2a211a4d;border-radius:0dp;background-color:transparent;decorator:none;box-shadow:none;font-family:Display;font-weight:normal;font-size:52.82dp;letter-spacing:0dp;color:#2a211a;text-align:left;opacity:1;}
|
||||||
|
.es-stage .es-mb.gap {margin-top:32.15dp;border-top:3.44dp #2a211a4d;}
|
||||||
|
.es-stage .es-mb:hover,.es-stage .es-mb:focus-visible {background-color:#d9a44129;border-left:13.78dp #d9a441;padding-left:45.93dp;}
|
||||||
|
.es-stage .es-mb span {display:block;white-space:nowrap;}
|
||||||
|
.es-stage .es-mb .es-mb-s {margin-left:22.97dp;font-family:Modern;font-size:24.11dp;letter-spacing:2.76dp;color:#2a211a80;}
|
||||||
|
.es-stage .es-mb .es-mb-a {font-size:64.31dp;color:#b2622d;opacity:0;}
|
||||||
|
.es-stage .es-mb:hover .es-mb-a,.es-stage .es-mb:focus-visible .es-mb-a {opacity:1;}
|
||||||
|
.es-stage .es-mb[disabled],.es-stage .es-mb[disabled]:hover {color:#2a211a6b;background-color:transparent;border-left-width:0dp;padding-left:45.93dp;}
|
||||||
|
.es-stage .es-mb[disabled] .es-mb-a {opacity:0;}
|
||||||
|
.es-side {display:flex;flex:1;flex-direction:column;justify-content:flex-end;gap:11.48dp;padding:0 160.77dp 13.78dp 0;text-align:right;}
|
||||||
|
.es-side span,.es-side strong {display:block;}
|
||||||
|
.es-side strong {font-size:34.45dp;line-height:45.93dp;}
|
||||||
|
.es-ask {text-align:left;}
|
||||||
|
.es-ask strong {font-family:Display;font-weight:normal;font-size:41.34dp;line-height:55.12dp;}
|
||||||
|
|
||||||
|
/* the settings of a new game */
|
||||||
|
.es-stage .es-step,.es-stage .es-step:hover,.es-stage .es-step:focus,.es-stage .es-step:disabled {display:flex;flex:none;align-items:center;justify-content:center;width:87.27dp;height:87.27dp;padding:0;margin:0;border:3.44dp #2a211a4d;border-radius:43.64dp;background-color:#fffdf699;decorator:none;font-family:Display;font-size:50.53dp;line-height:59.71dp;color:#2a211a;opacity:1;}
|
||||||
|
.es-stage .es-step:hover {background-color:#ffe1d0;border-color:#b2622d;}
|
||||||
|
.es-stage .es-step[disabled],.es-stage .es-step[disabled]:hover {opacity:.3;background-color:#fffdf699;border-color:#2a211a4d;}
|
||||||
|
.es-opt {position:relative;display:flex;flex:1;align-items:center;gap:13.78dp;padding:55.12dp 27.56dp 18.37dp;min-height:0;}
|
||||||
|
.es-opt-k {position:absolute;left:32.15dp;top:20.67dp;}
|
||||||
|
.es-opt-v {display:flex;flex:1;flex-direction:column;align-items:center;justify-content:center;min-width:0;}
|
||||||
|
.es-num {display:block;font-family:Display;font-size:174.55dp;line-height:174.55dp;color:#2a211a;}
|
||||||
|
.es-num.inf {font-size:220.48dp;line-height:160.77dp;}
|
||||||
|
.es-cap {display:block;font-size:27.56dp;line-height:36.75dp;color:#645c50;white-space:nowrap;}
|
||||||
|
.es-balls {display:flex;flex-wrap:wrap;justify-content:center;gap:6.89dp;width:493.78dp;margin-bottom:6.89dp;}
|
||||||
|
.es-ball {display:block;flex:none;width:87.27dp;height:87.27dp;}
|
||||||
|
.es-faces {display:flex;justify-content:center;gap:16.08dp;margin-bottom:9.19dp;}
|
||||||
|
.es-face-dot {display:block;flex:none;width:142.39dp;height:142.39dp;border:4.59dp #2a211a;border-radius:75.79dp;overflow:hidden;}
|
||||||
|
.es-face-dot.near {margin-left:-27.56dp;}
|
||||||
|
.es-face-dot.first {margin-left:0dp;}
|
||||||
|
.es-stage .es-mode,.es-stage .es-mode:hover,.es-stage .es-mode:focus,.es-stage .es-mode:disabled {position:relative;display:flex;flex:1;flex-direction:column;align-items:center;padding:16.08dp 16.08dp 0;margin:0;border:0dp;border-radius:22.97dp;background-color:#fffdf6;decorator:none;overflow:hidden;transform:rotate(-1.2deg);text-align:center;opacity:1;}
|
||||||
|
.es-stage .es-mode.b,.es-stage .es-mode.b:hover,.es-stage .es-mode.b:disabled {transform:rotate(1deg);}
|
||||||
|
.es-stage .es-mode.off,.es-stage .es-mode.off:hover {opacity:.55;background-color:#e6ddcd;}
|
||||||
|
.es-stage .es-mode-art {display:block;flex:none;overflow:hidden;border-radius:9.19dp;}
|
||||||
|
.es-stage .es-mode strong {display:block;padding:13.78dp 0 16.08dp;font-family:Display;font-weight:normal;font-size:36.75dp;line-height:45.93dp;color:#2a211a;white-space:nowrap;}
|
||||||
|
.es-check {position:absolute;right:29.86dp;top:29.86dp;display:flex;align-items:center;justify-content:center;width:68.9dp;height:68.9dp;border:4.59dp #2a211a;border-radius:34.45dp;background-color:#fffdf6;}
|
||||||
|
.es-check span {display:block;font-family:Modern;font-size:39.04dp;line-height:50.53dp;font-weight:bold;color:#2a211a;}
|
||||||
|
.es-stage .es-mode.on .es-check {background-color:#d9a441;border-color:#d9a441;}
|
||||||
|
|
||||||
|
/* a new manager */
|
||||||
|
.es-paper input.es-in {display:block;width:100%;height:82.68dp;padding:0 32.15dp;border:3.44dp #2a211a4d;border-radius:41.34dp;background-color:#fffdf6cc;decorator:none;font-family:Modern;font-size:34.45dp;line-height:75.79dp;color:#2a211a;}
|
||||||
|
.es-paper input.es-in:focus {border-color:#8c491a;}
|
||||||
|
.es-paper select {width:284.78dp;height:73.49dp;padding:0 45.93dp 0 22.97dp;border:3.44dp #2a211a4d;border-radius:36.75dp;background-color:#fffdf6cc;font-family:Modern;font-size:29.86dp;line-height:66.6dp;font-weight:bold;color:#2a211a;}
|
||||||
|
.es-paper select.wide {width:390.43dp;}
|
||||||
|
.es-paper select selectvalue {padding-right:13.78dp;height:66.6dp;line-height:66.6dp;overflow:hidden;white-space:nowrap;}
|
||||||
|
.es-paper select selectarrow {width:11.48dp;height:11.48dp;margin-right:-22.97dp;margin-top:22.97dp;border-bottom:3.44dp #645c50;border-right:3.44dp #645c50;}
|
||||||
|
.es-paper select selectbox {padding:9.19dp;border:3.44dp #2a211a4d;border-radius:22.97dp;background-color:#fffdf6;max-height:689dp;}
|
||||||
|
.es-paper select option {padding:9.19dp 22.97dp;min-height:41.34dp;font-size:29.86dp;font-weight:normal;color:#2a211a;}
|
||||||
|
.es-paper select option:hover,.es-paper select option:checked {background-color:#ffe1d0;}
|
||||||
|
.es-face {display:block;flex:none;overflow:hidden;border-radius:22.97dp;}
|
||||||
|
.es-face.small {border-radius:18.37dp;}
|
||||||
|
.es-stage .es-por,.es-stage .es-por:hover,.es-stage .es-por:focus,.es-stage .es-por:disabled {position:relative;display:block;flex:none;width:215.89dp;height:284.78dp;padding:0;margin:0;border:6.89dp transparent;border-radius:22.97dp;background-color:transparent;decorator:none;overflow:hidden;opacity:1;}
|
||||||
|
.es-stage .es-por:hover {border-color:#b2622d8c;}
|
||||||
|
.es-stage .es-por.sel,.es-stage .es-por.sel:hover {border-color:#b2622d;background-color:#d9a441;}
|
||||||
|
.es-stage .es-por[disabled],.es-stage .es-por[disabled]:hover {border-color:transparent;}
|
||||||
|
.es-stage .es-por[disabled] .es-face {opacity:.28;}
|
||||||
|
.es-stage .es-por-used {position:absolute;left:0;bottom:11.48dp;display:block;width:202.11dp;text-align:center;font-family:Modern;font-weight:bold;font-size:21.82dp;line-height:25.26dp;letter-spacing:1.84dp;color:#2a211a;}
|
||||||
|
.es-pors {display:flex;flex:1;flex-wrap:wrap;gap:9.19dp 11.48dp;align-content:center;justify-content:center;min-height:0;}
|
||||||
|
.es-slot {display:block;flex:none;width:62.01dp;height:82.68dp;border:3.44dp #2a211a59;border-radius:18.37dp;}
|
||||||
|
.es-seat {display:flex;flex:none;align-items:center;gap:16.08dp;min-width:0;}
|
||||||
|
.es-seat strong {display:block;font-size:28.71dp;line-height:34.45dp;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
|
||||||
|
.es-seat span {display:block;font-size:25.26dp;line-height:32.15dp;color:#645c50;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
|
||||||
|
.es-warn {color:#a8452f;}
|
||||||
|
|
||||||
|
/* the clubs of a league */
|
||||||
|
.es-grid {display:block;flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;}
|
||||||
|
.es-grid-in {display:flex;flex-wrap:wrap;gap:18.37dp;padding:4.59dp;}
|
||||||
|
.es-stage .es-tile,.es-stage .es-tile:hover,.es-stage .es-tile:focus,.es-stage .es-tile:disabled {display:flex;flex:none;flex-direction:column;align-items:center;gap:9.19dp;width:344.5dp;padding:22.97dp 13.78dp 18.37dp;margin:0;border:4.59dp #2a211a24;border-radius:27.56dp;background-color:#fffdf699;decorator:none;text-align:center;font-family:Modern;font-size:28.71dp;color:#2a211a;opacity:1;}
|
||||||
|
.es-stage .es-tile:hover {border-color:#b2622d;background-color:#fffdf6;}
|
||||||
|
.es-stage .es-tile.sel,.es-stage .es-tile.sel:hover {border-color:#b2622d;background-color:#ffe1d0;}
|
||||||
|
.es-stage .es-tile[disabled],.es-stage .es-tile[disabled]:hover {opacity:.5;border-color:#2a211a24;background-color:#fffdf699;}
|
||||||
|
.es-stage .es-tile strong {display:block;width:307.75dp;font-size:28.71dp;line-height:34.45dp;font-weight:bold;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
|
||||||
|
.es-stage .es-tile small {display:block;width:307.75dp;font-size:24.11dp;line-height:29.86dp;color:#645c50;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
|
||||||
|
.es-stage .es-tile.sel small {color:#3d472b;font-weight:bold;}
|
||||||
|
|
||||||
|
/* a note laid over the pad */
|
||||||
|
.es-veil {position:absolute;left:964.59dp;top:422.58dp;width:1906.22dp;height:1341.24dp;z-index:50;display:flex;align-items:center;justify-content:center;border-radius:41.34dp;background-color:#f5ead8d1;}
|
||||||
|
.es-dlg {display:flex;flex-direction:column;gap:27.56dp;width:1148.33dp;padding:41.34dp 45.93dp;border:3.44dp #2a211a59;border-radius:36.75dp;background-color:#fffdf6;font-family:Modern;font-size:31dp;line-height:41.34dp;color:#2a211a;}
|
||||||
|
.es-dlg h2 {display:block;margin:0;font-family:Display;font-weight:normal;font-size:55.12dp;line-height:64.31dp;color:#2a211a;}
|
||||||
|
.es-dlg p {display:block;margin:0;}
|
||||||
|
.es-dlg-act {display:flex;justify-content:flex-end;align-items:center;gap:18.37dp;}
|
||||||
|
.es-dl {display:block;flex:1;min-width:0;}
|
||||||
|
.es-dl div {display:flex;gap:27.56dp;}
|
||||||
|
.es-dl span {display:block;flex:none;width:137.8dp;color:#645c50;}
|
||||||
|
.es-dl strong {display:block;flex:1;font-weight:bold;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
|
||||||
|
.es-stage .es-choice,.es-stage .es-choice:hover,.es-stage .es-choice:focus {display:block;width:100%;padding:18.37dp 27.56dp;margin:0;border:3.44dp #2a211a33;border-radius:22.97dp;background-color:#fffdf680;decorator:none;text-align:left;font-family:Modern;font-size:31dp;color:#2a211a;}
|
||||||
|
.es-stage .es-choice:hover {border-color:#b2622d;background-color:#ffe1d0;}
|
||||||
|
.es-stage .es-choice strong,.es-stage .es-choice span {display:block;}
|
||||||
|
.es-stage .es-choice span {font-size:27.56dp;color:#645c50;}
|
||||||
|
.es-error {display:block;min-height:36.75dp;font-size:27.56dp;color:#a8452f;}
|
||||||
|
|
||||||
|
/* the season's opening */
|
||||||
|
.es-ent {display:flex;flex:1;flex-wrap:wrap;gap:22.97dp;align-content:center;justify-content:center;min-height:0;overflow-y:auto;}
|
||||||
|
.es-ent-card {display:flex;flex:none;align-items:center;gap:32.15dp;width:909.47dp;padding:27.56dp 36.75dp;}
|
||||||
|
.es-ent-card.one {width:1841.91dp;gap:55.12dp;padding:55.12dp 68.9dp;}
|
||||||
|
.es-ent-card.own {background-color:#ffe1d0;border-color:#b2622d;}
|
||||||
|
.es-ent-name {display:block;font-family:Display;font-size:45.93dp;line-height:55.12dp;color:#2a211a;}
|
||||||
|
.es-ent-card.one .es-ent-name {font-size:82.68dp;line-height:91.87dp;}
|
||||||
|
.es-own {display:inline-block;margin-top:9.19dp;padding:4.59dp 22.97dp;border-radius:22.97dp;background-color:#b2622d;font-weight:bold;font-size:26.41dp;line-height:34.45dp;color:#fff8ea;}
|
||||||
|
.es-draw-art {position:relative;display:block;flex:none;height:519.04dp;padding:13.78dp;border-radius:18.37dp;background-color:#fffdf6;overflow:hidden;}
|
||||||
|
.es-draw-pic {display:block;overflow:hidden;border-radius:6.89dp;}
|
||||||
|
.es-stage .es-draw-dot {position:absolute;left:auto;right:41.34dp;top:41.34dp;bottom:auto;display:block;width:27.56dp;height:27.56dp;margin:0;border:4.59dp #00000059;border-radius:18.37dp;background-color:#fff8ea;}
|
||||||
|
.es-stage .es-draw-dot.is-paused {opacity:.45;}
|
||||||
|
.es-pair {display:flex;flex:none;align-items:center;gap:9.19dp;height:48.23dp;padding:0 13.78dp;border:3.44dp transparent;border-radius:16.08dp;font-size:26.41dp;line-height:34.45dp;color:#2a211a;}
|
||||||
|
.es-pair.big {height:142.39dp;gap:22.97dp;padding:0 32.15dp;border-color:#2a211a33;border-radius:32.15dp;background-color:#fffdf699;}
|
||||||
|
.es-pair.own,.es-pair.big.own {background-color:#ffe1d0;border-color:#b2622d;color:#643312;}
|
||||||
|
.es-pair-n {display:block;flex:none;width:50.53dp;font-family:Display;font-size:25.26dp;color:#8c491a;}
|
||||||
|
.es-pair.big .es-pair-n {width:91.87dp;font-size:45.93dp;line-height:55.12dp;}
|
||||||
|
.es-pair-s {display:flex;flex:1;align-items:center;gap:11.48dp;min-width:0;}
|
||||||
|
.es-pair-s.home {justify-content:flex-end;}
|
||||||
|
.es-pair.big .es-pair-s {gap:22.97dp;}
|
||||||
|
.es-pair-s strong {display:block;font-size:26.41dp;font-weight:bold;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
|
||||||
|
.es-pair.big .es-pair-s strong {font-family:Display;font-weight:normal;font-size:43.64dp;line-height:55.12dp;}
|
||||||
|
.es-pair-s strong.unknown {color:#82796a;}
|
||||||
|
.es-pair-v {display:block;flex:none;width:22.97dp;text-align:center;}
|
||||||
|
.es-pair.big .es-pair-v {width:55.12dp;}
|
||||||
|
.es-pair-ph {display:block;flex:none;width:41.34dp;height:41.34dp;border:3.44dp #a19786;border-radius:20.67dp;}
|
||||||
|
.es-pair.big .es-pair-ph {width:101.05dp;height:101.05dp;border-radius:50.53dp;}
|
||||||
|
.es-recent {display:block;flex:none;height:146.99dp;margin-top:4.59dp;}
|
||||||
|
.es-cols {display:flex;flex:1;gap:36.75dp;min-height:0;overflow-y:auto;}
|
||||||
|
.es-cols>div {display:block;flex:1;min-width:0;}
|
||||||
|
|
||||||
|
/* mods, saved games and the sound, opened from the main menu */
|
||||||
|
.es-stage .es-li,.es-stage .es-li:hover,.es-stage .es-li:focus,.es-stage .es-li:disabled {display:block;flex:none;width:100%;padding:18.37dp 27.56dp;margin:0 0 4.59dp;border:3.44dp transparent;border-radius:22.97dp;background-color:transparent;decorator:none;text-align:left;font-family:Modern;font-size:31dp;line-height:41.34dp;color:#2a211a;opacity:1;}
|
||||||
|
.es-stage .es-li:hover {background-color:#fffdf6b3;}
|
||||||
|
.es-stage .es-li.sel,.es-stage .es-li.sel:hover {background-color:#ffe1d0;border-color:#b2622d;}
|
||||||
|
.es-stage .es-li strong,.es-stage .es-li span {display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
|
||||||
|
.es-stage .es-li span {font-size:27.56dp;color:#645c50;}
|
||||||
|
.es-list {display:block;flex:none;min-height:0;overflow-y:auto;overflow-x:hidden;}
|
||||||
|
.es-detail {display:flex;flex:1;flex-direction:column;gap:13.78dp;min-height:0;overflow:hidden;}
|
||||||
|
.es-kv {display:flex;gap:27.56dp;padding:6.89dp 0;border-bottom:2.3dp #2a211a14;}
|
||||||
|
.es-kv span {display:block;flex:none;width:183.73dp;color:#645c50;}
|
||||||
|
.es-kv strong {display:block;flex:1;font-weight:bold;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
|
||||||
|
.es-paper .fl-crest {width:137.8dp;height:137.8dp;}
|
||||||
|
.es-paper .pg-stat {padding:13.78dp 18.37dp;}
|
||||||
|
.es-sound {display:block;flex:1;min-height:0;padding:13.78dp 183.73dp 0 0;overflow-y:auto;}
|
||||||
|
.es-sound .settings-group h3 {display:none;}
|
||||||
|
.es-sound .settings-row {min-height:101.05dp;gap:45.93dp;padding:13.78dp 0;}
|
||||||
|
.es-sound .settings-row label>span {font-size:34.45dp;line-height:45.93dp;}
|
||||||
|
.es-sound select {width:390.43dp;}
|
||||||
|
.es-stage .es-mb.gap {border-top-width:0dp;}
|
||||||
|
.es-stage .es-mode[disabled],.es-stage .es-mode[disabled]:hover {opacity:1;}
|
||||||
|
.es-stage .es-mode.off,.es-stage .es-mode.off:hover,.es-stage .es-mode.off[disabled] {opacity:.55;}
|
||||||
|
.es-paper .es-seg {height:68.9dp;border-radius:34.45dp;}
|
||||||
|
.es-paper .es-seg button,.es-paper .es-seg button:disabled {height:62.01dp;line-height:62.01dp;padding:0 18.37dp;font-size:26.41dp;}
|
||||||
|
.es-paper select.es-narrow {width:243.44dp;}
|
||||||
|
.es-pair-s {overflow:hidden;}
|
||||||
|
.es-pair-s strong,.es-pair.big .es-pair-s strong {flex:none;overflow:visible;text-overflow:clip;}
|
||||||
|
.es-stage .es-draw-dot {width:32.15dp;height:32.15dp;border-width:0dp;border-radius:16.08dp;}
|
||||||
|
.es-foot .es-note {min-width:0;pointer-events:none;}
|
||||||
@@ -475,6 +475,17 @@ void App::ProcessEvent(Rml::Event &event) try {
|
|||||||
void App::dispatch(const std::string &action, Rml::Element *target) {
|
void App::dispatch(const std::string &action, Rml::Element *target) {
|
||||||
const auto id =
|
const auto id =
|
||||||
target ? target->GetAttribute<Rml::String>("data-id", "") : std::string();
|
target ? target->GetAttribute<Rml::String>("data-id", "") : std::string();
|
||||||
|
// the ribbon of the notebook leads back to the main menu, after asking
|
||||||
|
if (action == "nb-home") {
|
||||||
|
if (engine_mode_) {
|
||||||
|
if (engine_busy_ || engine_files_busy_ || !popup_.empty()) return;
|
||||||
|
confirmation(engine_dirty_ ? "Zurück ins Hauptmenü? Was seit dem letzten Speichern geschah, geht verloren." : "Zurück ins Hauptmenü?", [this] { engine_manager_main(); });
|
||||||
|
popup_accept_ = "Zum Hauptmenü";
|
||||||
|
} else if (source_ && scene_ == "desktop") {
|
||||||
|
dispatch("context-quit", target);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
if(front_action(action,target))return;
|
if(front_action(action,target))return;
|
||||||
if (live_action(action, target)) return;
|
if (live_action(action, target)) return;
|
||||||
if(national_action(action,target))return;
|
if(national_action(action,target))return;
|
||||||
@@ -540,9 +551,26 @@ void App::dispatch(const std::string &action, Rml::Element *target) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (action == "exit") {
|
if (action == "exit") {
|
||||||
|
// the main menu asks first
|
||||||
|
if (scene_ == "main" && menu_.empty() && !front_quit_) {
|
||||||
|
front_quit_ = true;
|
||||||
|
focus_after_render_ = "front-quit-no";
|
||||||
|
refresh();
|
||||||
|
return;
|
||||||
|
}
|
||||||
closed_ = true;
|
closed_ = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (action == "front-quit-yes") {
|
||||||
|
closed_ = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (action == "front-quit-no") {
|
||||||
|
front_quit_ = false;
|
||||||
|
focus_after_render_ = "front-exit";
|
||||||
|
refresh();
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (action == "quit-without-save") {
|
if (action == "quit-without-save") {
|
||||||
closed_ = true;
|
closed_ = true;
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -327,7 +327,7 @@ void App::engine_event(Rml::Event &event) {
|
|||||||
if (!engine_busy_ && popup_.empty() && contracts_event(event)) return;
|
if (!engine_busy_ && popup_.empty() && contracts_event(event)) return;
|
||||||
if(engine_opening_active()&&menu_.empty()&&popup_.empty()) {
|
if(engine_opening_active()&&menu_.empty()&&popup_.empty()) {
|
||||||
if(type=="keydown") {const auto key=Rml::Input::KeyIdentifier(event.GetParameter<int>("key_identifier",0));
|
if(type=="keydown") {const auto key=Rml::Input::KeyIdentifier(event.GetParameter<int>("key_identifier",0));
|
||||||
if(key==Rml::Input::KI_TAB){Rml::ElementList nodes;doc_->QuerySelectorAll(nodes,".opening-actions button");std::erase_if(nodes,[](auto *n){return n->HasAttribute("disabled");});if(!nodes.empty()){const auto it=std::find(nodes.begin(),nodes.end(),context_->GetFocusElement());const int i=it==nodes.end()?-1:int(it-nodes.begin()),n=int(nodes.size());nodes[size_t((i+n+(event.GetParameter<int>("shift_key",0)?-1:1))%n)]->Focus(true);}event.StopImmediatePropagation();return;}
|
if(key==Rml::Input::KI_TAB){Rml::ElementList nodes;doc_->QuerySelectorAll(nodes,".es-foot button");std::erase_if(nodes,[](auto *n){return n->HasAttribute("disabled");});if(!nodes.empty()){const auto it=std::find(nodes.begin(),nodes.end(),context_->GetFocusElement());const int i=it==nodes.end()?-1:int(it-nodes.begin()),n=int(nodes.size());nodes[size_t((i+n+(event.GetParameter<int>("shift_key",0)?-1:1))%n)]->Focus(true);}event.StopImmediatePropagation();return;}
|
||||||
if(key==Rml::Input::KI_RETURN||key==Rml::Input::KI_SPACE){for(auto *n=target;n&&n!=doc_;n=n->GetParentNode())if(n->GetTagName()=="button"&&!n->HasAttribute("disabled")){n->DispatchEvent("click",{});break;}}}
|
if(key==Rml::Input::KI_RETURN||key==Rml::Input::KI_SPACE){for(auto *n=target;n&&n!=doc_;n=n->GetParentNode())if(n->GetTagName()=="button"&&!n->HasAttribute("disabled")){n->DispatchEvent("click",{});break;}}}
|
||||||
if(type=="click")for(auto *n=target;n&&n!=doc_;n=n->GetParentNode())if(n->HasAttribute("data-action")){opening_action(n->GetAttribute<Rml::String>("data-action",""),n);break;}
|
if(type=="click")for(auto *n=target;n&&n!=doc_;n=n->GetParentNode())if(n->HasAttribute("data-action")){opening_action(n->GetAttribute<Rml::String>("data-action",""),n);break;}
|
||||||
event.StopImmediatePropagation();return;
|
event.StopImmediatePropagation();return;
|
||||||
@@ -476,6 +476,13 @@ void App::engine_event(Rml::Event &event) {
|
|||||||
if (engine_sports_action(action, id, node)) return;
|
if (engine_sports_action(action, id, node)) return;
|
||||||
if (engine_lineup_action(action, id, node)) return;
|
if (engine_lineup_action(action, id, node)) return;
|
||||||
if (action == "close") { if(menu_=="scorers"||menu_=="fairplay")rankings_remember_scroll(); menu_.clear(); refresh(); }
|
if (action == "close") { if(menu_=="scorers"||menu_=="fairplay")rankings_remember_scroll(); menu_.clear(); refresh(); }
|
||||||
|
// the ribbon of the notebook: back to the main menu, after asking
|
||||||
|
else if (action == "nb-home") {
|
||||||
|
if (!engine_busy_ && !engine_files_busy_ && popup_.empty()) {
|
||||||
|
confirmation(engine_dirty_ ? "Zurück ins Hauptmenü? Was seit dem letzten Speichern geschah, geht verloren." : "Zurück ins Hauptmenü?", [this] { engine_manager_main(); });
|
||||||
|
popup_accept_ = "Zum Hauptmenü";
|
||||||
|
}
|
||||||
|
}
|
||||||
else if (action == "engine-ticket" && engine_fresh_) {
|
else if (action == "engine-ticket" && engine_fresh_) {
|
||||||
const auto price = engine_ticket_projection(engine_data_);
|
const auto price = engine_ticket_projection(engine_data_);
|
||||||
ticket_->open(node, device_ratio_, price.at("min"), price.at("max")); dirty_ = true;
|
ticket_->open(node, device_ratio_, price.at("min"), price.at("max")); dirty_ = true;
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ void App::engine_render() {
|
|||||||
} else if (scene_ == "live" && live_.available()) {
|
} else if (scene_ == "live" && live_.available()) {
|
||||||
out = render_live();
|
out = render_live();
|
||||||
} else if(engine_opening_active()&&menu_.empty()) {
|
} else if(engine_opening_active()&&menu_.empty()) {
|
||||||
out=main_menu()+"<div class=\"fill\" style=\"z-index:100;\">"+render_opening()+"</div>";
|
out=render_opening();
|
||||||
} else {
|
} else {
|
||||||
const auto &desk = engine_data_.at("desktop").at("data"), &meta = engine_data_.at("desktop").at("meta");
|
const auto &desk = engine_data_.at("desktop").at("data"), &meta = engine_data_.at("desktop").at("meta");
|
||||||
const auto &team = desk.at("team"), &person = desk.at("manager");
|
const auto &team = desk.at("team"), &person = desk.at("manager");
|
||||||
@@ -232,7 +232,9 @@ void App::engine_render() {
|
|||||||
notebook_finish(out);
|
notebook_finish(out);
|
||||||
element("canvas")->SetInnerRML(out); ++document_generation_;
|
element("canvas")->SetInnerRML(out); ++document_generation_;
|
||||||
setting_menu_markup_ = false;
|
setting_menu_markup_ = false;
|
||||||
|
needs_render_ = false;
|
||||||
sync_window_zoom();
|
sync_window_zoom();
|
||||||
|
const bool resized = needs_render_; // the stage changed its height: it is drawn once more
|
||||||
live_detail_pending_ = live_ticker_pending_ = false;
|
live_detail_pending_ = live_ticker_pending_ = false;
|
||||||
scale_chalk_shadow();
|
scale_chalk_shadow();
|
||||||
if (!engine_player_.empty()) {
|
if (!engine_player_.empty()) {
|
||||||
@@ -264,5 +266,5 @@ void App::engine_render() {
|
|||||||
Rml::ElementList controls; doc_->QuerySelectorAll(controls, "#canvas button,#canvas input");
|
Rml::ElementList controls; doc_->QuerySelectorAll(controls, "#canvas button,#canvas input");
|
||||||
for (auto *node : controls) node->SetAttribute("disabled", true);
|
for (auto *node : controls) node->SetAttribute("disabled", true);
|
||||||
}
|
}
|
||||||
needs_render_ = false; dirty_ = true;
|
needs_render_ = resized; dirty_ = true;
|
||||||
}
|
}
|
||||||
@@ -168,7 +168,7 @@ void App::entry_confirm() {
|
|||||||
{"club", selected_club_},
|
{"club", selected_club_},
|
||||||
{"portrait", portrait},
|
{"portrait", portrait},
|
||||||
{"portrait_style",
|
{"portrait_style",
|
||||||
selections_["portrait-style"] == "painted" ? "painted" : "photo"},
|
"painted"}, // one style of portrait
|
||||||
{"strength_choice", selections_["manager-strength"].empty()
|
{"strength_choice", selections_["manager-strength"].empty()
|
||||||
? 1
|
? 1
|
||||||
: std::stoi(selections_["manager-strength"])}});
|
: std::stoi(selections_["manager-strength"])}});
|
||||||
@@ -314,6 +314,12 @@ bool App::entry_action(const std::string &action, Rml::Element *target) {
|
|||||||
league_ = entry_picker_league_;
|
league_ = entry_picker_league_;
|
||||||
manager_picker_ = false;
|
manager_picker_ = false;
|
||||||
focus_after_render_ = "manager-clubs";
|
focus_after_render_ = "manager-clubs";
|
||||||
|
} else if (action == "manager-strength-pick") {
|
||||||
|
if (entry_full() || (id != "0" && id != "1" && id != "2"))
|
||||||
|
return true;
|
||||||
|
selections_["manager-name"] = field("manager-name");
|
||||||
|
selections_["manager-strength"] = id;
|
||||||
|
focus_after_render_ = "manager-strength-" + id;
|
||||||
} else if (action == "portrait-style") {
|
} else if (action == "portrait-style") {
|
||||||
selections_["manager-name"] = field("manager-name");
|
selections_["manager-name"] = field("manager-name");
|
||||||
if (id == "photo" || id == "painted")
|
if (id == "photo" || id == "painted")
|
||||||
|
|||||||
@@ -2,260 +2,106 @@
|
|||||||
// Read-only presentation of canonical DemoSource opening_flow. No extra App
|
// Read-only presentation of canonical DemoSource opening_flow. No extra App
|
||||||
// API. Timer, phase changes, persistence, keyboard handling and completion
|
// API. Timer, phase changes, persistence, keyboard handling and completion
|
||||||
// belong to the controller. No participants or pairings are invented by the
|
// belong to the controller. No participants or pairings are invented by the
|
||||||
// renderer.
|
// renderer. The pages are written on the pad of the entry (front_screens.inc).
|
||||||
std::string App::render_opening() {
|
std::string App::render_opening() {
|
||||||
const auto state = engine_mode_?engine_opening_state_:snap().state;
|
const auto state = engine_mode_ ? engine_opening_state_ : snap().state;
|
||||||
const auto &flow = state.at("opening_flow");
|
const auto &flow = state.at("opening_flow");
|
||||||
const auto phase = flow.at("phase").get<std::string>();
|
const auto phase = flow.at("phase").get<std::string>();
|
||||||
const bool playing = flow.value("playing", false) && !opening_io_blocked_;
|
const bool playing = flow.value("playing", false) && !opening_io_blocked_;
|
||||||
|
const auto u = [](double units) { return units * kEntryUnit; };
|
||||||
std::set<std::string> own;
|
std::set<std::string> own;
|
||||||
for (const auto &m : state.at("managers"))
|
for (const auto &m : state.at("managers")) own.insert(m.value("club", ""));
|
||||||
own.insert(m.value("club", ""));
|
|
||||||
std::vector<const Json *> order;
|
std::vector<const Json *> order;
|
||||||
std::set<std::string> seen;
|
std::set<std::string> seen;
|
||||||
for (const auto &id : flow.at("order")) {
|
for (const auto &id : flow.at("order")) {
|
||||||
if (!id.is_string())
|
if (!id.is_string()) continue;
|
||||||
continue;
|
|
||||||
const auto key = id.get<std::string>();
|
const auto key = id.get<std::string>();
|
||||||
if (const auto *c = world_->find("clubs", key);
|
if (const auto *c = world_->find("clubs", key); c && seen.insert(key).second) order.push_back(c);
|
||||||
c && seen.insert(key).second)
|
|
||||||
order.push_back(c);
|
|
||||||
}
|
}
|
||||||
const int total = int(order.size()), pairs = total / 2;
|
const int total = int(order.size()), pairs = total / 2;
|
||||||
const int revealed = std::clamp(flow.value("revealed", 0), 0, total);
|
const int revealed = std::clamp(flow.value("revealed", 0), 0, total);
|
||||||
const auto date = state.value(
|
const auto date = state.value("date", world_->manifest().value("start_date", std::string()));
|
||||||
"date", world_->manifest().value("start_date", std::string()));
|
|
||||||
std::string season = "–";
|
std::string season = "–";
|
||||||
if (date.size() >= 4 &&
|
if (date.size() >= 4 && std::all_of(date.begin(), date.begin() + 4, [](char c) { return c >= '0' && c <= '9'; })) {
|
||||||
std::all_of(date.begin(), date.begin() + 4,
|
|
||||||
[](char c) { return c >= '0' && c <= '9'; })) {
|
|
||||||
const int year = std::stoi(date.substr(0, 4));
|
const int year = std::stoi(date.substr(0, 4));
|
||||||
const int following = (year + 1) % 100;
|
const int following = (year + 1) % 100;
|
||||||
season = std::to_string(year) + "/" + (following < 10 ? "0" : "") +
|
season = std::to_string(year) + "/" + (following < 10 ? "0" : "") + std::to_string(following);
|
||||||
std::to_string(following);
|
|
||||||
}
|
}
|
||||||
const auto owned = [&](const Json *c) {
|
const auto owned = [&](const Json *c) { return c && own.contains(c->value("id", "")); };
|
||||||
return c && own.contains(c->value("id", ""));
|
// what a demo world shows is made up; a career says nothing of the kind
|
||||||
|
const auto note = [&](const std::string &lead, const std::string &demo) {
|
||||||
|
return "<span class=\"es-note\">" + esc(lead + (engine_mode_ || demo.empty() ? std::string() : (lead.empty() ? "" : " · ") + demo)) + "</span>";
|
||||||
};
|
};
|
||||||
const auto heading = [&](const std::string &title,
|
const auto pair = [&](int index, int known, bool big) {
|
||||||
const std::string &subtitle,
|
if (index < 0 || index >= pairs) return std::string();
|
||||||
const std::string &detail) {
|
const auto *home = order[size_t(index * 2)], *away = order[size_t(index * 2 + 1)];
|
||||||
return "<header class=\"opening-heading\"><div><h2><span>" + esc(title) +
|
|
||||||
"</span></h2><p><span>" + esc(subtitle) +
|
|
||||||
"</span></p></div>"
|
|
||||||
"<span class=\"opening-heading-detail\">" +
|
|
||||||
esc(detail) + "</span></header>";
|
|
||||||
};
|
|
||||||
const auto note = [&](const std::string &text) {
|
|
||||||
if(engine_mode_)return std::string();
|
|
||||||
return "<span class=\"opening-demo-note\">" + esc(text) + "</span>";
|
|
||||||
};
|
|
||||||
const auto pair = [&](int index, int known, int logo_size,
|
|
||||||
const std::string &extra) {
|
|
||||||
if (index < 0 || index >= pairs)
|
|
||||||
return std::string();
|
|
||||||
const auto *home = order[size_t(index * 2)],
|
|
||||||
*away = order[size_t(index * 2 + 1)];
|
|
||||||
const auto side = [&](const Json *c, bool home_side, bool visible) {
|
const auto side = [&](const Json *c, bool home_side, bool visible) {
|
||||||
const auto name = visible ? world_->name(*c)
|
const auto name = visible ? world_->name(*c) : home_side ? "Heim" : "Noch nicht gezogen";
|
||||||
: home_side ? "Heim"
|
const auto text = "<strong class=\"" + std::string(visible ? "" : "unknown") + "\">" + esc(name) + "</strong>";
|
||||||
: "Noch nicht gezogen";
|
const auto logo = visible ? "<span style=\"display:block;flex:none;\">" + crest(c, u(big ? 44 : 18)) + "</span>" : std::string("<span class=\"es-pair-ph\"></span>");
|
||||||
const auto text = "<span class=\"opening-pair-name " +
|
return "<span class=\"es-pair-s " + std::string(home_side ? "home" : "away") + "\">" + (home_side ? text + logo : logo + text) + "</span>";
|
||||||
std::string(visible ? "" : "opening-unknown") +
|
|
||||||
"\" title=\"" + esc(name) + "\"><span>" + esc(name) +
|
|
||||||
"</span></span>";
|
|
||||||
const auto logo = visible ? "<span class=\"opening-pair-crest\">" +
|
|
||||||
crest(c, logo_size) + "</span>"
|
|
||||||
: "";
|
|
||||||
return "<span class=\"opening-pair-side " +
|
|
||||||
std::string(home_side ? "home" : "away") + "\">" +
|
|
||||||
(home_side ? text + logo : logo + text) + "</span>";
|
|
||||||
};
|
};
|
||||||
return "<div class=\"opening-pair-row " + extra +
|
return "<div class=\"es-pair" + std::string(big ? " big" : "") + ((known > 0 && owned(home)) || (known > 1 && owned(away)) ? " own" : "") + "\" data-index=\"" + std::to_string(index) + "\" data-home=\"" + esc(home->value("id", "")) +
|
||||||
(owned(home) || owned(away) ? " own-pair" : "") +
|
"\" data-away=\"" + esc(away->value("id", "")) + "\"><span class=\"es-pair-n\">" + std::to_string(index + 1) + ".</span>" + side(home, true, known > 0) + "<span class=\"es-pair-v\">–</span>" + side(away, false, known > 1) + "</div>";
|
||||||
"\" data-index=\"" + std::to_string(index) + "\" data-home=\"" +
|
|
||||||
esc(home->value("id", "")) + "\" data-away=\"" +
|
|
||||||
esc(away->value("id", "")) +
|
|
||||||
"\">"
|
|
||||||
"<span class=\"opening-pair-number\"><span>" +
|
|
||||||
std::to_string(index + 1) + "</span></span>" +
|
|
||||||
side(home, true, known > 0) +
|
|
||||||
"<span class=\"opening-pair-versus\"><span>–</span></span>" +
|
|
||||||
side(away, false, known > 1) +
|
|
||||||
"<span class=\"opening-pair-counter\" "
|
|
||||||
"aria-hidden=\"true\"></span></div>";
|
|
||||||
};
|
};
|
||||||
const bool entrants_page =
|
if (phase == "uefa" || phase == "champions" || phase == "winners") {
|
||||||
phase == "uefa" || phase == "champions" || phase == "winners";
|
|
||||||
std::string body, titlebar;
|
|
||||||
if (entrants_page) {
|
|
||||||
const int page = phase == "uefa" ? 0 : phase == "champions" ? 1 : 2;
|
const int page = phase == "uefa" ? 0 : phase == "champions" ? 1 : 2;
|
||||||
const std::array<const char *, 3> titles = {"UEFA-Cup", "Champions League",
|
const std::array<const char *, 3> titles = {"UEFA-Cup", "Champions League", "Europapokal der Pokalsieger"};
|
||||||
"Europapokal der Pokalsieger"};
|
|
||||||
std::vector<const Json *> entrants;
|
std::vector<const Json *> entrants;
|
||||||
std::set<std::string> entered;
|
std::set<std::string> entered;
|
||||||
const auto &ids = flow.at("entrants").at(phase);
|
for (const auto &id : flow.at("entrants").at(phase)) {
|
||||||
for (const auto &id : ids) {
|
if (!id.is_string()) continue;
|
||||||
if (!id.is_string())
|
|
||||||
continue;
|
|
||||||
const auto key = id.get<std::string>();
|
const auto key = id.get<std::string>();
|
||||||
if (const auto *c = world_->find("clubs", key);
|
if (const auto *c = world_->find("clubs", key); c && entered.insert(key).second) entrants.push_back(c);
|
||||||
c && entered.insert(key).second)
|
|
||||||
entrants.push_back(c);
|
|
||||||
}
|
}
|
||||||
const bool german =
|
const bool german = !entrants.empty() && std::all_of(entrants.begin(), entrants.end(), [](const auto *c) { return c->value("nation", "") == "nation:de"; });
|
||||||
!entrants.empty() &&
|
std::string cards;
|
||||||
std::all_of(entrants.begin(), entrants.end(), [](const auto *c) {
|
if (entrants.empty())
|
||||||
return c->value("nation", "") == "nation:de";
|
cards = "<div class=\"es-box\" style=\"width:" + es(802) + ";padding:" + es(30) + ";text-align:center;\"><span class=\"es-ent-name\">Keine Teilnehmer eingetragen</span><span class=\"es-mut\" style=\"display:block;\">" +
|
||||||
});
|
std::string(engine_mode_ ? "Für diesen Wettbewerb sind derzeit keine deutschen Vereine gemeldet." : "Für diesen Wettbewerb sind in dieser Demo-Welt keine Vereine vorgesehen.") + "</span></div>";
|
||||||
titlebar = german ? "Deutsche Teams" : "Teilnehmende Teams";
|
const bool single = entrants.size() == 1;
|
||||||
body = "<section class=\"opening-layout opening-entrants\" data-phase=\"" +
|
for (const auto *c : entrants)
|
||||||
phase + "\">" +
|
cards += "<article class=\"es-box es-ent-card" + std::string(single ? " one" : "") + (owned(c) ? " own" : "") + "\" data-entrant-club=\"" + esc(c->value("id", "")) + "\"><span style=\"display:block;flex:none;\">" +
|
||||||
heading(titles[size_t(page)], titlebar + " · Saison " + season,
|
crest(c, u(single ? 150 : 72)) + "</span><div class=\"es-grow\"><span class=\"es-ent-name\">" + esc(world_->name(*c)) + "</span>" + (owned(c) ? "<span class=\"es-own\">Dein Verein</span>" : "") + "</div></article>";
|
||||||
std::to_string(page + 1) + " / 3") +
|
return entry_pad("Teilnehmer · " + std::to_string(page + 1) + " / 3", titles[size_t(page)],
|
||||||
"<div class=\"opening-entrant-grid\" id=\"opening-entrants\">";
|
"<span class=\"es-mut\" style=\"display:block;flex:none;margin-top:" + es(-4) + ";\">" + std::string(german ? "Deutsche Teams" : "Teilnehmende Teams") + " · Saison " + season +
|
||||||
if (entrants.empty()) {
|
"</span><div class=\"es-ent\" id=\"opening-entrants\" data-phase=\"" + phase + "\">" + cards + "</div>",
|
||||||
body += "<div class=\"opening-empty-entrants\"><h3><span>Keine "
|
note("", "Fiktive Demo-Qualifikation") + pg_button("opening-next", "Weiter", "primary", "id=\"opening-next\""));
|
||||||
"Teilnehmer eingetragen</span></h3>"
|
}
|
||||||
"<p><span>"+std::string(engine_mode_?"Für diesen Wettbewerb sind derzeit keine deutschen Vereine gemeldet.":"Für diesen Wettbewerb sind in dieser Demo-Welt keine Vereine vorgesehen.")+"</span></p></div>";
|
if (phase == "draw") {
|
||||||
} else {
|
std::string body = "<div class=\"es-draw-art\" data-phase=\"draw\"><div class=\"es-draw-pic\" role=\"img\" aria-label=\"Fiktive Pokal-Auslosung\" style=\"width:" + es(790) + ";height:" + es(214) + ";\">" +
|
||||||
const bool single = entrants.size() == 1;
|
(gui_.contains("entry.draw") ? img("entry.draw", u(790), u(790) * 724 / 2172, false, false, 1800) : std::string()) + "</div><span id=\"opening-draw-indicator\" class=\"es-draw-dot " +
|
||||||
const auto card = [&](const Json *c) {
|
std::string(playing ? "opening-draw-indicator is-playing" : "is-paused") + "\" aria-hidden=\"true\"></span></div><div id=\"opening-current-pair\" aria-live=\"polite\" aria-atomic=\"true\" style=\"display:block;flex:none;\">";
|
||||||
return "<article class=\"opening-entrant " +
|
|
||||||
std::string(single ? "single-entrant " : "") +
|
|
||||||
(owned(c) ? "own-entrant" : "") + "\" data-entrant-club=\"" +
|
|
||||||
esc(c->value("id", "")) + "\">" +
|
|
||||||
"<div class=\"opening-entrant-crest\">" +
|
|
||||||
crest(c, single ? 620 : 360) +
|
|
||||||
"</div>"
|
|
||||||
"<h3><span>" +
|
|
||||||
esc(world_->name(*c)) + "</span></h3>" +
|
|
||||||
(owned(c) ? "<p><span>Dein Verein</span></p>" : "") +
|
|
||||||
"</article>";
|
|
||||||
};
|
|
||||||
body += "<div class=\"opening-entrant-content " +
|
|
||||||
std::string(single ? "single-entrant-content" : "") + "\">";
|
|
||||||
if (single) {
|
|
||||||
body += card(entrants.front());
|
|
||||||
} else {
|
|
||||||
const size_t rows = std::max(size_t(2), (entrants.size() + 1) / 2);
|
|
||||||
for (size_t row = 0; row < rows; ++row) {
|
|
||||||
body += "<div class=\"opening-entrant-row\">";
|
|
||||||
for (size_t column = 0; column < 2; ++column) {
|
|
||||||
const size_t index = row * 2 + column;
|
|
||||||
body += index < entrants.size()
|
|
||||||
? card(entrants[index])
|
|
||||||
: "<div class=\"opening-entrant-spacer\" "
|
|
||||||
"aria-hidden=\"true\"></div>";
|
|
||||||
}
|
|
||||||
body += "</div>";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
body += "</div>";
|
|
||||||
}
|
|
||||||
body += "</div><nav class=\"opening-actions\">" +
|
|
||||||
note("Fiktive Demo-Qualifikation") +
|
|
||||||
btn("opening-next", "Weiter", {}, "id=\"opening-next\"") +
|
|
||||||
"</nav></section>";
|
|
||||||
} else if (phase == "draw") {
|
|
||||||
titlebar = "DFB-Pokal";
|
|
||||||
body =
|
|
||||||
"<section class=\"opening-layout opening-draw\" data-phase=\"draw\">" +
|
|
||||||
heading("1. Runde", "DFB-Pokal · Saison " + season,
|
|
||||||
std::to_string(revealed) + " / " + std::to_string(total) +
|
|
||||||
" Mannschaften") +
|
|
||||||
"<div class=\"opening-draw-scene " +
|
|
||||||
std::string(playing ? "is-drawing" : "") + "\">";
|
|
||||||
// a data set may carry a newer picture of the draw
|
|
||||||
auto art = renderer_.image("art.cup-draw-v2.png", false, 1800);
|
|
||||||
if (art.token.empty()) art = renderer_.image("art.cup-draw-v1.png", false, 1800);
|
|
||||||
if (!art.token.empty() && art.width > 0 && art.height > 0) {
|
|
||||||
const double ratio = double(art.width) / art.height;
|
|
||||||
const double width = std::min(2608.0, 846.0 * ratio),
|
|
||||||
height = width / ratio;
|
|
||||||
body += "<div class=\"opening-draw-art\" role=\"img\" "
|
|
||||||
"aria-label=\"Fiktive Pokal-Auslosung am Tisch mit Glaskugel, "
|
|
||||||
"Loszieher und Pressefotografen\" style=\"width:" +
|
|
||||||
scalar(width) + "dp;height:" + scalar(height) + "dp;\">" +
|
|
||||||
picture(art, width, height, false) + "</div>";
|
|
||||||
} else {
|
|
||||||
body += "<p class=\"opening-art-missing\"><span>Die Illustration der "
|
|
||||||
"Auslosung ist nicht verfügbar.</span></p>";
|
|
||||||
}
|
|
||||||
body +=
|
|
||||||
"<span id=\"opening-draw-indicator\" class=\"opening-draw-indicator " +
|
|
||||||
std::string(playing ? "is-playing" : "is-paused") +
|
|
||||||
"\" aria-hidden=\"true\"></span></div>"
|
|
||||||
"<div id=\"opening-current-pair\" class=\"opening-current-pair\" "
|
|
||||||
"aria-live=\"polite\" aria-atomic=\"true\">";
|
|
||||||
if (pairs) {
|
if (pairs) {
|
||||||
const int current = std::min(pairs - 1, std::max(0, (revealed - 1) / 2));
|
const int current = std::min(pairs - 1, std::max(0, (revealed - 1) / 2));
|
||||||
const int known = std::clamp(revealed - current * 2, 0, 2);
|
const int known = std::clamp(revealed - current * 2, 0, 2);
|
||||||
body += pair(current, known, 66, "current") +
|
body += pair(current, known, true) + "</div><section style=\"display:block;flex:none;\" aria-label=\"Zuletzt gezogene Paarungen\"><span class=\"es-k\">ZULETZT GEZOGENE PAARUNGEN</span><div class=\"es-recent\">";
|
||||||
"</div><section class=\"opening-recent\" aria-label=\"Zuletzt "
|
// the newest first
|
||||||
"gezogene Paarungen\">";
|
for (int i = current - 1; i >= std::max(0, current - 3); --i) body += pair(i, 2, false);
|
||||||
const int first = std::max(0, current - 3);
|
if (current == 0) body += "<span class=\"es-mut\" style=\"display:block;padding:" + es(3) + " " + es(6) + ";\">Noch keine Paarung vollständig.</span>";
|
||||||
for (int i = first; i < current; ++i)
|
body += "</div></section>";
|
||||||
body += "<div class=\"opening-recent-row\" style=\"top:" +
|
} else
|
||||||
std::to_string((i - first) * 181) + "dp;\">" +
|
body += "<span class=\"es-mut\" style=\"display:block;\">Für diese Welt ist keine vollständige Paarung vorhanden.</span></div>";
|
||||||
pair(i, 2, 42, "recent") + "</div>";
|
return entry_pad("Auslosung · Saison " + season, "DFB-Pokal · 1. Runde", body + "<span class=\"es-grow\"></span>",
|
||||||
body += "</section>";
|
note(revealed >= total ? "Alle Lose sind gezogen." : "Los " + std::to_string(revealed) + " von " + std::to_string(total),
|
||||||
} else {
|
total % 2 ? "Fiktive Demo-Auslosung, 1 Verein ohne Paarung" : "Fiktive Demo-Auslosung") +
|
||||||
body += "<p class=\"opening-no-pairs\"><span>Für diese Welt ist keine "
|
pg_button("opening-play", opening_io_blocked_ ? "Erneut versuchen" : playing ? "Pause" : "Fortsetzen", "",
|
||||||
"vollständige Paarung vorhanden.</span></p></div>";
|
"id=\"opening-play\" aria-pressed=\"" + std::string(playing ? "true" : "false") + "\" " + (revealed >= total ? "disabled=\"disabled\"" : "")) +
|
||||||
}
|
pg_button("opening-all", "Alle Paarungen anzeigen", "primary", "id=\"opening-all\""));
|
||||||
body +=
|
|
||||||
"<nav class=\"opening-actions\">" +
|
|
||||||
note(total % 2
|
|
||||||
? "Fiktive Demo-Auslosung · 1 Verein ohne vollständige Paarung"
|
|
||||||
: "Fiktive Demo-Auslosung") +
|
|
||||||
btn("opening-play",
|
|
||||||
opening_io_blocked_ ? "Erneut versuchen"
|
|
||||||
: playing ? "Pause"
|
|
||||||
: "Fortsetzen",
|
|
||||||
{},
|
|
||||||
"id=\"opening-play\" aria-pressed=\"" +
|
|
||||||
std::string(playing ? "true" : "false") + "\" " +
|
|
||||||
(revealed >= total ? "disabled" : "")) +
|
|
||||||
btn("opening-all", "Alle Paarungen anzeigen", {},
|
|
||||||
"id=\"opening-all\"") +
|
|
||||||
"</nav></section>";
|
|
||||||
} else {
|
|
||||||
titlebar = "DFB-Pokal";
|
|
||||||
body = "<section class=\"opening-layout opening-overview\" data-phase=\"" +
|
|
||||||
esc(phase) + "\">" +
|
|
||||||
heading("DFB-Pokal", "1. Runde · Saison " + season,
|
|
||||||
std::to_string(pairs) +
|
|
||||||
(pairs == 1 ? " Paarung" : " Paarungen")) +
|
|
||||||
"<div id=\"opening-overview\" class=\"opening-pair-columns\">";
|
|
||||||
if (!pairs) {
|
|
||||||
body += "<div class=\"opening-empty-overview\"><p><span>Für diese Welt "
|
|
||||||
"sind keine vollständigen Paarungen vorhanden.</span></p></div>";
|
|
||||||
} else {
|
|
||||||
const int columns = pairs > 1 ? 2 : 1,
|
|
||||||
per_column = (pairs + columns - 1) / columns;
|
|
||||||
for (int column = 0; column < columns; ++column) {
|
|
||||||
const int first = column * per_column,
|
|
||||||
last = std::min(pairs, first + per_column);
|
|
||||||
body += "<section class=\"opening-overview-column " +
|
|
||||||
std::string(columns == 1 ? "single-column" : "") +
|
|
||||||
"\" aria-label=\"Paarungen " + std::to_string(first + 1) +
|
|
||||||
" bis " + std::to_string(last) +
|
|
||||||
"\" style=\"left:" + std::to_string(column * 1323) +
|
|
||||||
"dp;\"><div class=\"opening-overview-list\">";
|
|
||||||
for (int i = first; i < last; ++i)
|
|
||||||
body += "<div class=\"opening-overview-row\">" +
|
|
||||||
pair(i, 2, 36, "compact") + "</div>";
|
|
||||||
body += "</div></section>";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
body += "</div><nav class=\"opening-actions\">" +
|
|
||||||
note(total % 2 ? "Fiktive Demo-Auslosung · ohne Paarung: " +
|
|
||||||
world_->name(*order.back())
|
|
||||||
: "Fiktive Demo-Auslosung") +
|
|
||||||
btn("opening-finish", "Weiter zum Desktop", "primary",
|
|
||||||
"id=\"opening-finish\"") +
|
|
||||||
"</nav></section>";
|
|
||||||
}
|
}
|
||||||
return window(titlebar, body, false);
|
std::string body = "<div id=\"opening-overview\" class=\"es-cols\" data-phase=\"" + esc(phase) + "\">";
|
||||||
|
if (!pairs)
|
||||||
|
body += "<span class=\"es-mut\" style=\"display:block;\">Für diese Welt sind keine vollständigen Paarungen vorhanden.</span>";
|
||||||
|
else {
|
||||||
|
const int columns = pairs > 1 ? 2 : 1, per_column = (pairs + columns - 1) / columns;
|
||||||
|
for (int column = 0; column < columns; ++column) {
|
||||||
|
const int first = column * per_column, last = std::min(pairs, first + per_column);
|
||||||
|
body += "<div aria-label=\"Paarungen " + std::to_string(first + 1) + " bis " + std::to_string(last) + "\">";
|
||||||
|
for (int i = first; i < last; ++i) body += pair(i, 2, false);
|
||||||
|
body += "</div>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return entry_pad("Übersicht · " + std::to_string(pairs) + (pairs == 1 ? " Paarung" : " Paarungen"), "DFB-Pokal · 1. Runde", body + "</div>",
|
||||||
|
note("Saison " + season, total % 2 ? "ohne Paarung: " + world_->name(*order.back()) : "Fiktive Demo-Auslosung") +
|
||||||
|
pg_button("opening-finish", "Weiter zum Notizbuch", "primary", "id=\"opening-finish\""));
|
||||||
}
|
}
|
||||||
+133
-370
@@ -6,428 +6,191 @@
|
|||||||
// manager_success_; existing start_options_, managers_draft_, selections_,
|
// manager_success_; existing start_options_, managers_draft_, selections_,
|
||||||
// country_, league_, selected_club_, manager_index_, manager_picker_,
|
// country_, league_, selected_club_, manager_index_, manager_picker_,
|
||||||
// adding_manager_ remain the draft contract.
|
// adding_manager_ remain the draft contract.
|
||||||
|
// Both screens are written on the pad of the entry (front_screens.inc); lengths are the
|
||||||
|
// entry's design units.
|
||||||
std::string App::render_newgame() {
|
std::string App::render_newgame() {
|
||||||
start_options_["mode"] = 3;
|
start_options_["mode"] = 3;
|
||||||
const std::array<const char *, 3> keys = {"duration", "difficulty",
|
const auto u = [](double units) { return units * kEntryUnit; };
|
||||||
"players"},
|
const std::array<const char *, 3> keys = {"duration", "difficulty", "players"}, names = {"Spieldauer", "Schwierigkeit", "Mitspieler"};
|
||||||
names = {"Spieldauer", "Schwierigkeit",
|
const std::array<int, 3> limits = {5, 10, start_options_.value("league", true) ? 4 : 1};
|
||||||
"Mitspieler"};
|
const int players = start_options_.value("players", 1);
|
||||||
const std::array<int, 3> limits = {
|
std::string left;
|
||||||
5, 10, start_options_.value("league", true) ? 4 : 1};
|
|
||||||
std::string body =
|
|
||||||
"<section class=\"entry-setup entry-career-setup\"><header "
|
|
||||||
"class=\"entry-setup-heading\"><h2>Grundeinstellungen</h2><p>Deine "
|
|
||||||
"Karriere · alle Funktionen</p></header>";
|
|
||||||
for (size_t i = 0; i < keys.size(); ++i) {
|
for (size_t i = 0; i < keys.size(); ++i) {
|
||||||
const std::string key = keys[i];
|
const std::string key = keys[i];
|
||||||
const int value = start_options_.value(key, 1);
|
const int value = start_options_.value(key, 1);
|
||||||
std::string visual, caption;
|
std::string visual, caption;
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
visual = "<strong class=\"entry-setup-duration\">" +
|
visual = "<strong class=\"es-num" + std::string(value == 5 ? " inf" : "") + "\">" + std::string(value == 5 ? "∞" : std::to_string(value)) + "</strong>";
|
||||||
std::string(value == 5 ? "∞" : std::to_string(value)) +
|
|
||||||
"</strong>";
|
|
||||||
caption = value == 5 ? "Unbegrenzt" : value == 1 ? "Saison" : "Saisons";
|
caption = value == 5 ? "Unbegrenzt" : value == 1 ? "Saison" : "Saisons";
|
||||||
} else if (i == 1) {
|
} else if (i == 1) {
|
||||||
const int columns = std::min(5, value);
|
visual = "<div class=\"es-balls\">";
|
||||||
visual = "<div class=\"entry-setup-balls\" style=\"width:" +
|
|
||||||
std::to_string(columns * 68 - 6) + "dp;\">";
|
|
||||||
for (int j = 0; j < value; ++j)
|
for (int j = 0; j < value; ++j)
|
||||||
visual +=
|
visual += "<span class=\"es-ball\">" +
|
||||||
"<div style=\"position:absolute;" +
|
picture(renderer_.diagram("entry-ball",
|
||||||
rect((j % columns) * 68, (j / columns) * 68 + (value <= 5 ? 35 : 0),
|
"<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 30 30\"><circle cx=\"15\" cy=\"15\" r=\"13\" fill=\"#fffdf6\" stroke=\"#2a211a\" stroke-width=\"2\"/>"
|
||||||
62, 62) +
|
"<path d=\"M15 9l6 4.5-2.3 7h-7.4L9 13.5z\" fill=\"#2a211a\"/></svg>",
|
||||||
"\">" +
|
128),
|
||||||
picture(renderer_.diagram(
|
u(38), u(38)) +
|
||||||
"setup-ball",
|
"</span>";
|
||||||
"<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 "
|
|
||||||
"0 48 48\"><circle cx=\"24\" cy=\"24\" r=\"21\" "
|
|
||||||
"fill=\"#e0e8e6\" stroke=\"#526771\" "
|
|
||||||
"stroke-width=\"2.6\"/><path d=\"m24 14 10 7-4 "
|
|
||||||
"12H18l-4-12ZM24 3v11M4 18l10 3M11 41l7-8M37 "
|
|
||||||
"41l-7-8M44 18l-10 3\" fill=\"#445966\" "
|
|
||||||
"stroke=\"#526771\" stroke-width=\"2.6\"/></svg>",
|
|
||||||
128),
|
|
||||||
62, 62) +
|
|
||||||
"</div>";
|
|
||||||
visual += "</div>";
|
visual += "</div>";
|
||||||
caption = "Spielstärke " + std::to_string(value) + " von 10";
|
caption = "Spielstärke " + std::to_string(value) + " von 10";
|
||||||
} else {
|
} else {
|
||||||
visual = "<div class=\"entry-setup-people\">";
|
// as many faces as managers will sit at this machine
|
||||||
|
visual = "<div class=\"es-faces\">";
|
||||||
for (int j = 0; j < value; ++j)
|
for (int j = 0; j < value; ++j)
|
||||||
visual += picture(
|
visual += "<span class=\"es-face-dot" + std::string(value > 3 && j ? " near" : "") + "\">" + img("manager-painted." + std::to_string(j), u(62), u(62) * 4 / 3, false, true, 350) + "</span>";
|
||||||
renderer_.diagram(
|
|
||||||
"setup-person",
|
|
||||||
"<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 48 "
|
|
||||||
"64\"><circle cx=\"24\" cy=\"12\" r=\"9\" fill=\"#9fcbbf\" "
|
|
||||||
"stroke=\"#a9d8ca\" stroke-width=\"4\"/><path d=\"M8 "
|
|
||||||
"58V39c0-10 6-15 16-15s16 5 16 15v19M16 58V39M32 58V39\" "
|
|
||||||
"fill=\"none\" stroke=\"#a9d8ca\" stroke-width=\"4\" "
|
|
||||||
"stroke-linecap=\"round\"/></svg>",
|
|
||||||
192),
|
|
||||||
60, 112);
|
|
||||||
visual += "</div>";
|
visual += "</div>";
|
||||||
caption = std::to_string(value) + " Mitspieler";
|
caption = value == 1 ? "Einzelspiel" : std::to_string(value) + " Manager an einem Rechner";
|
||||||
}
|
}
|
||||||
body += "<section class=\"entry-setup-option\" style=\"" +
|
left += "<section class=\"es-box es-opt\"><span class=\"es-k es-opt-k\" id=\"setup-label-" + key + "\">" + pg_upper(names[i]) + "</span>" +
|
||||||
rect(0, 104 + i * (530.6667 + 22), 760, 530.6667) +
|
btn("setup-step", "<span>−</span>", "es-step", "id=\"setup-" + key + "-minus\" data-id=\"" + key + "\" data-step=\"-1\" aria-label=\"" + names[i] + " verringern\" " + (value == 1 ? "disabled=\"disabled\"" : "")) +
|
||||||
"\"><h2 id=\"setup-label-" + key + "\">" + names[i] +
|
"<div id=\"setup-value-" + key + "\" class=\"es-opt-v\" aria-live=\"polite\">" + visual + "<span class=\"es-cap\">" + caption + "</span></div>" +
|
||||||
"</h2><div class=\"entry-setup-stepper\">";
|
btn("setup-step", "<span>+</span>", "es-step", "id=\"setup-" + key + "-plus\" data-id=\"" + key + "\" data-step=\"1\" aria-label=\"" + names[i] + " erhöhen\" " + (value == limits[i] ? "disabled=\"disabled\"" : "")) + "</section>";
|
||||||
body += btn("setup-step", "−", "entry-setup-minus",
|
|
||||||
"id=\"setup-" + key + "-minus\" data-id=\"" + key +
|
|
||||||
"\" data-step=\"-1\" aria-label=\"" + names[i] +
|
|
||||||
" verringern\" " + (value == 1 ? "disabled" : ""));
|
|
||||||
body += "<div id=\"setup-value-" + key +
|
|
||||||
"\" class=\"entry-setup-value\" aria-live=\"polite\">" + visual +
|
|
||||||
"<span>" + caption + "</span></div>";
|
|
||||||
body += btn("setup-step", "+", "entry-setup-plus",
|
|
||||||
"id=\"setup-" + key + "-plus\" data-id=\"" + key +
|
|
||||||
"\" data-step=\"1\" aria-label=\"" + names[i] +
|
|
||||||
" erhöhen\" " + (value == limits[i] ? "disabled" : "")) +
|
|
||||||
"</div></section>";
|
|
||||||
}
|
}
|
||||||
body +=
|
std::string cards;
|
||||||
"<section class=\"entry-setup-competitions\" aria-label=\"Wettbewerbe\">";
|
|
||||||
for (const auto *key : {"league", "world"}) {
|
for (const auto *key : {"league", "world"}) {
|
||||||
const bool league = std::string(key) == "league",
|
const bool league = std::string(key) == "league", active = start_options_.value(key, true),
|
||||||
active = start_options_.value(key, true),
|
locked = league ? active && (players > 1 || !start_options_.value("world", true)) : !start_options_.value("league", true);
|
||||||
locked =
|
cards += btn("setup-competition",
|
||||||
league ? active && (start_options_.value("players", 1) > 1 ||
|
"<span class=\"es-mode-art\">" + img(league ? "entry.club" : "entry.international", u(179), u(346), false, true, 1200) + "</span><strong>" +
|
||||||
!start_options_.value("world", true))
|
std::string(league ? "Vereinsfußball" : "International · WM / EM") + "</strong><span class=\"es-check\">" + (active ? glyph("check", u(17)) : std::string()) + "</span>",
|
||||||
: !start_options_.value("league", true);
|
std::string("es-mode ") + (league ? "a" : "b") + (active ? " on" : " off"),
|
||||||
body += btn(
|
"id=\"setup-competition-" + std::string(key) + "\" data-id=\"" + key + "\" aria-pressed=\"" + (active ? "true" : "false") + "\" aria-label=\"" +
|
||||||
"setup-competition",
|
(league ? "Vereinsfußball" : "International, WM und EM") + (active ? ", aktiv" : ", abgewählt") + "\" " + (locked ? "disabled=\"disabled\"" : ""));
|
||||||
img(league ? "career.club" : "career.international", 904, 1580, false,
|
|
||||||
false, 1600) +
|
|
||||||
"<span class=\"entry-career-caption\"><strong>" +
|
|
||||||
std::string(league ? "Vereinsfußball" : "International · WM / EM") +
|
|
||||||
"</strong><small>" + (active ? "Aktiv" : "Auswählen") +
|
|
||||||
"</small></span><span class=\"entry-career-check\">" +
|
|
||||||
(active ? glyph("check", 38) : "<span>○</span>") + "</span>",
|
|
||||||
std::string("entry-setup-competition ") + (active ? "selected" : ""),
|
|
||||||
"id=\"setup-competition-" + std::string(key) + "\" data-id=\"" + key +
|
|
||||||
"\" aria-pressed=\"" + (active ? "true" : "false") + "\" " +
|
|
||||||
(locked ? "disabled" : ""));
|
|
||||||
}
|
}
|
||||||
body += "<p role=\"status\">" +
|
const std::string hint = std::string(players > 1 ? "Bei mehreren Mitspielern bleibt der Vereinsfußball an. "
|
||||||
std::string(
|
: !start_options_.value("league", true) ? "Nationalmannschaft · ein Mitspieler · Deutschland. "
|
||||||
start_options_.value("players", 1) > 1
|
: "Ein Bild anklicken, um den Wettbewerb ab- oder anzuwählen; einer bleibt immer an. ") +
|
||||||
? "Bei mehreren Mitspielern bleibt der Vereinsfußball aktiv."
|
"Nationaltrainer nur allein und nur für Deutschland.";
|
||||||
: !start_options_.value("league", true)
|
return entry_pad("Neues Spiel", "Grundeinstellungen",
|
||||||
? "Nationalmannschaft · ein Mitspieler · Deutschland"
|
"<div class=\"es-fill\" style=\"align-items:stretch;gap:" + es(20) + ";\"><div class=\"es-col\" style=\"width:" + es(372) + ";flex:none;gap:" + es(9) + ";\">" + left +
|
||||||
: "Mindestens ein Wettbewerb bleibt aktiv.") +
|
"</div><div class=\"es-col es-grow\" style=\"display:flex;gap:" + es(8) + ";\"><section class=\"es-fill\" aria-label=\"Wettbewerbe\" style=\"gap:" + es(16) + ";padding:" + es(4) + ";\">" + cards +
|
||||||
"</p></section><footer class=\"entry-setup-actions\"><p>Dauer, "
|
"</section><span class=\"es-mut\" role=\"status\" style=\"display:block;flex:none;height:" + es(32) + ";padding-right:" + es(66) + ";font-size:" + es(11.5) + ";line-height:" + es(15) + ";\">" + hint + "</span></div></div>",
|
||||||
"Schwierigkeit und Mitspielerzahl gelten für deine neue "
|
pg_button("close", "Abbrechen") + pg_button("setup-next", "Weiter", "primary", "id=\"setup-next\""));
|
||||||
"Partie.</p><div>" +
|
|
||||||
btn("close", "Abbrechen") +
|
|
||||||
btn("setup-next", "Weiter", "primary", "id=\"setup-next\"") +
|
|
||||||
"</div></footer></section>";
|
|
||||||
return window("Neues Spiel", body);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string App::render_manager() {
|
std::string App::render_manager() {
|
||||||
const auto catalog = entry_world();
|
const auto catalog = entry_world();
|
||||||
if (!catalog)
|
if (!catalog)
|
||||||
return window("Neuer Spieler",
|
return entry_pad("Neues Spiel", "Neuer Spieler", "<div class=\"es-fill\"><span>Bitte zuerst eine Modern-Mod aktivieren.</span></div>", pg_button("close", "Zurück"));
|
||||||
"<p>Bitte zuerst eine Modern-Mod aktivieren.</p>");
|
const auto u = [](double units) { return units * kEntryUnit; };
|
||||||
const bool national = career_national_entry();
|
const bool national = career_national_entry();
|
||||||
if(engine_creation_busy_||(engine_mode_&&engine_busy_))return window(adding_manager_?"Neuer Spieler":"Neues Spiel","<div class=\"fill center\"><h2>"+std::string(adding_manager_?"Mitspieler wird hinzugefügt …":"Die Partie wird vorbereitet …")+"</h2></div>",false);
|
if (engine_creation_busy_ || (engine_mode_ && engine_busy_))
|
||||||
|
return entry_pad(adding_manager_ ? "Neuer Spieler" : "Neues Spiel", adding_manager_ ? "Mitspieler wird hinzugefügt …" : "Die Partie wird vorbereitet …",
|
||||||
|
"<div class=\"es-fill\" style=\"align-items:center;justify-content:center;\"><span class=\"es-mut\">Einen Augenblick.</span></div>", "");
|
||||||
const bool full = entry_full(), modal = manager_confirm_ || manager_success_;
|
const bool full = entry_full(), modal = manager_confirm_ || manager_success_;
|
||||||
const int limit =
|
const int limit = adding_manager_ ? (national ? 1 : 4) : start_options_.value("players", 1);
|
||||||
adding_manager_ ? (national ? 1 : 4) : start_options_.value("players", 1);
|
const int portrait = selections_["portrait"].empty() ? 0 : std::stoi(selections_["portrait"]);
|
||||||
const int portrait =
|
const std::array<const char *, 3> strengths = {"Unteres Drittel", "Mittelfeld", "Oberes Drittel"};
|
||||||
selections_["portrait"].empty() ? 0 : std::stoi(selections_["portrait"]);
|
const int strength = std::clamp(selections_["manager-strength"].empty() ? 1 : std::stoi(selections_["manager-strength"]), 0, 2);
|
||||||
const std::string style =
|
const std::string off = "disabled=\"disabled\"";
|
||||||
selections_["portrait-style"] == "painted" ? "painted" : "photo";
|
// one style of portrait: the painted one
|
||||||
const std::array<const char *, 3> strengths = {
|
const auto face = [&](int index, double width, const std::string &extra = "") {
|
||||||
"Unteres Drittel", "Mittelfeld", "Oberes Drittel"};
|
return "<span class=\"es-face " + extra + "\" role=\"img\" aria-label=\"Fiktives Managerporträt " + std::to_string(index + 1) + "\">" +
|
||||||
const int strength =
|
img("manager-painted." + std::to_string(index), u(width), u(width) * 4.0 / 3.0, false, true, 350) + "</span>";
|
||||||
std::clamp(selections_["manager-strength"].empty()
|
|
||||||
? 1
|
|
||||||
: std::stoi(selections_["manager-strength"]),
|
|
||||||
0, 2);
|
|
||||||
const auto face = [&](int index, const std::string &variant, int width,
|
|
||||||
const std::string &extra = "") {
|
|
||||||
return "<div class=\"entry-manager-face " + extra +
|
|
||||||
"\" role=\"img\" aria-label=\"Fiktives Managerporträt " +
|
|
||||||
std::to_string(index + 1) +
|
|
||||||
(variant == "painted" ? ", Illustration" : ", Foto") + "\">" +
|
|
||||||
img(std::string(variant == "painted" ? "manager-painted."
|
|
||||||
: "manager.") +
|
|
||||||
std::to_string(index),
|
|
||||||
width, width * 4.0 / 3.0, false, true, 350) +
|
|
||||||
"</div>";
|
|
||||||
};
|
|
||||||
const auto club_name = [&](const Json *c) {
|
|
||||||
return national ? std::string("Deutschland")
|
|
||||||
: c ? catalog->name(*c)
|
|
||||||
: std::string("Kein spielbarer Verein");
|
|
||||||
};
|
};
|
||||||
|
const auto club_name = [&](const Json *c) { return national ? std::string("Deutschland") : c ? catalog->name(*c) : std::string("Kein spielbarer Verein"); };
|
||||||
const auto league_name = [&](const Json *c) {
|
const auto league_name = [&](const Json *c) {
|
||||||
if (national)
|
if (national) return std::string("Nationalmannschaft");
|
||||||
return std::string("Nationalmannschaft");
|
const auto *l = c ? catalog->find("competitions", entry_club_league(c->value("id", ""))) : nullptr;
|
||||||
const auto *l =
|
|
||||||
c ? catalog->find("competitions", entry_club_league(c->value("id", "")))
|
|
||||||
: nullptr;
|
|
||||||
return l ? catalog->name(*l) : std::string();
|
return l ? catalog->name(*l) : std::string();
|
||||||
};
|
};
|
||||||
std::vector<std::pair<std::string, std::string>> countries, choices;
|
std::vector<std::pair<std::string, std::string>> countries, choices;
|
||||||
std::set<std::string> seen;
|
std::set<std::string> seen;
|
||||||
for (const auto *l : catalog->leagues()) {
|
for (const auto *l : catalog->leagues()) {
|
||||||
const auto id = l->value("nation", "");
|
const auto id = l->value("nation", "");
|
||||||
if (seen.insert(id).second)
|
if (seen.insert(id).second) countries.emplace_back(id, catalog->nation_name(id));
|
||||||
countries.emplace_back(id, catalog->nation_name(id));
|
|
||||||
}
|
}
|
||||||
const auto leagues = catalog->leagues(country_);
|
for (const auto *l : catalog->leagues(country_)) choices.emplace_back(l->value("id", ""), catalog->name(*l));
|
||||||
for (const auto *l : leagues)
|
const auto choose = [&](const std::string &id, const std::vector<std::pair<std::string, std::string>> &rows, const std::string &value, const std::string &css = "") {
|
||||||
choices.emplace_back(l->value("id", ""), catalog->name(*l));
|
auto out = select(id, rows, value, id);
|
||||||
const auto choose =
|
out.insert(out.find('>'), " data-select-style=\"league\"" + (css.empty() ? std::string() : " class=\"" + css + "\"") + (full ? " disabled" : ""));
|
||||||
[&](const std::string &id,
|
return out;
|
||||||
const std::vector<std::pair<std::string, std::string>> &rows,
|
};
|
||||||
const std::string &value) {
|
|
||||||
auto out = select(id, rows, value, id);
|
|
||||||
out.insert(out.find('>'), " data-select-style=\"league\"");
|
|
||||||
if (full)
|
|
||||||
out.insert(out.find('>'), " disabled");
|
|
||||||
return out;
|
|
||||||
};
|
|
||||||
const auto *selected = catalog->find("clubs", selected_club_);
|
const auto *selected = catalog->find("clubs", selected_club_);
|
||||||
std::string content;
|
std::string sheet;
|
||||||
if (manager_picker_ && !national) {
|
if (manager_picker_ && !national) {
|
||||||
const auto query = settings_search_key(club_search_);
|
const auto query = settings_search_key(club_search_);
|
||||||
std::vector<const Json *> clubs;
|
std::vector<const Json *> clubs;
|
||||||
for (const auto *c : entry_clubs(league_))
|
for (const auto *c : entry_clubs(league_))
|
||||||
if (query.empty() || settings_search_key(catalog->name(*c)).find(query) !=
|
if (query.empty() || settings_search_key(catalog->name(*c)).find(query) != std::string::npos) clubs.push_back(c);
|
||||||
std::string::npos)
|
std::string tiles;
|
||||||
clubs.push_back(c);
|
|
||||||
content =
|
|
||||||
"<section class=\"entry-club-picker\"><header><div><h2>Verein "
|
|
||||||
"auswählen</h2><p>Wähle ein Wappen für deinen neuen "
|
|
||||||
"Manager.</p></div>" +
|
|
||||||
btn("manager-clubs-back", "Zurück", {}, "id=\"manager-clubs-back\"") +
|
|
||||||
"</header><div class=\"entry-club-filters\"><div>" +
|
|
||||||
choose("manager-country", countries, country_) +
|
|
||||||
choose("manager-league", choices, league_) +
|
|
||||||
"</div><label><input type=\"search\" id=\"manager-club-search\" "
|
|
||||||
"data-input=\"manager-search\" maxlength=\"60\" placeholder=\"Verein "
|
|
||||||
"suchen\" aria-label=\"Verein in dieser Liga suchen\" value=\"" +
|
|
||||||
esc(club_search_) +
|
|
||||||
"\"/></label></div><section class=\"entry-club-results\"><p "
|
|
||||||
"class=\"entry-club-count\" role=\"status\">" +
|
|
||||||
std::to_string(clubs.size()) +
|
|
||||||
(clubs.size() == 1 ? " Verein" : " Vereine") +
|
|
||||||
"</p><div class=\"entry-club-grid\" id=\"manager-club-grid\">";
|
|
||||||
const int rows = std::max(1, int((clubs.size() + 4) / 5));
|
|
||||||
const double height = std::max(250.0, (1583.0 - (rows - 1) * 20) / rows);
|
|
||||||
content += "<div class=\"entry-club-grid-content\" style=\"height:" +
|
|
||||||
scalar(rows * (height + 20) - 20 + 8) + "dp;\">";
|
|
||||||
for (size_t i = 0; i < clubs.size(); ++i) {
|
for (size_t i = 0; i < clubs.size(); ++i) {
|
||||||
const auto *c = clubs[i];
|
const auto *c = clubs[i];
|
||||||
const auto id = c->value("id", "");
|
const auto id = c->value("id", "");
|
||||||
const bool locked = !entry_manageable(id), used = entry_used_club(id),
|
const bool locked = !entry_manageable(id), used = entry_used_club(id), chosen = id == selected_club_;
|
||||||
chosen = id == selected_club_;
|
const std::string note = locked ? "Nur deutsche Vereine" : used ? "Bereits vergeben" : chosen ? "Ausgewählt" : league_name(c);
|
||||||
const std::string note = locked ? "Nicht spielbar · nur deutsche Vereine"
|
tiles += btn("manager-club", "<span>" + crest(c, u(54)) + "</span><strong>" + esc(club_name(c)) + "</strong><small>" + esc(note) + "</small>", std::string("es-tile") + (chosen && !used && !locked ? " sel" : ""),
|
||||||
: used ? "Bereits vergeben"
|
"id=\"manager-team-" + std::to_string(i) + "\" data-id=\"" + esc(id) + "\" aria-pressed=\"" + (chosen ? "true" : "false") + "\" " + (locked || used || full ? off : ""));
|
||||||
: chosen ? "Ausgewählt"
|
|
||||||
: league_name(c);
|
|
||||||
content +=
|
|
||||||
btn("manager-club",
|
|
||||||
"<div class=\"entry-club-crest\">" + crest(c, 120) +
|
|
||||||
"</div><strong>" + esc(club_name(c)) +
|
|
||||||
"</strong><small class=\"entry-choice-status\">" +
|
|
||||||
(chosen && !used && !locked ? glyph("check", 20) : "") +
|
|
||||||
"<span>" + esc(note) + "</span></small>" +
|
|
||||||
(locked ? "<span class=\"entry-club-lock\">" +
|
|
||||||
glyph("lock", 32) + "</span>"
|
|
||||||
: ""),
|
|
||||||
"entry-club-choice " + std::string(chosen ? "selected" : ""),
|
|
||||||
"id=\"manager-team-" + std::to_string(i) + "\" data-id=\"" +
|
|
||||||
esc(id) + "\" aria-pressed=\"" + (chosen ? "true" : "false") +
|
|
||||||
"\" style=\"position:absolute;" +
|
|
||||||
rect(4 + (i % 5) * 521.2, 4 + (i / 5) * (height + 20), 501.2,
|
|
||||||
height) +
|
|
||||||
"\" " + (locked || used || full ? "disabled" : ""));
|
|
||||||
}
|
}
|
||||||
if (clubs.empty())
|
if (clubs.empty()) tiles = "<span class=\"es-mut\" style=\"display:block;width:100%;padding:" + es(50) + ";text-align:center;\">Kein Verein mit diesem Namen in dieser Liga.</span>";
|
||||||
content += "<p class=\"entry-no-clubs\">Kein Verein mit diesem Namen in "
|
sheet = entry_sheet("Neuer Spieler", "Verein auswählen",
|
||||||
"dieser Liga.</p>";
|
"<div class=\"es-row\" style=\"flex:none;padding-right:" + es(4) + ";\">" + choose("manager-country", countries, country_) + choose("manager-league", choices, league_, "wide") +
|
||||||
content += "</div></div></section></section>";
|
"<input type=\"search\" id=\"manager-club-search\" class=\"es-in\" data-input=\"manager-search\" maxlength=\"60\" placeholder=\"Verein suchen\" aria-label=\"Verein in dieser Liga suchen\" value=\"" + esc(club_search_) +
|
||||||
|
"\" style=\"width:" + es(400) + ";height:" + es(32) + ";font-size:" + es(13.5) + ";line-height:" + es(29) + ";\"/><span class=\"es-grow\"></span><span class=\"es-mut\" role=\"status\" style=\"display:block;flex:none;white-space:nowrap;\">" +
|
||||||
|
std::to_string(clubs.size()) + (clubs.size() == 1 ? " Verein" : " Vereine") + "</span></div><div class=\"es-grid\" id=\"manager-club-grid\"><div class=\"es-grid-in\">" + tiles + "</div></div>",
|
||||||
|
pg_button("manager-clubs-back", "Zurück", "", "id=\"manager-clubs-back\""));
|
||||||
} else {
|
} else {
|
||||||
content =
|
std::string portraits;
|
||||||
"<section class=\"entry-manager-layout " +
|
|
||||||
std::string(adding_manager_ ? "is-add" : "") +
|
|
||||||
"\"><header class=\"entry-manager-step\"><span>" +
|
|
||||||
(full ? std::string(national ? "Nationaltrainer im Spiel"
|
|
||||||
: "Vier Mitspieler im Spiel")
|
|
||||||
: "Mitspieler " + std::to_string(manager_index_ + 1) + " von " +
|
|
||||||
std::to_string(limit)) +
|
|
||||||
"</span><p>Dein Name. Dein Verein. Dein Porträt.</p>" +
|
|
||||||
(adding_manager_ ? btn("manager-newgame", "Neues Spiel", {},
|
|
||||||
"id=\"manager-newgame\"")
|
|
||||||
: "") +
|
|
||||||
"</header><div class=\"entry-manager-fields " +
|
|
||||||
std::string(full ? "is-full " : "") + (national ? "is-national" : "") +
|
|
||||||
"\"><div class=\"entry-manager-identity\"><section "
|
|
||||||
"class=\"entry-manager-person-card\"><div "
|
|
||||||
"class=\"entry-manager-person-copy\"><label "
|
|
||||||
"for=\"manager-name\">Managername</label><input id=\"manager-name\" "
|
|
||||||
"data-input=\"manager-name\" maxlength=\"24\" value=\"" +
|
|
||||||
esc(selections_["manager-name"]) +
|
|
||||||
"\" aria-describedby=\"manager-name-note\" " +
|
|
||||||
(full ? "disabled" : "") +
|
|
||||||
"/><p id=\"manager-name-note\">So wirst du im Spiel "
|
|
||||||
"angesprochen.</p><span class=\"entry-manager-profile-tag\">Porträt " +
|
|
||||||
std::to_string(portrait + 1) + "</span></div>" +
|
|
||||||
face(portrait, style, 174) +
|
|
||||||
"</section><section class=\"entry-manager-club-card\"><h2>" +
|
|
||||||
std::string(national ? "Nationalmannschaft" : "Verein") + "</h2>" +
|
|
||||||
btn("manager-clubs",
|
|
||||||
"<div class=\"entry-manager-club-crest\">" +
|
|
||||||
(national
|
|
||||||
? img("career.national-de", 176, 176, false, false, 512)
|
|
||||||
: crest(selected, 176)) +
|
|
||||||
"</div><span><strong>" + esc(club_name(selected)) +
|
|
||||||
"</strong><small>" +
|
|
||||||
esc(selected
|
|
||||||
? catalog->nation_name(selected->value("nation", ""))
|
|
||||||
: "") +
|
|
||||||
" · " + esc(league_name(selected)) +
|
|
||||||
"</small><em>Verein wählen <span>›</span></em></span>",
|
|
||||||
"entry-manager-club-button",
|
|
||||||
"id=\"manager-clubs\" aria-label=\"Verein wählen: " +
|
|
||||||
esc(club_name(selected)) + "\" " +
|
|
||||||
(full || national ? "disabled" : "")) +
|
|
||||||
"</section></div><div "
|
|
||||||
"class=\"entry-manager-options\"><section><h2>Startliga</h2><div>" +
|
|
||||||
choose("manager-country", countries, country_) +
|
|
||||||
choose("manager-league", choices, league_) +
|
|
||||||
"</div></section><section><h2>Vereinsstärke</h2>" +
|
|
||||||
choose("manager-strength",
|
|
||||||
{{"0", strengths[0]}, {"1", strengths[1]}, {"2", strengths[2]}},
|
|
||||||
std::to_string(strength)) +
|
|
||||||
"</section></div><div class=\"entry-manager-choices\"><section "
|
|
||||||
"class=\"entry-manager-portrait-section\"><header><h2>Managerporträt</"
|
|
||||||
"h2><div class=\"entry-manager-portrait-styles\" role=\"group\" "
|
|
||||||
"aria-label=\"Porträtvariante\">";
|
|
||||||
for (const auto *variant : {"photo", "painted"})
|
|
||||||
content +=
|
|
||||||
btn("portrait-style",
|
|
||||||
std::string(variant) == "photo" ? "Foto" : "Illustration", {},
|
|
||||||
"id=\"manager-style-" + std::string(variant) + "\" data-id=\"" +
|
|
||||||
variant + "\" aria-pressed=\"" +
|
|
||||||
(style == variant ? "true" : "false") + "\" " +
|
|
||||||
(full ? "disabled" : ""));
|
|
||||||
content += "</div></header><div class=\"entry-manager-portraits\" "
|
|
||||||
"role=\"radiogroup\" aria-label=\"Managerporträt\">";
|
|
||||||
const int portrait_height = adding_manager_ ? 482 : 494;
|
|
||||||
for (int i = 0; i < 12; ++i) {
|
for (int i = 0; i < 12; ++i) {
|
||||||
const bool used = entry_used_portrait(i), chosen = i == portrait;
|
const bool used = entry_used_portrait(i), chosen = i == portrait;
|
||||||
content +=
|
portraits += btn("portrait", face(i, 88) + (used ? "<span class=\"es-por-used\">VERGEBEN</span>" : ""), std::string("es-por") + (chosen && !used ? " sel" : ""),
|
||||||
btn("portrait",
|
"id=\"manager-portrait-" + std::to_string(i) + "\" data-id=\"" + std::to_string(i) + "\" role=\"radio\" aria-checked=\"" + (chosen ? "true" : "false") + "\" aria-label=\"Porträt " + std::to_string(i + 1) +
|
||||||
face(i, style, 174) +
|
(used ? ", bereits vergeben" : "") + "\" tabindex=\"" + (chosen ? "0" : "-1") + "\" " + (used || full ? off : ""));
|
||||||
"<span class=\"entry-manager-portrait-caption\">" +
|
|
||||||
(chosen && !used ? glyph("check", 20) : "") + "<span>" +
|
|
||||||
(used ? "Vergeben"
|
|
||||||
: chosen ? "Ausgewählt"
|
|
||||||
: "Porträt " + std::to_string(i + 1)) +
|
|
||||||
"</span></span>",
|
|
||||||
"entry-manager-portrait " + std::string(chosen ? "selected" : ""),
|
|
||||||
"id=\"manager-portrait-" + std::to_string(i) + "\" data-id=\"" +
|
|
||||||
std::to_string(i) + "\" role=\"radio\" aria-checked=\"" +
|
|
||||||
(chosen ? "true" : "false") + "\" aria-label=\"Porträt " +
|
|
||||||
std::to_string(i + 1) + (used ? ", bereits vergeben" : "") +
|
|
||||||
"\" tabindex=\"" + (chosen ? "0" : "-1") +
|
|
||||||
"\" style=\"position:absolute;" +
|
|
||||||
rect((i % 6) * 324, (i / 6) * (portrait_height + 16), 308,
|
|
||||||
portrait_height) +
|
|
||||||
"\" " + (used || full ? "disabled" : ""));
|
|
||||||
}
|
}
|
||||||
content +=
|
std::string roster;
|
||||||
"</div></section><aside class=\"entry-manager-roster\"><header><h2>" +
|
for (int k = 0; k < limit; ++k) {
|
||||||
std::string(adding_manager_ ? "Bereits im Spiel"
|
if (size_t(k) < managers_draft_.size()) {
|
||||||
: "Mitspieler dieser Partie") +
|
const auto &m = managers_draft_[size_t(k)];
|
||||||
"</h2><span>" + std::to_string(managers_draft_.size()) + " / " +
|
const auto *c = catalog->find("clubs", m.value("club", ""));
|
||||||
std::to_string(limit) +
|
roster += "<div class=\"es-seat\">" + face(m.value("portrait", 0), 27, "small") + "<div class=\"es-grow\"><strong>" + esc(m.value("name", "")) + "</strong><span>" + esc(club_name(c)) + "</span></div></div>";
|
||||||
"</span></header><div class=\"entry-manager-roster-list\">";
|
} else
|
||||||
for (size_t i = 0; i < managers_draft_.size(); ++i) {
|
roster += "<div class=\"es-seat\"><span class=\"es-slot\"></span><span>" + std::string(k == manager_index_ && !full ? "wird eingerichtet" : "freier Platz") + "</span></div>";
|
||||||
const auto &m = managers_draft_[i];
|
|
||||||
const auto *c = catalog->find("clubs", m.value("club", ""));
|
|
||||||
content +=
|
|
||||||
"<div class=\"entry-manager-roster-row\">" +
|
|
||||||
face(m.value("portrait", 0), m.value("portrait_style", style), 90) +
|
|
||||||
"<div><small>Spieler " + std::to_string(i + 1) + "</small><strong>" +
|
|
||||||
esc(m.value("name", "")) + "</strong><span>" + esc(club_name(c)) +
|
|
||||||
"</span></div></div>";
|
|
||||||
}
|
}
|
||||||
const int remaining = std::max(0, limit - int(managers_draft_.size()));
|
std::string seg;
|
||||||
content +=
|
for (int k = 0; k < 3; ++k)
|
||||||
"</div><p>" +
|
seg += btn("manager-strength-pick", "<span>" + std::string(strengths[size_t(k)]) + "</span>", std::string(k == strength ? "on" : "") + (k == 0 ? " first" : ""),
|
||||||
(full ? std::string("Alle vier Plätze sind belegt.")
|
"id=\"manager-strength-" + std::to_string(k) + "\" data-id=\"" + std::to_string(k) + "\" aria-pressed=\"" + (k == strength ? "true" : "false") + "\" " + (full ? off : ""));
|
||||||
: std::to_string(remaining) + (remaining == 1
|
const bool foreign = selected && !entry_manageable(selected_club_);
|
||||||
? " weiterer Platz frei"
|
const std::string body =
|
||||||
: " weitere Plätze frei")) +
|
"<div class=\"es-fill\" style=\"align-items:stretch;gap:" + es(12) + ";\"><div class=\"es-col es-grow\" style=\"display:flex;gap:" + es(8) + ";\"><div class=\"es-row\" style=\"flex:none;align-items:stretch;gap:" + es(12) +
|
||||||
"</p></aside></div></div></section><footer "
|
";\"><section class=\"es-box es-row\" style=\"flex:1;\">" + face(portrait, 43.5) + "<div class=\"es-grow\"><label class=\"es-k\" for=\"manager-name\">MANAGERNAME</label><input id=\"manager-name\" class=\"es-in\" data-input=\"manager-name\" maxlength=\"24\" value=\"" +
|
||||||
"class=\"entry-manager-actions\"><p id=\"manager-feedback\" "
|
esc(selections_["manager-name"]) + "\" style=\"margin-top:" + es(3) + ";\" " + (full ? "disabled" : "") + "/></div></section><section class=\"es-box es-row\" style=\"flex:1;\"><span style=\"display:block;flex:none;\">" +
|
||||||
"role=\"status\">" +
|
(national ? img("career.national-de", u(58), u(58), false, false, 512) : crest(selected, u(58))) + "</span><div class=\"es-grow\"><div class=\"es-row\" style=\"justify-content:space-between;\"><span class=\"es-k\">" +
|
||||||
(full ? std::string("Es können höchstens vier Manager mitspielen.")
|
std::string(national ? "NATIONALMANNSCHAFT" : "VEREIN") + "</span>" +
|
||||||
: adding_manager_
|
pg_button("manager-clubs", "Verein wählen ›", "sm", "id=\"manager-clubs\" aria-label=\"Verein wählen: " + esc(club_name(selected)) + "\" style=\"height:" + es(24) + ";padding:0 " + es(10) + ";font-size:" + es(12) + ";\" " +
|
||||||
? "Mitspieler wird erst nach deiner Bestätigung hinzugefügt."
|
(full || national ? off : "")) +
|
||||||
: "Bestätige nacheinander die Mitspieler für deine neue Partie.") +
|
"</div><strong class=\"es-h\" style=\"font-size:" + es(17) + ";line-height:" + es(22) + ";white-space:nowrap;overflow:hidden;text-overflow:ellipsis;\">" + esc(club_name(selected)) +
|
||||||
"</p><div>" +
|
"</strong><span class=\"es-mut\" style=\"display:block;font-size:" + es(12) + ";white-space:nowrap;overflow:hidden;text-overflow:ellipsis;\">" + esc(selected ? catalog->nation_name(selected->value("nation", "")) : "") +
|
||||||
btn("manager-back",
|
(selected || national ? " · " : "") + esc(league_name(selected)) + "</span></div></section></div>" +
|
||||||
full ? "Schließen"
|
(national ? std::string()
|
||||||
: adding_manager_ ? "Abbrechen"
|
: "<div class=\"es-row\" style=\"flex:none;gap:" + es(6) + ";\"><span class=\"es-k\">STARTLIGA</span>" + choose("manager-country", countries, country_, "es-narrow") + choose("manager-league", choices, league_, "es-narrow") +
|
||||||
: "Zurück",
|
"<span class=\"es-grow\"></span><span class=\"es-k\">STÄRKE</span><div class=\"pg-seg es-seg\" role=\"group\" aria-label=\"Vereinsstärke\">" + seg + "</div></div>") +
|
||||||
{}, "id=\"manager-back\"") +
|
"<section class=\"es-box es-col es-grow\" style=\"display:flex;gap:" + es(6) + ";\"><div class=\"es-row\" style=\"flex:none;\"><span class=\"es-k\">MANAGERPORTRÄT</span>" +
|
||||||
btn("manager-next",
|
(foreign ? "<span class=\"es-k es-warn\">· SPIELBAR SIND NUR DEUTSCHE VEREINE</span>" : "") + "</div><div class=\"es-pors\" role=\"radiogroup\" aria-label=\"Managerporträt\">" + portraits +
|
||||||
adding_manager_ ? "Mitspieler hinzufügen"
|
"</div></section></div><aside class=\"es-box es-col\" style=\"width:" + es(160) + ";flex:none;gap:" + es(7) + ";\"><span class=\"es-k\" style=\"white-space:normal;\">" +
|
||||||
: manager_index_ + 1 == limit ? "Spiel starten"
|
std::string(adding_manager_ ? "BEREITS IM SPIEL" : "MITSPIELER DIESER PARTIE") + "</span>" + roster + "</aside></div>";
|
||||||
: "Mitspieler bestätigen",
|
const std::string status = full ? "Es können höchstens vier Manager mitspielen." : adding_manager_ ? "Der Mitspieler kommt erst nach deiner Bestätigung dazu." : "";
|
||||||
"primary",
|
sheet = entry_sheet(full ? std::string(national ? "Nationaltrainer im Spiel" : "Vier Mitspieler im Spiel") : "Mitspieler " + std::to_string(manager_index_ + 1) + " von " + std::to_string(limit), "Neuer Spieler", body,
|
||||||
"id=\"manager-next\" " +
|
"<span class=\"es-note\" id=\"manager-feedback\" role=\"status\">" + status + "</span>" + pg_button("manager-back", full ? "Schließen" : adding_manager_ ? "Abbrechen" : "Zurück", "", "id=\"manager-back\"") +
|
||||||
std::string(full || !entry_name_valid() || !selected ||
|
pg_button("manager-next", adding_manager_ ? "Mitspieler hinzufügen" : manager_index_ + 1 == limit ? "Spiel starten" : "Mitspieler bestätigen", "primary",
|
||||||
!entry_manageable(selected_club_) ||
|
"id=\"manager-next\" " + std::string(full || !entry_name_valid() || !selected || !entry_manageable(selected_club_) || entry_used_club(selected_club_) || entry_used_portrait(portrait) ? off : "")),
|
||||||
entry_used_club(selected_club_) ||
|
adding_manager_ ? "<div class=\"es-row\" style=\"flex:none;margin-right:" + es(60) + ";\">" + pg_button("manager-newgame", "Neues Spiel", "sm", "id=\"manager-newgame\"") + "</div>" : std::string());
|
||||||
entry_used_portrait(portrait)
|
|
||||||
? "disabled"
|
|
||||||
: "")) +
|
|
||||||
"</div></footer>";
|
|
||||||
}
|
}
|
||||||
std::string body =
|
std::string over;
|
||||||
"<div id=\"entry-manager-underlay\" class=\"entry-manager-underlay\" " +
|
|
||||||
std::string(modal ? "aria-hidden=\"true\"" : "") + ">" + content +
|
|
||||||
"</div>";
|
|
||||||
if (manager_confirm_) {
|
if (manager_confirm_) {
|
||||||
body +=
|
over = "<div id=\"entry-confirm-layer\" class=\"es-veil pg-root\"><section class=\"es-dlg\" role=\"dialog\" aria-modal=\"true\" aria-labelledby=\"entry-confirm-title\"><h2 id=\"entry-confirm-title\">Sind alle Angaben richtig?</h2>"
|
||||||
"<div id=\"entry-confirm-layer\" class=\"entry-dialog-layer\"><section "
|
"<div class=\"es-row\" style=\"gap:" + es(14) + ";\">" + face(portrait, 69) + "<span style=\"display:block;flex:none;\">" +
|
||||||
"class=\"entry-dialog entry-confirm-dialog\" role=\"dialog\" "
|
(national ? img("career.national-de", u(76), u(76), false, false, 512) : crest(selected, u(76))) + "</span><div class=\"es-dl\"><div><span>Name</span><strong>" + esc(selections_["manager-name"]) +
|
||||||
"aria-modal=\"true\" aria-labelledby=\"entry-confirm-title\"><h2 "
|
"</strong></div><div><span>Verein</span><strong>" + esc(club_name(selected)) + "</strong></div><div><span>Liga</span><strong>" + esc(league_name(selected)) + "</strong></div>" +
|
||||||
"id=\"entry-confirm-title\">Sind alle Angaben richtig?</h2><div "
|
(national ? std::string() : "<div><span>Stärke</span><strong>" + std::string(strengths[size_t(strength)]) + "</strong></div>") + "</div></div><div class=\"es-dlg-act\">" +
|
||||||
"class=\"entry-confirm-identity\"><div class=\"entry-confirm-crest\">" +
|
pg_button("manager-confirm-no", "Nein", "", "id=\"manager-confirm-no\"") + pg_button("manager-confirm-yes", "Ja", "primary", "id=\"manager-confirm-yes\"") + "</div></section></div>";
|
||||||
(national ? img("career.national-de", 200, 200, false, false, 512)
|
|
||||||
: crest(selected, 200)) +
|
|
||||||
"</div><div class=\"entry-confirm-copy\"><strong>" +
|
|
||||||
esc(selections_["manager-name"]) + "</strong><span>" +
|
|
||||||
esc(club_name(selected)) + "</span><small>" +
|
|
||||||
esc(league_name(selected)) + " · " + strengths[size_t(strength)] +
|
|
||||||
"</small></div>" + face(portrait, style, 150) + "</div><footer>" +
|
|
||||||
btn("manager-confirm-no", "Nein", {}, "id=\"manager-confirm-no\"") +
|
|
||||||
btn("manager-confirm-yes", "Ja", "primary",
|
|
||||||
"id=\"manager-confirm-yes\"") +
|
|
||||||
"</footer></section></div>";
|
|
||||||
} else if (manager_success_) {
|
} else if (manager_success_) {
|
||||||
const auto &last =
|
const auto &last = managers_draft_.empty() ? Json::object() : managers_draft_.back();
|
||||||
managers_draft_.empty() ? Json::object() : managers_draft_.back();
|
|
||||||
const auto *c = catalog->find("clubs", last.value("club", selected_club_));
|
const auto *c = catalog->find("clubs", last.value("club", selected_club_));
|
||||||
body +=
|
over = "<div id=\"entry-success-layer\" class=\"es-veil pg-root\"><section class=\"es-dlg\" role=\"dialog\" aria-modal=\"true\" aria-labelledby=\"entry-success-title\"><h2 id=\"entry-success-title\">Mitspieler hinzugefügt</h2><p>" +
|
||||||
"<div id=\"entry-success-layer\" class=\"entry-dialog-layer\"><section "
|
esc(last.value("name", selections_["manager-name"])) + " übernimmt " + esc(club_name(c)) + ".</p><div class=\"es-dlg-act\">" + pg_button("manager-success-close", "Verstanden", "primary", "id=\"manager-success-close\"") +
|
||||||
"class=\"entry-dialog entry-success-dialog\" role=\"dialog\" "
|
"</div></section></div>";
|
||||||
"aria-modal=\"true\" aria-labelledby=\"entry-success-title\"><h2 "
|
|
||||||
"id=\"entry-success-title\">Mitspieler hinzugefügt</h2><p>" +
|
|
||||||
esc(last.value("name", selections_["manager-name"])) + " übernimmt " +
|
|
||||||
esc(club_name(c)) + ".</p><footer>" +
|
|
||||||
btn("manager-success-close", "Verstanden", {},
|
|
||||||
"id=\"manager-success-close\"") +
|
|
||||||
"</footer></section></div>";
|
|
||||||
}
|
}
|
||||||
return window("Neuer Spieler", body);
|
return entry_stage("<div id=\"entry-manager-underlay\" class=\"es-under\" " + std::string(modal ? "aria-hidden=\"true\"" : "") + ">" + sheet + "</div>", over);
|
||||||
}
|
}
|
||||||
@@ -134,6 +134,7 @@ std::string App::render_files_page(bool save) {
|
|||||||
std::string App::render_files(bool layouts, bool save) {
|
std::string App::render_files(bool layouts, bool save) {
|
||||||
if (files_mode_ != menu_) files_begin(menu_);
|
if (files_mode_ != menu_) files_begin(menu_);
|
||||||
if (!layouts && page_native()) return render_files_page(save);
|
if (!layouts && page_native()) return render_files_page(save);
|
||||||
|
if (!layouts && !save && scene_ == "main") return render_files_pad();
|
||||||
std::string entries;
|
std::string entries;
|
||||||
const auto row = [&](const std::string &action, const std::string &id, const std::string &label, const std::string &subtitle, bool selected, const std::string &identity, bool fresh = false) {
|
const auto row = [&](const std::string &action, const std::string &id, const std::string &label, const std::string &subtitle, bool selected, const std::string &identity, bool fresh = false) {
|
||||||
const auto icon = fresh ? "plus" : id == "standard" ? "grid" : layouts ? "image" : "save";
|
const auto icon = fresh ? "plus" : id == "standard" ? "grid" : layouts ? "image" : "save";
|
||||||
|
|||||||
@@ -153,7 +153,7 @@ void App::front_after_render() {
|
|||||||
if (!front_dialog_.empty()) {
|
if (!front_dialog_.empty()) {
|
||||||
Rml::ElementList behind;
|
Rml::ElementList behind;
|
||||||
doc_->QuerySelectorAll(
|
doc_->QuerySelectorAll(
|
||||||
behind, ".front-mod-content button,.front-mod-window>.titlebar button");
|
behind, ".es-paper button");
|
||||||
for (auto *control : behind) {
|
for (auto *control : behind) {
|
||||||
control->SetAttribute("disabled", true);
|
control->SetAttribute("disabled", true);
|
||||||
control->SetProperty("pointer-events", "none");
|
control->SetProperty("pointer-events", "none");
|
||||||
@@ -394,10 +394,10 @@ bool App::front_event(Rml::Event &event) {
|
|||||||
}
|
}
|
||||||
if (key == Rml::Input::KI_TAB) {
|
if (key == Rml::Input::KI_TAB) {
|
||||||
Rml::ElementList controls;
|
Rml::ElementList controls;
|
||||||
auto *region = scene_ == "main" ? doc_->QuerySelector(".main-options")
|
auto *region = scene_ == "main" ? doc_->QuerySelector(".es-menu")
|
||||||
: !front_dialog_.empty()
|
: !front_dialog_.empty()
|
||||||
? doc_->QuerySelector(".front-dialog")
|
? doc_->QuerySelector(".es-dlg")
|
||||||
: doc_->QuerySelector(".front-mod-window");
|
: doc_->QuerySelector(".es-paper");
|
||||||
if (region)
|
if (region)
|
||||||
region->QuerySelectorAll(controls, "button,input,select");
|
region->QuerySelectorAll(controls, "button,input,select");
|
||||||
std::erase_if(controls, [](auto *node) {
|
std::erase_if(controls, [](auto *node) {
|
||||||
@@ -421,7 +421,7 @@ bool App::front_event(Rml::Event &event) {
|
|||||||
key == Rml::Input::KI_HOME || key == Rml::Input::KI_END)) {
|
key == Rml::Input::KI_HOME || key == Rml::Input::KI_END)) {
|
||||||
if (scene_ == "main") {
|
if (scene_ == "main") {
|
||||||
Rml::ElementList options;
|
Rml::ElementList options;
|
||||||
doc_->QuerySelectorAll(options, ".main-options button");
|
doc_->QuerySelectorAll(options, ".es-menu button");
|
||||||
std::erase_if(options,
|
std::erase_if(options,
|
||||||
[](auto *n) { return n->HasAttribute("disabled"); });
|
[](auto *n) { return n->HasAttribute("disabled"); });
|
||||||
if (!options.empty()) {
|
if (!options.empty()) {
|
||||||
@@ -439,7 +439,7 @@ bool App::front_event(Rml::Event &event) {
|
|||||||
event.StopImmediatePropagation();
|
event.StopImmediatePropagation();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (target->IsClassSet("front-mod-entry")) {
|
if (target->IsClassSet("es-li")) {
|
||||||
size_t index = 0;
|
size_t index = 0;
|
||||||
for (size_t i = 0; i < front_snapshot_.entries.size(); ++i)
|
for (size_t i = 0; i < front_snapshot_.entries.size(); ++i)
|
||||||
if (front_snapshot_.entries[i].id == selected_mod_)
|
if (front_snapshot_.entries[i].id == selected_mod_)
|
||||||
|
|||||||
+106
-194
@@ -18,93 +18,64 @@ std::string App::front_size(uint64_t bytes) const {
|
|||||||
return number(int64_t(tenths / 10)) +
|
return number(int64_t(tenths / 10)) +
|
||||||
(tenths % 10 ? "," + std::to_string(tenths % 10) : "") + " MiB";
|
(tenths % 10 ? "," + std::to_string(tenths % 10) : "") + " MiB";
|
||||||
}
|
}
|
||||||
|
// A length of the entry's design in dp: the table is drawn 1672 units across.
|
||||||
|
std::string App::es(double units) { return scalar(units * kEntryUnit) + "dp"; }
|
||||||
|
// The table with the pad on it; `over` lies above the pad (a note that asks something).
|
||||||
|
std::string App::entry_stage(const std::string &paper, const std::string &over) {
|
||||||
|
return "<div class=\"es-stage\"><div class=\"es-table\">" + (gui_.contains("entry.table") ? img("entry.table", 3840, 2160, false, true, 2048) : std::string()) +
|
||||||
|
"</div><section class=\"es-paper pg-root\">" + paper + "</section>" + over + "</div>";
|
||||||
|
}
|
||||||
|
// What is written on the pad: a small line, the heading, a rule, the body and the buttons at
|
||||||
|
// its foot. `right` stands beside the heading; without it the paper clip keeps its room.
|
||||||
|
std::string App::entry_sheet(const std::string &kicker, const std::string &title, const std::string &body, const std::string &foot, const std::string &right) {
|
||||||
|
return "<header class=\"es-head\"><div class=\"es-grow\"><span class=\"es-k\">" + esc(pg_upper(kicker)) + "</span><h1 class=\"es-h1\">" + esc(title) + "</h1></div>" +
|
||||||
|
(right.empty() ? std::string("<span class=\"es-clip\"></span>") : right) + "</header><div class=\"es-rule\"></div>" + body + (foot.empty() ? std::string() : "<nav class=\"es-foot\">" + foot + "</nav>");
|
||||||
|
}
|
||||||
|
std::string App::entry_pad(const std::string &kicker, const std::string &title, const std::string &body, const std::string &foot, const std::string &right, const std::string &over) {
|
||||||
|
return entry_stage(entry_sheet(kicker, title, body, foot, right), over);
|
||||||
|
}
|
||||||
std::string App::main_menu() {
|
std::string App::main_menu() {
|
||||||
const auto *active = mod(active_mod_);
|
const auto *active = mod(active_mod_);
|
||||||
const bool available = active && active->error.empty();
|
const bool available = active && active->error.empty();
|
||||||
std::string out;
|
std::string rows;
|
||||||
if (gui_.contains("menu.club-office"))
|
|
||||||
out = "<div class=\"front-office-art\">" +
|
|
||||||
img("menu.club-office", 3840, 2160, false, true, 2048) + "</div>";
|
|
||||||
out += "<div class=\"fill front-office-shade\"></div><div class=\"front-home office-home\"><nav class=\"main-options\" aria-label=\"Hauptmenü\">";
|
|
||||||
const std::array<std::pair<const char *, const char *>, 6> actions{
|
const std::array<std::pair<const char *, const char *>, 6> actions{
|
||||||
{{"new", "Neues Spiel"},
|
{{"new", "Neues Spiel"}, {"load", "Spiel laden"}, {"network", "Netzwerk"}, {"mods", "Mod"}, {"settings", "Einstellungen"}, {"exit", "Beenden"}}};
|
||||||
{"load", "Spiel laden"},
|
|
||||||
{"network", "Netzwerk"},
|
|
||||||
{"mods", "Mod"},
|
|
||||||
{"settings", "Einstellungen"},
|
|
||||||
{"exit", "Beenden"}}};
|
|
||||||
for (const auto &[key, title] : actions) {
|
for (const auto &[key, title] : actions) {
|
||||||
const bool network = std::string(key) == "network",
|
const std::string id = key;
|
||||||
disabled = scene_ != "main" || !menu_.empty() || network ||
|
const bool network = id == "network",
|
||||||
(std::string(key) == "new" && !available &&
|
disabled = scene_ != "main" || !menu_.empty() || network || front_quit_ || (id == "new" && !available && !(front_external_override_ && world_));
|
||||||
!(front_external_override_ && world_));
|
rows += btn(key, "<span>" + std::string(title) + "</span>" + (network ? "<span class=\"es-mb-s\">DEMNÄCHST</span>" : "") + "<span class=\"es-grow\"></span><span class=\"es-mb-a\">›</span>",
|
||||||
out += btn(key,
|
std::string("es-mb") + (id == "load" || id == "exit" ? " gap" : ""), "id=\"front-" + id + "\" " + (disabled ? "disabled=\"disabled\"" : ""));
|
||||||
"<span>" + std::string(title) + "</span>" +
|
|
||||||
(network ? "<small>Demnächst</small>" : "") +
|
|
||||||
"<span class=\"front-hover-arrow\">›</span>",
|
|
||||||
"front-menu-action",
|
|
||||||
"id=\"front-" + std::string(key) + "\" " +
|
|
||||||
(disabled ? "disabled" : ""));
|
|
||||||
}
|
}
|
||||||
const auto label = front_external_override_ && world_ ? world_->title()
|
const auto label = front_external_override_ && world_ ? world_->title() : available ? active->name : "Keine Mod aktiviert";
|
||||||
: available ? active->name
|
const std::string ask = front_quit_ ? "<div class=\"es-box es-ask\"><strong>Das Spiel wirklich beenden?</strong><div class=\"es-row\" style=\"justify-content:flex-end;margin-top:" + es(10) + ";\">" +
|
||||||
: "Keine Mod aktiviert";
|
pg_button("front-quit-no", "Abbrechen", "sm", "id=\"front-quit-no\"") + pg_button("front-quit-yes", "Beenden", "primary sm", "id=\"front-quit-yes\"") + "</div></div>"
|
||||||
out +=
|
: std::string();
|
||||||
"</nav><footer class=\"front-footer\"><div class=\"front-active\"><span "
|
return entry_stage("<h1 class=\"es-title\">Dreierpack Manager</h1><div class=\"es-gold\"></div><div class=\"es-fill\" style=\"align-items:stretch;gap:" + es(34) + ";\"><nav class=\"es-menu\" aria-label=\"Hauptmenü\">" + rows +
|
||||||
"class=\"front-active-dot\"></span><div><small>Aktive Mod</small><strong "
|
"</nav><div class=\"es-side\">" + ask + "<span class=\"es-mut\">Aktive Mod</span><strong id=\"front-active-name\">" + esc(label) + "</strong><span class=\"es-mut\" style=\"margin-top:" + es(8) + ";\">Version " +
|
||||||
"id=\"front-active-name\">" +
|
std::string(kOpenBmhVersion) + (config_.preview_only ? " · UI-Demo" : " · Entwicklung") + "</span></div></div>");
|
||||||
esc(label) + "</strong></div></div><small class=\"front-version\">v" +
|
|
||||||
std::string(kOpenBmhVersion) + (config_.preview_only ? " · UI-Demo" : " · Entwicklung") + "</small></footer></div>";
|
|
||||||
return out;
|
|
||||||
}
|
}
|
||||||
std::string App::front_mod_details() {
|
std::string App::front_mod_details() {
|
||||||
const auto *entry = front_selected();
|
const auto *entry = front_selected();
|
||||||
if (!entry)
|
if (!entry)
|
||||||
return "<div class=\"front-mod-empty\"><h2>Noch keine Mods "
|
return "<div class=\"es-box es-detail\" style=\"align-items:center;justify-content:center;text-align:center;\"><h2 class=\"es-h\" style=\"font-size:" + es(21) + ";line-height:" + es(26) +
|
||||||
"installiert</h2><p>Importiere einen Originalordner oder ein "
|
";\">Noch keine Mods installiert</h2><span class=\"es-mut\" style=\"display:block;\">Importiere einen Originalordner oder ein OpenBMH-Paket.</span></div>";
|
||||||
"OpenBMH-Paket.</p></div>";
|
|
||||||
const bool active = entry->active && !front_external_override_;
|
const bool active = entry->active && !front_external_override_;
|
||||||
const auto provenance = entry->description.empty() ? front_source_name(*entry)
|
const auto provenance = entry->description.empty() ? front_source_name(*entry) : entry->description;
|
||||||
: entry->description;
|
std::string out = "<div class=\"es-box es-detail\"><span class=\"es-k\">" + esc(pg_upper(active ? "Aktiv" : entry->valid() ? "Installiert" : "Fehlerhaft")) + "</span><h2 class=\"es-h\" style=\"font-size:" + es(21) + ";line-height:" + es(26) +
|
||||||
std::string out =
|
";\">" + esc(entry->name) + "</h2><span class=\"es-mut\" style=\"display:block;\">" + esc(provenance) + "</span><div>";
|
||||||
"<div class=\"front-mod-details\"><div class=\"front-mod-cover\">" +
|
|
||||||
img("background", 1360, 360, false, true, 1600) +
|
|
||||||
"<span>Open<span>BMH</span></span></div><header><div><p>" +
|
|
||||||
esc(provenance) + "</p><h2>" + esc(entry->name) +
|
|
||||||
"</h2></div><span class=\"front-mod-status " +
|
|
||||||
(active ? "is-active" : "") + "\">" +
|
|
||||||
(active ? "Aktiv"
|
|
||||||
: entry->valid() ? "Installiert"
|
|
||||||
: "Fehlerhaft") +
|
|
||||||
"</span></header><div class=\"front-mod-metadata\">";
|
|
||||||
const std::vector<std::pair<std::string, std::string>> fields = {
|
const std::vector<std::pair<std::string, std::string>> fields = {
|
||||||
{"Art", entry->type},
|
{"Art", entry->type},
|
||||||
{"Herkunft", front_source_name(*entry)},
|
{"Herkunft", front_source_name(*entry)},
|
||||||
{"Version", entry->version},
|
{"Version", entry->version},
|
||||||
{"Inhalt", std::to_string(entry->file_count) +
|
{"Inhalt", std::to_string(entry->file_count) + (entry->file_count == 1 ? " Datei" : " Dateien") + " · " + front_size(entry->bytes)}};
|
||||||
(entry->file_count == 1 ? " Datei" : " Dateien") + " · " +
|
for (const auto &[label, value] : fields) out += "<div class=\"es-kv\"><span>" + esc(label) + "</span><strong>" + esc(value) + "</strong></div>";
|
||||||
front_size(entry->bytes)}};
|
|
||||||
for (const auto &[label, value] : fields)
|
|
||||||
out += "<div><span>" + esc(label) + "</span><strong>" + esc(value) +
|
|
||||||
"</strong></div>";
|
|
||||||
out += "</div>";
|
out += "</div>";
|
||||||
if (!entry->valid())
|
if (!entry->valid()) out += "<span class=\"es-error\">" + esc(entry->error) + "</span>";
|
||||||
out += "<p class=\"front-mod-error\">" + esc(entry->error) + "</p>";
|
|
||||||
const auto *current = mod(active_mod_);
|
const auto *current = mod(active_mod_);
|
||||||
out +=
|
out += "<span class=\"es-grow\"></span><span class=\"es-mut\" style=\"display:block;font-size:" + es(12) + ";\">" +
|
||||||
"<p class=\"front-mod-activation-note\">" +
|
esc(active ? "Diese Mod ist für das nächste Spiel ausgewählt." : current ? "Aktivieren ersetzt die Auswahl „" + current->name + "“." : "Aktiviere diese Mod für das nächste Spiel.") + "</span><div class=\"es-row\">";
|
||||||
esc(active ? "Diese Mod ist für das nächste Spiel ausgewählt."
|
return out + pg_button("mod-activate", active ? "Aktiv" : "Aktivieren", "primary sm", "id=\"mod-activate\" " + std::string(active || !entry->valid() || front_busy_ ? "disabled=\"disabled\"" : "")) + "</div></div>";
|
||||||
: current ? "Aktivieren ersetzt die Auswahl „" + current->name + "“."
|
|
||||||
: "Aktiviere diese Mod für das nächste Spiel.") +
|
|
||||||
"</p>";
|
|
||||||
return out +
|
|
||||||
btn("mod-activate", active ? "Aktiv" : "Aktivieren",
|
|
||||||
"front-mod-activate",
|
|
||||||
"id=\"mod-activate\" " +
|
|
||||||
std::string(active || !entry->valid() || front_busy_
|
|
||||||
? "disabled"
|
|
||||||
: "")) +
|
|
||||||
"</div>";
|
|
||||||
}
|
}
|
||||||
std::string App::front_modal() {
|
std::string App::front_modal() {
|
||||||
if (front_dialog_.empty())
|
if (front_dialog_.empty())
|
||||||
@@ -112,150 +83,91 @@ std::string App::front_modal() {
|
|||||||
std::string heading, body, buttons;
|
std::string heading, body, buttons;
|
||||||
if (front_dialog_ == "choice") {
|
if (front_dialog_ == "choice") {
|
||||||
heading = "Mod importieren";
|
heading = "Mod importieren";
|
||||||
body = "<p>Wähle einen Originalordner oder einen Export im "
|
body = "<p>Wähle einen Originalordner oder einen Export im OpenBMH-Format.</p>";
|
||||||
"OpenBMH-Format.</p><div class=\"front-import-choices\">";
|
|
||||||
const std::array<std::array<const char *, 3>, 3> choices{
|
const std::array<std::array<const char *, 3>, 3> choices{
|
||||||
{{{"original", "BMH / Football Limited",
|
{{{"original", "BMH / Football Limited", "Originalordner mit BMH.EXE oder FLTD.EXE"}},
|
||||||
"Originalordner mit BMH.EXE oder FLTD.EXE"}},
|
{{"package", "OpenBMH-Paket", "Weltpaket im neuen Format · .obw oder .zip"}},
|
||||||
{{"package", "OpenBMH-Paket",
|
{{"folder", "OpenBMH-Exportordner", "Entpackte Welt oder Mod-Ordner mit content.obw"}}}};
|
||||||
"Weltpaket im neuen Format · .obw oder .zip"}},
|
|
||||||
{{"folder", "OpenBMH-Exportordner",
|
|
||||||
"Entpackte Welt oder Mod-Ordner mit content.obw"}}}};
|
|
||||||
for (const auto &c : choices)
|
for (const auto &c : choices)
|
||||||
body += btn(
|
body += btn("front-pick", "<strong>" + std::string(c[1]) + "</strong><span>" + c[2] + "</span>", "es-choice", "data-id=\"" + std::string(c[0]) + "\"");
|
||||||
"front-pick",
|
buttons = pg_button("front-dismiss", "Abbrechen");
|
||||||
"<strong>" + std::string(c[1]) + "</strong><span>" + c[2] + "</span>",
|
|
||||||
"front-import-choice", "data-id=\"" + std::string(c[0]) + "\"");
|
|
||||||
body += "</div>";
|
|
||||||
buttons = btn("front-dismiss", "Abbrechen");
|
|
||||||
} else if (front_dialog_ == "name" || front_dialog_ == "rename") {
|
} else if (front_dialog_ == "name" || front_dialog_ == "rename") {
|
||||||
const bool importing = front_dialog_ == "name";
|
const bool importing = front_dialog_ == "name";
|
||||||
heading = importing ? "Mod übernehmen" : "Mod umbenennen";
|
heading = importing ? "Mod übernehmen" : "Mod umbenennen";
|
||||||
body = "<label class=\"front-name-label\"><span>Bezeichnung</span><input "
|
body = "<div><span class=\"es-k\">BEZEICHNUNG</span><input type=\"text\" class=\"es-in\" id=\"front-mod-name\" value=\"" + esc(front_name_) + "\" maxlength=\"64\" style=\"margin-top:" + es(3) + ";\"/></div>";
|
||||||
"type=\"text\" id=\"front-mod-name\" value=\"" +
|
|
||||||
esc(front_name_) + "\" maxlength=\"64\"/></label>";
|
|
||||||
if (importing && front_plan_) {
|
if (importing && front_plan_) {
|
||||||
const auto &m = front_plan_->metadata;
|
const auto &m = front_plan_->metadata;
|
||||||
body +=
|
body += "<p>" + esc(m.description) + " · " + esc(m.type) + " · " + std::to_string(m.file_count) + (m.file_count == 1 ? " Datei" : " Dateien") + " · " + front_size(m.bytes) + "</p><p class=\"es-mut\">" +
|
||||||
"<p class=\"front-import-summary\">" + esc(m.description) + " · " +
|
std::string(m.type == "Classic" ? "Der vorhandene OpenBMH-Importer konvertiert die Originaldaten in ein eigenständiges Classic-Paket."
|
||||||
esc(m.type) + "<br/>" + std::to_string(m.file_count) +
|
: "Das geprüfte Weltpaket wird in deine Mod-Bibliothek übernommen.") +
|
||||||
(m.file_count == 1 ? " Datei" : " Dateien") + " · " +
|
" Anschließend kannst du die Mod aktivieren.</p>";
|
||||||
front_size(m.bytes) + "</p><p class=\"front-import-note\">" +
|
|
||||||
std::string(m.type == "Classic"
|
|
||||||
? "Der vorhandene OpenBMH-Importer konvertiert die "
|
|
||||||
"Originaldaten in ein eigenständiges Classic-Paket."
|
|
||||||
: "Das geprüfte Weltpaket wird in deine "
|
|
||||||
"Mod-Bibliothek übernommen.") +
|
|
||||||
" Anschließend kannst du die Mod aktivieren.</p>";
|
|
||||||
}
|
}
|
||||||
body += "<p id=\"front-name-error\" class=\"front-name-error\">" +
|
body += "<span id=\"front-name-error\" class=\"es-error\">" + esc(front_name_error_) + "</span>";
|
||||||
esc(front_name_error_) + "</p>";
|
buttons = pg_button("front-dismiss", "Abbrechen") +
|
||||||
buttons = btn("front-dismiss", "Abbrechen") +
|
pg_button("front-name-confirm", importing ? "Importieren" : "Umbenennen", "primary", "id=\"front-name-confirm\" " + std::string(front_name_error_.empty() ? "" : "disabled=\"disabled\""));
|
||||||
btn("front-name-confirm",
|
|
||||||
importing ? "Importieren" : "Umbenennen", "primary",
|
|
||||||
"id=\"front-name-confirm\" " +
|
|
||||||
std::string(front_name_error_.empty() ? "" : "disabled"));
|
|
||||||
} else if (front_dialog_ == "delete") {
|
} else if (front_dialog_ == "delete") {
|
||||||
heading = "Mod löschen?";
|
heading = "Mod löschen?";
|
||||||
body = "<p>„" + esc(front_target_ ? front_target_->name : "") +
|
body = "<p>„" + esc(front_target_ ? front_target_->name : "") + "“ wirklich aus der lokalen Bibliothek entfernen?</p>";
|
||||||
"“ wirklich aus der lokalen Bibliothek entfernen?</p>";
|
if (front_target_ && front_target_->active) body += "<p class=\"es-mut\">Danach ist keine Mod aktiviert. Wähle eine andere Mod für das nächste neue Spiel.</p>";
|
||||||
if (front_target_ && front_target_->active)
|
body += "<p class=\"es-mut\">Persönliche Spielstände bleiben erhalten.</p>";
|
||||||
body += "<p class=\"front-import-note\">Danach ist keine Mod aktiviert. "
|
buttons = pg_button("front-dismiss", "Abbrechen") + pg_button("front-delete-confirm", "Löschen", "primary");
|
||||||
"Wähle eine andere Mod für das nächste neue Spiel.</p>";
|
|
||||||
body += "<p class=\"front-import-note\">Persönliche Spielstände und "
|
|
||||||
"Desktopansichten bleiben erhalten.</p>";
|
|
||||||
buttons = btn("front-dismiss", "Abbrechen") +
|
|
||||||
btn("front-delete-confirm", "Löschen", "primary");
|
|
||||||
} else {
|
} else {
|
||||||
heading = "Vorgang nicht möglich";
|
heading = "Vorgang nicht möglich";
|
||||||
body = "<p>" + esc(front_error_) + "</p>";
|
body = "<p>" + esc(front_error_) + "</p>";
|
||||||
buttons = btn("front-dismiss", "Verstanden");
|
buttons = pg_button("front-dismiss", "Verstanden");
|
||||||
}
|
}
|
||||||
return "<div class=\"front-dialog-layer\"><section class=\"front-dialog\" "
|
return "<div class=\"es-veil pg-root\"><section class=\"es-dlg\" role=\"dialog\" aria-modal=\"true\"><h2>" + esc(heading) + "</h2>" + body + "<div class=\"es-dlg-act\">" + buttons + "</div></section></div>";
|
||||||
"role=\"dialog\" aria-modal=\"true\"><h2>" +
|
|
||||||
esc(heading) + "</h2>" + body + "<footer>" + buttons +
|
|
||||||
"</footer></section></div>";
|
|
||||||
}
|
}
|
||||||
std::string App::mods_page() {
|
std::string App::mods_page() {
|
||||||
std::string rows;
|
std::string rows;
|
||||||
for (size_t i = 0; i < front_snapshot_.entries.size(); ++i) {
|
for (size_t i = 0; i < front_snapshot_.entries.size(); ++i) {
|
||||||
const auto &entry = front_snapshot_.entries[i];
|
const auto &entry = front_snapshot_.entries[i];
|
||||||
const bool active = entry.active && !front_external_override_;
|
const bool active = entry.active && !front_external_override_, chosen = entry.id == selected_mod_;
|
||||||
rows += btn(
|
rows += btn("mod-select", "<strong>" + esc(entry.name) + "</strong><span>" + esc(active ? "Aktiv" : entry.valid() ? entry.source : "Fehlerhaft") + " · " + esc(entry.type) + "</span>", std::string("es-li") + (chosen ? " sel" : ""),
|
||||||
"mod-select",
|
"id=\"mod-entry-" + std::to_string(i) + "\" role=\"option\" aria-selected=\"" + (chosen ? "true" : "false") + "\" data-id=\"" + esc(entry.id) + "\" " + (front_busy_ ? "disabled=\"disabled\"" : ""));
|
||||||
"<span class=\"front-mod-copy\"><strong>" + esc(entry.name) +
|
|
||||||
"</strong><small>" +
|
|
||||||
(active
|
|
||||||
? "<span "
|
|
||||||
"class=\"front-mod-active-dot\"></span><span>Aktiv</span>"
|
|
||||||
: "<span>" + esc(entry.valid() ? entry.source : "Fehlerhaft") +
|
|
||||||
"</span>") +
|
|
||||||
"</small></span><span class=\"front-mod-type\">" + esc(entry.type) +
|
|
||||||
"</span>",
|
|
||||||
"front-mod-entry " +
|
|
||||||
std::string(entry.id == selected_mod_ ? "selected" : ""),
|
|
||||||
"id=\"mod-entry-" + std::to_string(i) +
|
|
||||||
"\" role=\"option\" aria-selected=\"" +
|
|
||||||
(entry.id == selected_mod_ ? "true" : "false") + "\" data-id=\"" +
|
|
||||||
esc(entry.id) + "\" " + (front_busy_ ? "disabled" : ""));
|
|
||||||
}
|
}
|
||||||
if (rows.empty())
|
if (rows.empty()) rows = "<span class=\"es-mut\" style=\"display:block;padding:" + es(8) + " " + es(12) + ";\">Noch keine Mods vorhanden.</span>";
|
||||||
rows = "<p class=\"front-mod-empty-list\">Noch keine Mods vorhanden.</p>";
|
const auto tab = [&](const char *id, const std::string &label) {
|
||||||
const auto tabs =
|
const bool on = front_tab_ == id;
|
||||||
btn("front-tab",
|
return btn("front-tab", "<span>" + label + "</span>", on ? "on" : "", "id=\"mod-" + std::string(id) + "\" role=\"tab\" aria-selected=\"" + (on ? "true" : "false") + "\" data-id=\"" + id + "\" " + (front_busy_ ? "disabled=\"disabled\"" : ""));
|
||||||
"Installiert · " + std::to_string(front_snapshot_.entries.size()),
|
};
|
||||||
front_tab_ == "installed" ? "active" : "",
|
const auto tabs = "<nav class=\"pg-tabs\" role=\"tablist\" style=\"margin-right:" + es(60) + ";\">" + tab("installed", "Installiert · " + std::to_string(front_snapshot_.entries.size())) + tab("downloads", "Downloads") + "</nav>";
|
||||||
"id=\"mod-installed\" role=\"tab\" aria-selected=\"" +
|
const auto pane = front_tab_ == "installed"
|
||||||
std::string(front_tab_ == "installed" ? "true" : "false") +
|
? "<div class=\"es-fill\" style=\"gap:" + es(14) + ";align-items:stretch;\"><div class=\"es-list\" id=\"mod-list\" role=\"listbox\" aria-label=\"Mod auswählen\" style=\"width:" + es(270) + ";\">" + rows + "</div>" +
|
||||||
"\" data-id=\"installed\" " + (front_busy_ ? "disabled" : "")) +
|
front_mod_details() + "</div>"
|
||||||
btn("front-tab", "Downloads", front_tab_ == "downloads" ? "active" : "",
|
: std::string("<div class=\"es-box es-fill\" style=\"align-items:center;justify-content:center;\"><span class=\"es-mut\">Downloads folgen in einer späteren Version.</span></div>");
|
||||||
"id=\"mod-downloads\" role=\"tab\" aria-selected=\"" +
|
const bool selected = front_selected() != nullptr, enabled = !front_busy_ && selected && front_tab_ == "installed";
|
||||||
std::string(front_tab_ == "downloads" ? "true" : "false") +
|
const auto feedback = front_busy_ ? front_feedback_ : !front_feedback_.empty() ? front_feedback_ : !front_snapshot_.error.empty() ? front_snapshot_.error : "Es kann genau eine Mod aktiv sein.";
|
||||||
"\" data-id=\"downloads\" " + (front_busy_ ? "disabled" : ""));
|
const std::string off = "disabled=\"disabled\"";
|
||||||
const auto pane =
|
const auto foot = (front_tab_ == "installed" ? pg_button("front-import", "Importieren", "sm", "id=\"front-import-button\" " + (front_busy_ ? off : std::string())) +
|
||||||
front_tab_ == "installed"
|
pg_button("mod-rename", "Umbenennen", "sm", "id=\"mod-rename-button\" " + (enabled ? std::string() : off)) +
|
||||||
? "<div class=\"front-mod-layout\"><section "
|
pg_button("mod-remove", "Löschen", "sm", "id=\"mod-remove-button\" " + (enabled ? std::string() : off))
|
||||||
"class=\"front-mod-browser\"><header><span>Mod</span><span>Art</"
|
: std::string()) +
|
||||||
"span></header><div class=\"front-mod-list\" id=\"mod-list\" "
|
"<span class=\"es-note\" id=\"mod-feedback\">" + esc(feedback) + "</span>" + pg_button("front-home", "Zurück", "primary", "id=\"window-close\" " + (front_busy_ ? off : std::string()));
|
||||||
"role=\"listbox\" aria-label=\"Mod auswählen\">" +
|
return entry_pad("Hauptmenü", "Mod", pane, foot, tabs, front_modal());
|
||||||
rows + "</div></section>" + front_mod_details() + "</div>"
|
}
|
||||||
: "<section class=\"front-mod-downloads\">" +
|
// Spiel laden from the main menu: the saves on the left, the chosen one on the right.
|
||||||
img("icon.download", 180, 180) +
|
std::string App::render_files_pad() {
|
||||||
"<h2>Neue Welten entdecken</h2><p>Hier findest du später Mods "
|
std::string entries;
|
||||||
"aus der zentralen OpenBMH-Datenbank.</p>" +
|
for (size_t i = 0; i < files_rows_.size(); ++i) {
|
||||||
btn("front-noop", "Downloads demnächst", {}, "disabled") +
|
const auto &entry = files_rows_[i];
|
||||||
"</section>";
|
const bool chosen = files_selected_ == entry.id;
|
||||||
const bool selected = front_selected() != nullptr,
|
entries += btn("files-select", "<strong>" + esc(entry.name) + "</strong><span>" + esc(entry.valid() ? "Gespeichert am " + files_when(entry.created) : "Datei kann nicht geöffnet werden") + "</span>", std::string("es-li") + (chosen ? " sel" : ""),
|
||||||
enabled = !front_busy_ && selected && front_tab_ == "installed";
|
"id=\"files-entry-" + std::to_string(i) + "\" role=\"option\" data-id=\"" + esc(entry.id) + "\" data-file-row=\"true\" aria-selected=\"" + (chosen ? "true" : "false") + "\"");
|
||||||
const auto feedback = front_busy_ ? front_feedback_
|
}
|
||||||
: !front_feedback_.empty() ? front_feedback_
|
if (entries.empty()) entries = "<span class=\"es-mut\" style=\"display:block;padding:" + es(8) + " " + es(12) + ";\">" + std::string(files_native_ && engine_files_busy_ ? "Spielstände werden geladen …" : "Noch keine Spielstände vorhanden.") + "</span>";
|
||||||
: !front_snapshot_.error.empty()
|
std::string details;
|
||||||
? front_snapshot_.error
|
try { details = files_page_details(false); }
|
||||||
: "Es kann genau eine Mod aktiv sein.";
|
catch (const std::exception &e) { details = "<div class=\"pg-empty\"><strong class=\"pg-h\">Datei nicht verfügbar</strong><span style=\"display:block;\">" + esc(e.what()) + "</span></div>"; }
|
||||||
const auto body =
|
const bool selected = files_entry_ && files_entry_->valid();
|
||||||
"<div class=\"front-mod-content\"><nav class=\"front-mod-tabs\" "
|
const std::string off = "disabled=\"disabled\"";
|
||||||
"role=\"tablist\">" +
|
const auto feedback = files_feedback_.empty() ? std::string("Klick oder Pfeiltasten wählen einen Eintrag.") : files_feedback_;
|
||||||
tabs + "</nav><div class=\"front-mod-tabpanel\" role=\"tabpanel\">" +
|
return entry_pad("Hauptmenü", "Spiel laden",
|
||||||
pane +
|
"<div class=\"es-fill\" style=\"gap:" + es(14) + ";align-items:stretch;\"><div id=\"files-list\" class=\"es-list\" role=\"listbox\" aria-label=\"Spielstand auswählen\" style=\"width:" + es(290) + ";\">" + entries +
|
||||||
"</div><footer class=\"front-mod-actions\"><p id=\"mod-feedback\">" +
|
"</div><div class=\"es-box es-detail\">" + details + "</div></div>",
|
||||||
esc(feedback) + "</p><div>" +
|
pg_button("files-import", "Importieren", "sm") + pg_button("files-rename", "Umbenennen", "sm", selected ? std::string() : off) +
|
||||||
btn("front-import", "Importieren", {},
|
pg_button("files-delete", "Löschen", "sm", files_entry_ && !files_entry_->token.empty() ? std::string() : off) + "<span class=\"es-note\" id=\"files-feedback\" role=\"status\">" + esc(feedback) + "</span>" +
|
||||||
"id=\"front-import-button\" " +
|
pg_button("files-close", "Abbrechen") + pg_button("files-load", "Laden", "primary", "id=\"files-confirm\" " + (selected ? std::string() : off)));
|
||||||
std::string(front_busy_ ? "disabled" : "")) +
|
|
||||||
btn("mod-rename", "Umbenennen", {},
|
|
||||||
"id=\"mod-rename-button\" " +
|
|
||||||
std::string(enabled ? "" : "disabled")) +
|
|
||||||
btn("mod-remove", "Löschen", {},
|
|
||||||
"id=\"mod-remove-button\" " +
|
|
||||||
std::string(enabled ? "" : "disabled")) +
|
|
||||||
"</div></footer></div>";
|
|
||||||
return main_menu() +
|
|
||||||
"<div class=\"fill front-mod-layer\" style=\"z-index:100;\"><section "
|
|
||||||
"class=\"window front-mod-window\"><header class=\"titlebar\">" +
|
|
||||||
btn("front-home", "<span>×</span>", "close",
|
|
||||||
"id=\"window-close\" aria-label=\"Mod-Verwaltung schließen\" " +
|
|
||||||
std::string(front_busy_ ? "disabled" : "")) +
|
|
||||||
"<h1>Mod</h1></header>" + body + front_modal() + "</section></div>";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Json App::front_snapshot_view() const {
|
Json App::front_snapshot_view() const {
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ std::string front_selection_token_;
|
|||||||
std::future<FrontResult> front_job_;
|
std::future<FrontResult> front_job_;
|
||||||
std::shared_ptr<FrontProgress> front_progress_;
|
std::shared_ptr<FrontProgress> front_progress_;
|
||||||
bool front_busy_ = false, front_external_override_ = false;
|
bool front_busy_ = false, front_external_override_ = false;
|
||||||
|
bool front_quit_ = false; // the main menu asks whether to leave
|
||||||
float front_list_scroll_ = 0;
|
float front_list_scroll_ = 0;
|
||||||
bool front_restore_scroll_ = false, front_reveal_selection_ = false;
|
bool front_restore_scroll_ = false, front_reveal_selection_ = false;
|
||||||
fs::path front_library_root() const;
|
fs::path front_library_root() const;
|
||||||
|
|||||||
@@ -148,8 +148,8 @@ std::string App::notebook_shell(const std::function<bool(const std::string &)> &
|
|||||||
// the leather cover with its seam, the ribbon, the stack of sheets
|
// the leather cover with its seam, the ribbon, the stack of sheets
|
||||||
out += "<div class=\"nb-cover-shadow\"></div><div class=\"nb-cover\">" + picture(leather, 3281, 2070, true) + "<div class=\"nb-cover-tone\"></div><div class=\"nb-seam\">" +
|
out += "<div class=\"nb-cover-shadow\"></div><div class=\"nb-cover\">" + picture(leather, 3281, 2070, true) + "<div class=\"nb-cover-tone\"></div><div class=\"nb-seam\">" +
|
||||||
svg("nb-seam", 1440, 902, "<rect x=\"3\" y=\"3\" width=\"1434\" height=\"896\" rx=\"26\" fill=\"none\" stroke=\"" + stitch + "\" stroke-opacity=\".6\" stroke-width=\"2\" stroke-dasharray=\"9 7\"/>", 2400) + "</div></div>";
|
svg("nb-seam", 1440, 902, "<rect x=\"3\" y=\"3\" width=\"1434\" height=\"896\" rx=\"26\" fill=\"none\" stroke=\"" + stitch + "\" stroke-opacity=\".6\" stroke-width=\"2\" stroke-dasharray=\"9 7\"/>", 2400) + "</div></div>";
|
||||||
out += "<div class=\"nb-ribbon\">" + svg("nb-ribbon", 20, 96, "<defs><linearGradient id=\"r\" x1=\"0\" x2=\"1\" y1=\"0\" y2=\"0\"><stop offset=\"0\" stop-color=\"" + ribbon_a + "\"/><stop offset=\".5\" stop-color=\"" + ribbon_b +
|
out += btn("nb-home", svg("nb-ribbon", 20, 96, "<defs><linearGradient id=\"r\" x1=\"0\" x2=\"1\" y1=\"0\" y2=\"0\"><stop offset=\"0\" stop-color=\"" + ribbon_a + "\"/><stop offset=\".5\" stop-color=\"" + ribbon_b +
|
||||||
"\"/><stop offset=\"1\" stop-color=\"" + ribbon_a + "\"/></linearGradient></defs><path d=\"M0 0H20V96L10 83L0 96Z\" fill=\"url(#r)\"/>", 200) + "</div>";
|
"\"/><stop offset=\"1\" stop-color=\"" + ribbon_a + "\"/></linearGradient></defs><path d=\"M0 0H20V96L10 83L0 96Z\" fill=\"url(#r)\"/>", 200), "nb-ribbon", "id=\"nb-home\" aria-label=\"Zurück ins Hauptmenü\" title=\"Zurück ins Hauptmenü\"");
|
||||||
for (int sheet = 4; sheet >= 0; --sheet) out += "<div class=\"nb-stack s" + std::to_string(sheet) + "\"></div>";
|
for (int sheet = 4; sheet >= 0; --sheet) out += "<div class=\"nb-stack s" + std::to_string(sheet) + "\"></div>";
|
||||||
// the categories: markers that stick out at the left edge
|
// the categories: markers that stick out at the left edge
|
||||||
static constexpr std::array<const char *, 9> tones{"a3", "s3", "a2", "s4", "a4", "n3", "s2", "a5", "s5"};
|
static constexpr std::array<const char *, 9> tones{"a3", "s3", "a2", "s4", "a4", "n3", "s2", "a5", "s5"};
|
||||||
|
|||||||
@@ -200,6 +200,9 @@ std::string App::render_settings() {
|
|||||||
begin_settings();
|
begin_settings();
|
||||||
// in a career the settings are a page of the notebook; from the main menu the older sheet
|
// in a career the settings are a page of the notebook; from the main menu the older sheet
|
||||||
const bool page = page_native();
|
const bool page = page_native();
|
||||||
|
// from the main menu only the sound is set, on the pad of the entry
|
||||||
|
const bool pad = scene_ == "main";
|
||||||
|
if (pad) settings_category_ = "sound";
|
||||||
settings_remember_scroll();
|
settings_remember_scroll();
|
||||||
const auto &p = settings_draft_.at("global");
|
const auto &p = settings_draft_.at("global");
|
||||||
std::string nav, pane;
|
std::string nav, pane;
|
||||||
@@ -410,6 +413,12 @@ std::string App::render_settings() {
|
|||||||
return out + "<div id=\"settings-options\" class=\"settings-scroll\" tabindex=\"0\">" + pane + "</div><nav class=\"pg-foot\"><span class=\"pg-status\" id=\"settings-draft-status\" role=\"status\"></span><span class=\"pg-sp\"></span>" +
|
return out + "<div id=\"settings-options\" class=\"settings-scroll\" tabindex=\"0\">" + pane + "</div><nav class=\"pg-foot\"><span class=\"pg-status\" id=\"settings-draft-status\" role=\"status\"></span><span class=\"pg-sp\"></span>" +
|
||||||
pg_button("settings-cancel", "Abbrechen", "", "id=\"settings-cancel\"") + pg_button("settings-apply", "Anwenden", "primary", "id=\"settings-apply\"") + "</nav></section>";
|
pg_button("settings-cancel", "Abbrechen", "", "id=\"settings-cancel\"") + pg_button("settings-apply", "Anwenden", "primary", "id=\"settings-apply\"") + "</nav></section>";
|
||||||
}
|
}
|
||||||
|
if (pad)
|
||||||
|
return entry_pad("Hauptmenü", "Einstellungen",
|
||||||
|
"<div id=\"settings-options\" class=\"es-sound\" tabindex=\"0\">" + pane + "<span class=\"es-mut\" style=\"display:block;margin-top:" + es(14) +
|
||||||
|
";\">Der Ton wird hier im Hauptmenü eingestellt. Gestaltung und Spieloptionen findest du im Spiel unter Optionen.</span></div>",
|
||||||
|
"<span class=\"es-note\" id=\"settings-draft-status\" role=\"status\"></span>" + pg_button("settings-cancel", "Abbrechen", "", "id=\"settings-cancel\"") +
|
||||||
|
pg_button("settings-apply", "Anwenden", "primary", "id=\"settings-apply\""));
|
||||||
return "<section class=\"settings-layout\"><nav "
|
return "<section class=\"settings-layout\"><nav "
|
||||||
"class=\"settings-categories\" role=\"tablist\" "
|
"class=\"settings-categories\" role=\"tablist\" "
|
||||||
"aria-orientation=\"vertical\">" +
|
"aria-orientation=\"vertical\">" +
|
||||||
|
|||||||
+26
-9
@@ -432,6 +432,7 @@ class App final : public Rml::EventListener {
|
|||||||
// A menu window (2720 x 2040 at the middle of the stage) is shown as large as the screen
|
// A menu window (2720 x 2040 at the middle of the stage) is shown as large as the screen
|
||||||
// allows; the desk behind it is cropped. Without a window the whole stage is fitted.
|
// allows; the desk behind it is cropped. Without a window the whole stage is fitted.
|
||||||
bool window_zoom_ = false;
|
bool window_zoom_ = false;
|
||||||
|
bool entry_stage_ = false; // the stage shows the table of the entry: it fills the window
|
||||||
std::string scene_ = "main", menu_, theme_ = "silver", active_mod_,
|
std::string scene_ = "main", menu_, theme_ = "silver", active_mod_,
|
||||||
selected_mod_, notice_, country_ = "nation:de", league_,
|
selected_mod_, notice_, country_ = "nation:de", league_,
|
||||||
selected_club_;
|
selected_club_;
|
||||||
@@ -895,6 +896,13 @@ class App final : public Rml::EventListener {
|
|||||||
bool page_native() const;
|
bool page_native() const;
|
||||||
static std::string pg(double units);
|
static std::string pg(double units);
|
||||||
static std::string pg_css(std::string_view css);
|
static std::string pg_css(std::string_view css);
|
||||||
|
// the entry into the game: one pad on a table (front_screens.inc)
|
||||||
|
static constexpr double kEntryUnit = 2.29665;
|
||||||
|
static std::string es(double units);
|
||||||
|
std::string entry_stage(const std::string &paper, const std::string &over = {});
|
||||||
|
std::string entry_sheet(const std::string &kicker, const std::string &title, const std::string &body, const std::string &foot, const std::string &right = {});
|
||||||
|
std::string entry_pad(const std::string &kicker, const std::string &title, const std::string &body, const std::string &foot, const std::string &right = {}, const std::string &over = {});
|
||||||
|
std::string render_files_pad();
|
||||||
static std::string pg_upper(const std::string &text);
|
static std::string pg_upper(const std::string &text);
|
||||||
static std::string pg_kicker(const std::string &text, const std::string &css = {});
|
static std::string pg_kicker(const std::string &text, const std::string &css = {});
|
||||||
static std::string pg_stat(const std::string &label, const std::string &value, const std::string &sub = {});
|
static std::string pg_stat(const std::string &label, const std::string &value, const std::string &sub = {});
|
||||||
@@ -1076,8 +1084,10 @@ class App final : public Rml::EventListener {
|
|||||||
if (!wanted) window_shown_ = "\x01";
|
if (!wanted) window_shown_ = "\x01";
|
||||||
// the career's desk hangs from the top edge of a taller screen, so its bar is the
|
// the career's desk hangs from the top edge of a taller screen, so its bar is the
|
||||||
// screen's bar and the spare height shows the stadium below
|
// screen's bar and the spare height shows the stadium below
|
||||||
const bool desk = !wanted && (scene_ == "engine" || scene_ == "desktop" || scene_ == "managerhub");
|
const bool entry = doc_->QuerySelector(".es-stage") != nullptr;
|
||||||
if (wanted == window_zoom_ && desk == desk_top_) return;
|
const bool desk = !wanted && !entry && (scene_ == "engine" || scene_ == "desktop" || scene_ == "managerhub");
|
||||||
|
if (wanted == window_zoom_ && desk == desk_top_ && entry == entry_stage_) return;
|
||||||
|
entry_stage_ = entry;
|
||||||
window_zoom_ = wanted;
|
window_zoom_ = wanted;
|
||||||
desk_top_ = desk;
|
desk_top_ = desk;
|
||||||
resize();
|
resize();
|
||||||
@@ -1090,11 +1100,13 @@ class App final : public Rml::EventListener {
|
|||||||
return;
|
return;
|
||||||
scale_ = std::min(double(pw) / 3840, double(ph) / 2160);
|
scale_ = std::min(double(pw) / 3840, double(ph) / 2160);
|
||||||
if (window_zoom_) scale_ = std::max(scale_, std::min(double(pw) / 2760, double(ph) / 2080));
|
if (window_zoom_) scale_ = std::max(scale_, std::min(double(pw) / 2760, double(ph) / 2080));
|
||||||
|
// the table of the entry fills the window; its pad (930 x 690 units about the middle) stays whole
|
||||||
|
if (entry_stage_) scale_ = std::min({std::max(double(pw) / 3840, double(ph) / 2160), double(pw) / (930 * kEntryUnit), double(ph) / (690 * kEntryUnit)});
|
||||||
canvas_left_ = (pw - 3840 * scale_) / 2;
|
canvas_left_ = (pw - 3840 * scale_) / 2;
|
||||||
canvas_top_ = (ph - 2160 * scale_) / 2;
|
canvas_top_ = (ph - 2160 * scale_) / 2;
|
||||||
if (desk_top_ && canvas_top_ > 0) canvas_top_ = 0;
|
if (desk_top_ && canvas_top_ > 0) canvas_top_ = 0;
|
||||||
// a career's desk is as high as the screen shows of it; menus keep their 16:9 stage
|
// a career's desk is as high as the screen shows of it; menus keep their 16:9 stage
|
||||||
const bool desk_scene = scene_ == "engine" || scene_ == "desktop" || scene_ == "managerhub";
|
const bool desk_scene = !entry_stage_ && (scene_ == "engine" || scene_ == "desktop" || scene_ == "managerhub");
|
||||||
const double fitted = std::min(double(pw) / 3840, double(ph) / 2160);
|
const double fitted = std::min(double(pw) / 3840, double(ph) / 2160);
|
||||||
const int stage_height = desk_scene ? std::clamp(int(ph / fitted), 2160, 2880) : 2160;
|
const int stage_height = desk_scene ? std::clamp(int(ph / fitted), 2160, 2880) : 2160;
|
||||||
if (stage_height != desktop_height()) {
|
if (stage_height != desktop_height()) {
|
||||||
@@ -1199,27 +1211,32 @@ class App final : public Rml::EventListener {
|
|||||||
context_dirty_ = true;
|
context_dirty_ = true;
|
||||||
doc_->SetClassNames(body_classes());
|
doc_->SetClassNames(body_classes());
|
||||||
std::string markup;
|
std::string markup;
|
||||||
if (scene_ == "main")
|
// from the main menu the saves and the sound are written on the pad as well
|
||||||
|
const bool pad_menu = scene_ == "main" && (menu_ == "load" || menu_ == "settings");
|
||||||
|
if (pad_menu)
|
||||||
|
markup = menu_ == "load" ? render_files(false, false) : render_settings();
|
||||||
|
else if (scene_ == "main")
|
||||||
markup = main_menu();
|
markup = main_menu();
|
||||||
else if (scene_ == "mods")
|
else if (scene_ == "mods")
|
||||||
markup = mods_page();
|
markup = mods_page();
|
||||||
else if (scene_ == "newgame")
|
else if (scene_ == "newgame")
|
||||||
markup = main_menu()+"<div class=\"fill\" style=\"z-index:100;\">"+render_newgame()+"</div>";
|
markup = render_newgame();
|
||||||
else if (scene_ == "manager")
|
else if (scene_ == "manager")
|
||||||
markup = (adding_manager_?render_desktop():main_menu())+"<div class=\"fill\" style=\"z-index:100;\">"+render_manager()+"</div>";
|
markup = render_manager();
|
||||||
else if (scene_ == "managerhub")
|
else if (scene_ == "managerhub")
|
||||||
markup = render_desktop()+"<div class=\"fill menu-layer\" style=\"z-index:100;\">"+render_career()+"</div>";
|
markup = render_desktop()+"<div class=\"fill menu-layer\" style=\"z-index:100;\">"+render_career()+"</div>";
|
||||||
else if (scene_ == "opening")
|
else if (scene_ == "opening")
|
||||||
markup = main_menu()+"<div class=\"fill\" style=\"z-index:100;\">"+render_opening()+"</div>";
|
markup = render_opening();
|
||||||
else if (scene_ == "live")
|
else if (scene_ == "live")
|
||||||
markup = render_live();
|
markup = render_live();
|
||||||
else if (source_)
|
else if (source_)
|
||||||
markup = render_desktop();
|
markup = render_desktop();
|
||||||
if (!menu_.empty())
|
if (!menu_.empty() && !pad_menu)
|
||||||
markup += render_menu(menu_);
|
markup += render_menu(menu_);
|
||||||
setting_menu_markup_ = true;
|
setting_menu_markup_ = true;
|
||||||
notebook_finish(markup);
|
notebook_finish(markup);
|
||||||
element("canvas")->SetInnerRML(markup);
|
element("canvas")->SetInnerRML(markup);
|
||||||
|
needs_render_ = false;
|
||||||
++document_generation_;
|
++document_generation_;
|
||||||
sync_window_zoom();
|
sync_window_zoom();
|
||||||
live_detail_pending_ = live_ticker_pending_ = false;
|
live_detail_pending_ = live_ticker_pending_ = false;
|
||||||
@@ -1262,7 +1279,7 @@ class App final : public Rml::EventListener {
|
|||||||
: theme_ == "matchday"
|
: theme_ == "matchday"
|
||||||
? "saturate(0.13) brightness(0.56)"
|
? "saturate(0.13) brightness(0.56)"
|
||||||
: "saturate(0.34) brightness(0.70)");
|
: "saturate(0.34) brightness(0.70)");
|
||||||
needs_render_ = false;
|
// (a stage that changed its height while this was drawn asks for one more drawing)
|
||||||
last_rendered_menu_ = menu_;
|
last_rendered_menu_ = menu_;
|
||||||
last_report_state_ = report_state;
|
last_report_state_ = report_state;
|
||||||
scale_chalk_shadow();
|
scale_chalk_shadow();
|
||||||
|
|||||||
Reference in new issue
Block a user