diff --git a/assets/modern/art/gui-assets.json b/assets/modern/art/gui-assets.json index 9273e76..321c9e7 100644 --- a/assets/modern/art/gui-assets.json +++ b/assets/modern/art/gui-assets.json @@ -81,6 +81,16 @@ 0.8634, 0.4676 ] + }, + "manager.scenes": { + "file": "manager-scenes.png", + "sha256": "28743ba22d440fda3e186ad6e15061afdcf1a1c3b26e077cfd62a470a4f86857", + "crop": [ + 0, + 0, + 1, + 1 + ] } } } diff --git a/assets/modern/art/manager-scenes.png b/assets/modern/art/manager-scenes.png new file mode 100644 index 0000000..2f2f8d9 Binary files /dev/null and b/assets/modern/art/manager-scenes.png differ diff --git a/assets/modern/career.rcss b/assets/modern/career.rcss index 230c1e7..e30ceb0 100644 --- a/assets/modern/career.rcss +++ b/assets/modern/career.rcss @@ -1,37 +1,2 @@ /* SPDX-License-Identifier: GPL-3.0-only */ -.career-hub {position:absolute;left:0;right:0;top:0;bottom:0;} -.career-hub>header {position:absolute;left:0;right:0;top:0;height:150dp;display:flex;align-items:center;justify-content:space-between;gap:30dp;} -.career-hub h2 {font-size:44dp;margin:0 0 12dp;} -.career-hub header p {font-size:28dp;color:var(--muted);margin:0;} -.career-hub header nav {display:flex;gap:14dp;} -.career-hub header nav button {min-width:210dp;height:76dp;font-size:28dp;} -.career-cards {position:absolute;left:0;right:0;top:176dp;bottom:216dp;} -.career-card {position:absolute;top:0;width:1292dp;height:723dp;border:3dp var(--border);border-radius:24dp;overflow:hidden;padding:0;background-color:var(--panel);} -.career-card>.image-frame {position:absolute;left:0;right:0;top:0;bottom:0;} -.career-resign {left:0;}.career-search {right:0;}.career-add {left:0;right:0;top:749dp;width:2612dp;} -.career-caption {position:absolute;left:0;right:0;bottom:0;padding:50dp 34dp 28dp;background-color:#0c1723ed;display:flex;align-items:baseline;justify-content:space-between;gap:24dp;color:#f7f9fc;} -.career-caption strong {font-size:40dp;}.career-caption small {font-size:28dp;color:#d1dfe9;} -.career-hub>footer {position:absolute;left:0;right:0;bottom:0;height:190dp;display:flex;align-items:center;justify-content:space-between;gap:30dp;} -.career-hub footer section>span {display:block;font-size:28dp;color:var(--muted);margin-bottom:14dp;} -.career-hub footer section>div {display:flex;gap:16dp;} -.career-hub footer button {height:82dp;font-size:28dp;min-width:230dp;} -.career-hub .selected {background-color:var(--selected);border-color:var(--accent);color:var(--accent);} -.career-dialog label {display:block;font-size:32dp;margin-bottom:20dp;} -.career-dialog select {width:100%;height:100dp;font-size:32dp;} -.career-dialog p {font-size:32dp;line-height:1.5;margin:28dp 0;} - -.career-hub h2,.career-caption strong {font-weight:bold;} -.career-hub header nav {max-width:64%;flex-wrap:wrap;} - -/* QA CSS candidate: Gold full-width career confirmation. */ -.career-dialog {width:2484dp;} -.career-dialog>h2 {width:100%;text-align:center;} - -#career-dialog-layer {left:0;right:0;top:0;bottom:0;padding:0;} -.career-dialog {display:flex;flex-direction:column;} -.career-dialog>h2 {height:48dp;line-height:48dp;margin:0 0 35dp;flex-shrink:0;} -.career-dialog>label {height:37dp;line-height:37dp;margin:0 0 26dp;flex-shrink:0;} -.career-dialog>select {height:82dp;flex-shrink:0;margin:0;} -.career-dialog>p:nth-child(4) {height:48dp;line-height:48dp;margin:58dp 0 32dp;flex-shrink:0;} -.career-dialog>footer {height:65dp;flex-shrink:0;margin:45dp 0 0;} -.career-dialog>footer button {height:65dp;padding:12dp 24dp;line-height:37dp;} +/* The manager is a page of the notebook now: its styles are the mg-* rules in pages.rcss. */ diff --git a/assets/modern/pages.rcss b/assets/modern/pages.rcss index 45d47bc..c14b903 100644 --- a/assets/modern/pages.rcss +++ b/assets/modern/pages.rcss @@ -690,3 +690,18 @@ body.midnight .cp-map-name,body.matchday .cp-map-name {color:#f0ece2;font-effect .pg-root .cp-range:disabled sliderbar {background-color:var(--p-s6);} .pg-root .pg-btn.cp-book {width:100%;height:86dp;font-size:36dp;} .cp-note {display:block;text-align:center;font-size:28dp;line-height:36dp;} + +/* --- manager: one picture with three scenes, and under it what the scene under the pointer does --- */ +.mg-stage {display:flex;flex:1;min-height:0;align-items:center;justify-content:center;} +.mg-frame {position:relative;display:block;flex:none;overflow:hidden;clip:always;border-radius:40dp;} +.mg-art {position:absolute;left:0;top:0;display:block;} +.mg-hot,.mg-hot:disabled,.mg-hot:focus {position:absolute;display:block;padding:0;margin:0;border:9dp transparent;border-radius:0dp;background-color:transparent;decorator:none;opacity:1;transition:background-color border-color 0.12s;} +.mg-hot.dim,.mg-hot.dim:disabled {background-color:#2e2b2559;} +.mg-hot:hover,.mg-hot:disabled:hover,.mg-hot:focus-visible {border-color:#f6ecd8;background-color:#ffffff24;} +.mg-foot {flex:none;height:81dp;gap:14dp;} +.mg-side {display:flex;flex:1;min-width:0;gap:11dp;} +.mg-side.right {justify-content:flex-end;} +.mg-hint {flex:none;max-width:2300dp;height:81dp;line-height:81dp;padding:0 40dp;border-radius:41dp;font-size:34dp;text-align:center;} +.mg-hint strong {font-family:Display;font-weight:normal;font-size:36dp;margin-right:12dp;} +.mg-owner label {display:block;} +.mg-owner select {width:520dp;height:68dp;padding:0 27dp;border:2dp var(--p-div);border-radius:36dp;background-color:var(--p-n1);font-family:Modern;font-size:30dp;color:var(--p-text);} diff --git a/src/modern/ui/career_controls.inc b/src/modern/ui/career_controls.inc index c00048d..ff1b853 100644 --- a/src/modern/ui/career_controls.inc +++ b/src/modern/ui/career_controls.inc @@ -107,8 +107,27 @@ bool App::career_event(Rml::Event &event) { event.StopImmediatePropagation(); return true; } - if (!career_resign_open_ && !career_game_end_) + if (!career_resign_open_ && !career_game_end_) { + // what the scene under the pointer (or the one that has the focus) does + if (type == "mousemove" || type == "focus" || type == "blur") { + std::string scene; + if (type != "blur") + for (auto *n = event.GetTargetElement(); n && n != doc_; n = n->GetParentNode()) + if (n->HasAttribute("data-hint")) { scene = n->GetAttribute("data-hint", ""); break; } + if (scene != career_hint_) { + career_hint_ = scene; + // the scenes the pointer is not on step back + for (const auto &other : career_scenes) + if (auto *zone = element(other.action)) zone->SetClass("dim", !scene.empty() && scene != other.action); + if (auto *hint = element("career-hint")) { + hint->SetInnerRML(career_hint_markup(scene)); + hint->SetProperty("visibility", scene.empty() ? "hidden" : "visible"); + } + dirty_ = true; + } + } return false; + } auto *target = event.GetTargetElement(); bool inside = false; for (auto *n = target; n && n != doc_; n = n->GetParentNode()) diff --git a/src/modern/ui/career_screens.inc b/src/modern/ui/career_screens.inc index 65de463..4f08351 100644 --- a/src/modern/ui/career_screens.inc +++ b/src/modern/ui/career_screens.inc @@ -1,110 +1,74 @@ // SPDX-License-Identifier: GPL-3.0-only +namespace { +// The three scenes of the manager's picture: which action each one is, its name, what it +// does, and where it lies on the picture (left, top, width, height in percent). +struct CareerScene { const char *action, *title, *text; double left, top, width, height; }; +constexpr std::array career_scenes{{ + {"career-resign", "Aufhören", "Dein Amt abgeben. Der Verein wird danach vom Computer geführt.", 0, 0, 49.3, 52.3}, + {"career-search", "Vereinssuche", "Bei einem anderen Verein anheuern – noch nicht verfügbar.", 50.1, 0, 49.9, 52.3}, + {"career-add", "Neuer Spieler", "Einen weiteren menschlichen Mitspieler einrichten: Name, Land, Liga und Verein.", 0, 53.2, 100, 46.8}}}; +std::string career_hint_markup(const std::string &action) { + for (const auto &scene : career_scenes) + if (action == scene.action) return "" + esc(scene.title) + "· " + esc(scene.text) + ""; + return {}; +} +} // namespace +// Optionen > Manager: one picture with three scenes. The pointer lights the scene it is on and +// darkens the others; under the picture stands what the scene does. std::string App::render_career() { const auto c = engine_mode_?engine_career_context():demo_career_context(snap().state,*snap().world); const bool ended = c.at("ended"); const Json m = engine_mode_?engine_manager_value_.at("active"):manager(snap()); - std::string body = - "

" + - esc(ended ? "Karriere beendet" : m.value("name", "")) + "

" + - esc(c.at("current_team").value("name", "")) + " · " + - (c.at("role") == "national" ? "Nationalmannschaft" : "Vereinsmanager") + - "

"; - const auto card = [&](const std::string &action, const std::string &key, - const std::string &title, const std::string ¬e, - const std::string &css, bool disabled) { - return btn( - action, - img(key, css == "career-add" ? 2612 : 1292, 724, false, false, 1600) + - "" + title + - "" + note + "", - "career-card " + css, - "id=\"" + action + "\" " + (disabled ? "disabled" : "")); + page_title_ = ended ? "Karriere beendet" : "Manager"; + page_hint_ = m.value("name", "") + " · " + c.at("current_team").value("name", "") + " · " + (c.at("role") == "national" ? "Nationalmannschaft" : "Vereinsmanager"); + const auto off = [&](const std::string &action) { + if (action == "career-search") return true; + if (action == "career-resign") return ended || (engine_mode_ && engine_manager_value_.at("can_resign") != true); + return ended || (engine_mode_ && engine_manager_value_.at("can_join") != true); }; - body += card("career-resign", "manager.resign", "Aufgeben", - engine_mode_&&engine_manager_value_.at("can_resign")!=true?"Mehrspieler folgt":"Dein Amt abgeben", "career-resign", ended||(engine_mode_&&engine_manager_value_.at("can_resign")!=true)) + - card("career-search", "manager.search", "Vereinssuche", "Später", - "career-search", true) + - card("career-add", "manager.add", "Neuer Spieler", - "Weiteren Menschen einrichten", "career-add", ended||(engine_mode_&&engine_manager_value_.at("can_join")!=true)) + - "
Dein Aufgabenbereich
"; - for (const auto &role : c.at("available_roles")) { - const auto id = role.get(); - body += btn("career-role", id == "club" ? "Verein" : "Nationalmannschaft", - c.at("role") == role ? "selected" : "", - "id=\"career-role-" + id + "\" data-id=\"" + id + - "\" aria-pressed=\"" + - (c.at("role") == role ? "true" : "false") + "\" " + - (ended||engine_mode_ ? "disabled" : "")); + // 1448 x 1086 on the page: as tall as the page allows + constexpr double frame_h = 1485, frame_w = frame_h * 1448 / 1086; + std::string body = "
" + + img("manager.scenes", frame_w, frame_h, false, false, 2048) + "
"; + for (const auto &scene : career_scenes) + body += ""; + const auto hint = career_hint_markup(career_hint_); + body += "
"; + // the demo lets one change who plays, as what, and on which ground the line-up is shown + std::string people, tasks; + if (!engine_mode_) { + for (const auto &person : c.at("active_managers")) { + const bool on = person.value("portrait", 0) == m.value("portrait", 0); + people += pg_button("career-manager", esc(person.value("name", "")), on ? "on" : "", "id=\"career-manager-" + std::to_string(person.value("portrait", 0)) + "\" data-id=\"" + std::to_string(person.value("portrait", 0)) + "\" aria-pressed=\"" + (on ? "true" : "false") + "\""); + } + for (const auto &role : c.at("available_roles")) { + const auto id = role.get(); + tasks += pg_button("career-role", id == "club" ? "Verein" : "Nationalmannschaft", c.at("role") == role ? "on" : "", "id=\"career-role-" + id + "\" data-id=\"" + id + "\" aria-pressed=\"" + (c.at("role") == role ? "true" : "false") + "\" " + (ended ? "disabled=\"disabled\"" : "")); + } + for (const auto *surface : {"outdoor", "indoor"}) + tasks += pg_button("career-surface", std::string(surface) == "indoor" ? "Halle" : "Rasen", c.at("surface") == surface ? "on" : "", "id=\"career-surface-" + std::string(surface) + "\" data-id=\"" + surface + "\" aria-pressed=\"" + + (c.at("surface") == surface ? "true" : "false") + "\" " + (ended || (std::string(surface) == "indoor" && c.at("role") == "national") ? "disabled=\"disabled\"" : "")); } - body += "
Aufstellung · Vorschau
"; - for (const auto *surface : {"outdoor", "indoor"}) { - if(engine_mode_&&c.at("surface")!=surface)continue; - body += btn("career-surface", - std::string(surface) == "indoor" ? (engine_mode_?"Halle · Wechselpaare":"Halle · 6 Spieler") - : "Rasen · 11 Spieler", - c.at("surface") == surface ? "selected" : "", - "id=\"career-surface-" + std::string(surface) + - "\" data-id=\"" + surface + "\" aria-pressed=\"" + - (c.at("surface") == surface ? "true" : "false") + "\" " + - (ended || engine_mode_ || (std::string(surface) == "indoor" && - c.at("role") == "national") - ? "disabled" - : "")); - } - body += "
"; + body += "
" + people + "
" + hint + + "
" + tasks + "
"; if (career_resign_open_ || career_game_end_) { - body = "
" + body + - "

" + - std::string(career_game_end_ ? "Spiel beendet" - : "Manageramt aufgeben?") + - "

"; + body = "
" + body + "

" + + std::string(career_game_end_ ? "Spiel beendet" : "Aufhören?") + "

"; if (career_game_end_) - body += "

Der letzte menschliche Mitspieler hat sein Amt abgegeben. " - "Zurück zum Hauptmenü.

" + - btn("career-game-end", "Zum Hauptmenü", {}, - "id=\"career-game-end\"") + - "
"; + body += "

Es ist kein menschlicher Manager mehr im Amt.

"; else { - std::vector> people; + std::vector> people_rows; for (const auto &person : c.at("active_managers")) { const auto *club = world_->find("clubs", person.value("club", "")); - people.emplace_back( - std::to_string(person.value("portrait", 0)), - person.value("name", "") + " · " + - ((engine_mode_?c.at("role")!="national":snap().state.at("edits").at("setup").value("league", true)) - ? (club ? world_->name(*club) : "") - : "Deutschland")); + people_rows.emplace_back(std::to_string(person.value("portrait", 0)), + person.value("name", "") + " · " + ((engine_mode_ ? c.at("role") != "national" : snap().state.at("edits").at("setup").value("league", true)) ? (club ? world_->name(*club) : "") : "Deutschland")); } - body += - "" + - select("career-resign-owner", people, - std::to_string(career_resign_portrait_), - "career-resign-owner") + - "

" + - (people.size() == 1 - ? "Du bist der letzte menschliche Mitspieler. Mit deiner " - "Bestätigung endet diese Partie." - : "Die anderen Menschen spielen weiter. Die KI übernimmt den " - "abgegebenen Verein in dieser Karrierevorschau.") + - "

" + - btn("career-resign-cancel", "Abbrechen", {}, - "id=\"career-resign-cancel\"") + - btn("career-resign-confirm", "Amt aufgeben", {}, - "id=\"career-resign-confirm\"") + - "
"; + body += "
" + select("career-resign-owner", people_rows, std::to_string(career_resign_portrait_), "career-resign-owner") + + "
" + + (people_rows.size() == 1 ? "Der Verein wird danach vom Computer geführt. Du bist der letzte menschliche Manager: Mit deiner Bestätigung ist das Spiel beendet." + : "Der Verein wird danach vom Computer geführt. Die anderen spielen weiter.") + + ""; } body += "
"; } diff --git a/src/modern/ui/controls.inc b/src/modern/ui/controls.inc index d907f70..5b3b461 100644 --- a/src/modern/ui/controls.inc +++ b/src/modern/ui/controls.inc @@ -479,6 +479,8 @@ void App::dispatch(const std::string &action, Rml::Element *target) { if (live_action(action, target)) return; if(national_action(action,target))return; if (career_action(action,target)) return; + // the manager's page is left by any other control of the notebook + if (scene_ == "managerhub" && !career_resign_open_ && !career_game_end_ && !action.starts_with("career-")) scene_ = "desktop"; if (entry_action(action, target)) return; if (opening_action(action, target)) return; if (settings_action(action,target)) return; diff --git a/src/modern/ui/engine_controls.inc b/src/modern/ui/engine_controls.inc index 1c343bf..bd83440 100644 --- a/src/modern/ui/engine_controls.inc +++ b/src/modern/ui/engine_controls.inc @@ -297,6 +297,13 @@ void App::engine_event(Rml::Event &event) { if (node->GetId() == "native-ticket-layer") return; // owned by the compact control if (ticket_ && ticket_->is_open()) return; if (amount_event(event)) return; + // the manager's page is left by any other control of the notebook + if(menu_=="newplayer"&&scene_=="managerhub"&&popup_.empty()&&type=="click"&&!engine_busy_&&!career_resign_open_&&!career_game_end_&&engine_manager_value_.is_object()&&engine_manager_value_.value("ended",false)!=true) + for(auto *n=target;n&&n!=doc_;n=n->GetParentNode())if(n->HasAttribute("data-action")&&!n->HasAttribute("disabled")) { + const auto action=n->GetAttribute("data-action",""); + if(!action.starts_with("career-")&&action!="close"){scene_="engine";menu_.clear();} + break; + } if(menu_=="newplayer"&&popup_.empty()) { if(engine_busy_){event.StopImmediatePropagation();return;} if(scene_=="manager") { diff --git a/src/modern/ui/engine_screens.inc b/src/modern/ui/engine_screens.inc index 303f4c0..83dad86 100644 --- a/src/modern/ui/engine_screens.inc +++ b/src/modern/ui/engine_screens.inc @@ -199,7 +199,7 @@ void App::engine_render() { if(menu_=="scorers")out+="
"+window("Spielerstatistiken",engine_rankings_value_.is_object()?render_scorers():"
"+esc(engine_busy_?"Spielerstatistiken werden geladen …":engine_notice_)+"
")+"
"; if(menu_=="fairplay")out+="
"+window("Fairplay",engine_fairplay_value_.is_object()?render_fairplay():"
"+esc(engine_busy_?"Fairplay wird geladen …":engine_notice_)+"
")+"
"; if(menu_=="other")out+="
"+window("Übrige Spiele",engine_other_value_.is_object()?render_reports("other"):"
"+esc(engine_busy_?"Wettbewerbe werden geladen …":engine_other_index_.is_object()?"Keine aktiven Wettbewerbe.":engine_notice_)+"
")+"
"; - if(menu_=="newplayer")out+="
"+(scene_=="manager"?render_manager():render_career())+"
"; + if(menu_=="newplayer")out+="
"+(scene_=="manager"?render_manager():render_career())+"
"; if(menu_=="settings")out+="
"+window("Einstellungen",render_settings())+"
"; if(menu_=="indoor")out+="
"+window("Hallentabellen",render_indoor())+"
"; if(menu_=="balance")out+="
"+window("Bilanz",render_balance())+"
"; diff --git a/src/modern/ui/notebook.inc b/src/modern/ui/notebook.inc index 7dbfb03..aa34479 100644 --- a/src/modern/ui/notebook.inc +++ b/src/modern/ui/notebook.inc @@ -134,7 +134,7 @@ std::string App::notebook_shell(const std::function & const auto paper = renderer_.texture("nb-paper", theme_, [&] { return notebook_texture(2, 1054, 650, materials[4], materials[5]); }); const bool light = theme_ == "silver"; const double stage = desktop_height(), top = notebook_top(); - const auto active = notebook_section_of(menu_); + const auto active = notebook_section_of(notebook_menu()); const auto open = [&](const std::string &route, const std::string &label, const std::string &css, const std::string &attrs, bool on) { return btn(engine_mode_ ? std::string("engine-open") : "open:" + route, label, css, attrs + " data-id=\"" + route + "\"" + (on ? "" : " disabled=\"disabled\"")); }; @@ -166,7 +166,7 @@ std::string App::notebook_shell(const std::function & const std::string attrs = "id=\"tab-" + std::string(section.id) + "\" aria-pressed=\"" + (here ? "true" : "false") + "\" style=\"top:" + scalar(265.5 + index * 186.0) + "dp;transform:translateX(" + (here ? std::string("-27") : std::to_string(rest[index % rest.size()])) + "dp) rotate(" + scalar(turns[index % turns.size()]) + "deg);\""; if (section.routes.empty()) out += btn("close", label, css, attrs); - else if (here) out += open(menu_, label, css, attrs, true); + else if (here) out += open(notebook_menu(), label, css, attrs, true); else out += open(first, label, css, attrs, !first.empty()); ++index; } @@ -204,7 +204,7 @@ std::string App::notebook_shell(const std::function & // the ground is one menu with two pages: the stadium and what stands around it const bool ground = std::string_view(r) == "stadium" || std::string_view(r) == "periphery"; const bool here = ground ? menu_ == "stadium" && (stadium_view_.value("view", std::string("inside")) == "panorama") == (std::string_view(r) == "periphery") - : part && engine_mode_ ? menu_ == "statistics" && statistics_page_ == r : menu_ == r; + : part && engine_mode_ ? menu_ == "statistics" && statistics_page_ == r : notebook_menu() == r; if (here) { kicker = std::string(section.label) + " · " + std::to_string(n + 1) + " / " + std::to_string(section.routes.size()); heading = notebook_page_label(r); @@ -226,7 +226,7 @@ std::string App::notebook_shell(const std::function & // with a panel of its own, never under bare writing or an older sheet // (the transfer market keeps it free; on the home page it shows while no card lies on the last two cells of the bottom row) bool stain = menu_ == "transfer" && page_native(); - if (menu_.empty()) { + if (notebook_menu().empty()) { stain = true; const auto &pages = notebook_pages().at("pages"); if (home_page_ >= 0 && home_page_ < int(pages.size())) @@ -278,7 +278,7 @@ Picture App::notebook_art() { {"lineup", "bench"}, {"tactics", "bench"}, {"contracts", "locker"}, {"transfer", "press"}, {"tables", "stand"}, {"league", "stand"}, {"other", "stand"}, {"strengths", "stand"}, {"statistics", "kickoff"}, {"scorers", "kickoff"}, {"fairplay", "kickoff"}}; - const auto found = motifs.find(menu_.empty() ? std::string("statistics") : menu_); + const auto found = motifs.find(notebook_menu().empty() ? std::string("statistics") : notebook_menu()); for (const std::string motif : {found == motifs.end() ? std::string("ball") : found->second, std::string("ball")}) { const auto art = renderer_.image("art.paper-" + motif + ".png", false, 2048); if (!art.token.empty() && art.width > 0 && art.height > 0) return art; diff --git a/src/modern/ui/pages.inc b/src/modern/ui/pages.inc index 753d687..ebffec8 100644 --- a/src/modern/ui/pages.inc +++ b/src/modern/ui/pages.inc @@ -5,6 +5,7 @@ // The menus that are laid out as a page of the notebook. Every other career menu is still a // sheet of the old format, shown scaled inside the book. bool App::page_native() const { + if (scene_ == "managerhub") return true; static const std::set native{"camp", "toto", "settings", "save", "load", "stadium", "statistics", "news", "transfer", "training", "almanac", "tactics", "achievements", "highscore", "balance", "contracts", "environment", "tables", "league", "other", "strengths", "fairplay", "indoor", "scorers"}; if (menu_ == "calendar" || menu_ == "postpone" || menu_ == "lineup") return notebook_page() && engine_mode_; // a national coach arranges friendlies on the older sheet diff --git a/src/modern/ui/view.cpp b/src/modern/ui/view.cpp index 74f1e52..79ece93 100644 --- a/src/modern/ui/view.cpp +++ b/src/modern/ui/view.cpp @@ -916,7 +916,9 @@ class App final : public Rml::EventListener { // what the page says in the heading of the sheet instead of its plain name, and after it std::string page_title_, page_hint_; // a career menu is a page of the notebook, not a window of its own - bool notebook_page() const { return (scene_ == "desktop" || scene_ == "engine") && !menu_.empty(); } + // the manager's page is a scene of its own; for the book it is the page "newplayer" + std::string notebook_menu() const { return scene_ == "managerhub" ? std::string("newplayer") : menu_; } + bool notebook_page() const { return (scene_ == "desktop" || scene_ == "engine" || scene_ == "managerhub") && !notebook_menu().empty(); } bool calendar_month_action(const std::string &, Rml::Element *); void calendar_open_month(int); Json planning_calendar() const; @@ -1012,6 +1014,7 @@ class App final : public Rml::EventListener { bool entry_event(Rml::Event &); Json entry_snapshot() const; bool career_resign_open_=false,career_game_end_=false; + std::string career_hint_; // the scene of the manager's picture the pointer is on int career_resign_portrait_=0; uint64_t career_resign_revision_=0; const DataSource *career_resign_source_=nullptr; @@ -1070,7 +1073,7 @@ class App final : public Rml::EventListener { if (!wanted) window_shown_ = "\x01"; // 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 - const bool desk = !wanted && (scene_ == "engine" || scene_ == "desktop"); + const bool desk = !wanted && (scene_ == "engine" || scene_ == "desktop" || scene_ == "managerhub"); if (wanted == window_zoom_ && desk == desk_top_) return; window_zoom_ = wanted; desk_top_ = desk; @@ -1088,7 +1091,7 @@ class App final : public Rml::EventListener { canvas_top_ = (ph - 2160 * scale_) / 2; 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 - const bool desk_scene = scene_ == "engine" || scene_ == "desktop"; + const bool desk_scene = scene_ == "engine" || scene_ == "desktop" || scene_ == "managerhub"; 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; if (stage_height != desktop_height()) { @@ -1202,7 +1205,7 @@ class App final : public Rml::EventListener { else if (scene_ == "manager") markup = (adding_manager_?render_desktop():main_menu())+"
"+render_manager()+"
"; else if (scene_ == "managerhub") - markup = render_desktop()+"
"+render_career()+"
"; + markup = render_desktop()+"
"+render_career()+"
"; else if (scene_ == "opening") markup = main_menu()+"
"+render_opening()+"
"; else if (scene_ == "live") @@ -1224,7 +1227,7 @@ class App final : public Rml::EventListener { doc_->QuerySelectorAll(behind, "#entry-manager-underlay button,#entry-manager-underlay input,#entry-manager-underlay select,.window>.titlebar button"); for (auto *node : behind) node->SetProperty("pointer-events", "none"); } - if(scene_=="managerhub" || (scene_=="manager"&&adding_manager_)){ + if(scene_=="manager"&&adding_manager_){ Rml::ElementList background;doc_->QuerySelectorAll(background,".desktop-layer button,.desktop-layer [data-action]"); for(auto *node:background){node->SetProperty("pointer-events","none");node->SetAttribute("tabindex",-1);} }