After the design mock-up: a leather-bound book with a seam, a stack of sheets, markers at the left edge for nine categories and at the top edge for their pages, a paper clip, a pencil in its loop, and the whistle that kicks off. Wood, leather and paper are computed from noise and tinted by the skin. The home pages carry the cards on a grid of 8 x 5: up to five pages that can be named, cards moved by dragging, menus with the right mouse button for sizes, adding and removing. The cards are drawn anew from one model that the demo and the engine both fill. The career menus are sheets of the book for now, in their old format; the picture of a page's subject lies very faintly on the paper of every page. The status line at the foot is gone. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
268 lines
28 KiB
C++
268 lines
28 KiB
C++
// SPDX-License-Identifier: GPL-3.0-only
|
|
namespace {
|
|
std::string engine_text(const Json &v) {
|
|
return v.is_string() ? v.get<std::string>() : v.is_object() ? v.value("text", "") : "—";
|
|
}
|
|
std::string engine_price(const Json &v) {
|
|
return money(engine_money_minor(v), {{"code", "EUR"}, {"minor_units", 2}});
|
|
}
|
|
}
|
|
Json App::engine_camp_view() const {
|
|
const auto art = Json::parse(editor::read_file(gui_.root() / "gui-assets.json")).at("demo");
|
|
const auto &data = engine_data_.at("camps").at("data");
|
|
Json camps = Json::array(), maps = Json::array();
|
|
for (const auto &map : data.at("maps"))
|
|
maps.push_back({{"id", map.at("id")}, {"name", engine_text(map.at("name"))}});
|
|
for (const auto &item : data.at("camps")) {
|
|
const auto &q = item.at("quality");
|
|
Json camp = {{"id", item.at("id")}, {"map", item.at("mapId")},
|
|
{"name", engine_text(item.at("name"))}, {"place", item.at("place")},
|
|
{"quality", {q.at("pitch"), q.at("fitness"), q.at("catering"), q.at("lodging")}},
|
|
{"price", nullptr}, {"gui_image", ""}, {"positioned", false}};
|
|
// GUI placement is presentation metadata only. Never copy prices, quality,
|
|
// focus or booking rules from the GUI resource catalogue into a real career.
|
|
for (const auto &ref : art.at("training_camps"))
|
|
if (ref.at("id") == item.at("id") && ref.at("map") == item.at("mapId")) {
|
|
camp["x"] = ref.at("x"); camp["y"] = ref.at("y"); camp["positioned"] = true;
|
|
}
|
|
if (item.at("position").is_object()) {
|
|
camp["x"] = item.at("position").at("x"); camp["y"] = item.at("position").at("y"); camp["positioned"] = true;
|
|
}
|
|
auto image = item.value("guiImageKey", "");
|
|
if (image.starts_with("gui:camp/")) camp["gui_image"] = "camp." + image.substr(9);
|
|
if (item.at("quote").is_object()) camp["price"] = engine_money_minor(item.at("quote").at("total"));
|
|
camps.push_back(std::move(camp));
|
|
}
|
|
return {{"maps", maps}, {"training_camps", camps}};
|
|
}
|
|
void App::engine_render() {
|
|
if(menu_=="save"||menu_=="load"||!files_mode_.empty())files_before_render();
|
|
if (ticket_) ticket_->close(false);
|
|
if(menu_=="scorers"||menu_=="fairplay")rankings_remember_scroll();
|
|
if(menu_=="statistics")statistics_remember_scroll();
|
|
fixture_half_width_=-1.f;
|
|
almanac_list_width_=-1.f;
|
|
if (menu_ == "settings") { settings_remember_scroll(); last_rendered_menu_ = menu_; }
|
|
if (menu_ == "friendlies") if (auto *list = element("friendly-opponents")) engine_friendly_scroll_ = list->GetScrollTop();
|
|
if (menu_ == "contracts") if (auto *roster = element("contracts-roster-scroll")) engine_contract_scroll_ = roster->GetScrollTop();
|
|
if (menu_ == "lineup") {
|
|
if (auto *roster = element("lineup-roster-scroll")) lineup_roster_scroll_ = lineup_reset_scroll_ ? 0.f : roster->GetScrollTop();
|
|
lineup_reset_scroll_ = false;
|
|
}
|
|
doc_->SetClassNames(body_classes());
|
|
std::string out;
|
|
if (engine_data_.empty()) {
|
|
out = "<div class=\"fill center\"><div class=\"panel\" style=\"padding:70dp;\"><h1>Dreierpack Manager</h1><p>" +
|
|
esc(engine_busy_ ? "Spielstand wird geladen …" : engine_notice_) + "</p></div></div>";
|
|
} else if (scene_ == "live" && live_.available()) {
|
|
out = render_live();
|
|
} else if(engine_opening_active()&&menu_.empty()) {
|
|
out=main_menu()+"<div class=\"fill\" style=\"z-index:100;\">"+render_opening()+"</div>";
|
|
} else {
|
|
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");
|
|
// the bar carries the club's colour as a line along its foot
|
|
std::string club_line;
|
|
if (const auto *club = world_->find("clubs", team.at("id").get<std::string>()); club && !club->value("crest", "").empty())
|
|
if (const auto colour = renderer_.crest_colour(club->value("crest", "")); !colour.empty()) club_line = " style=\"border-bottom:8dp " + colour + ";\"";
|
|
std::string next_match;
|
|
if (desk.at("nextFixture").is_object()) {
|
|
const auto &next = desk.at("nextFixture");
|
|
const bool at_home = next.at("home").at("id") == team.at("id");
|
|
next_match = "<span class=\"nb-tag\">Nächstes Spiel: " + esc(engine_text(next.at(at_home ? "away" : "home").at("name"))) + (at_home ? " (H)" : " (A)") + "</span>";
|
|
}
|
|
const std::string head = "<span class=\"nb-head-date\">" + esc(ui_long_date(meta.at("date").get<std::string>())) + "</span><div class=\"nb-head-tags\">" + next_match + "<span class=\"nb-tag plain\" id=\"engine-cash\">" +
|
|
esc(engine_price(desk.at("accounts").at("cash"))) + "</span></div>";
|
|
(void)club_line;
|
|
// which pages can be opened now, and the widgets of the home page
|
|
std::map<std::string, bool> route_open;
|
|
std::string home;
|
|
bool lineup_available = false;
|
|
try { (void)engine_lineup_projection(engine_data_); lineup_available = true; } catch (const std::exception &) {}
|
|
bool training_available = false, tactics_available = false;
|
|
try { (void)engine_training_projection(engine_data_); training_available = true; } catch (const std::exception &) {}
|
|
try { (void)engine_tactics_projection(engine_data_); tactics_available = true; } catch (const std::exception &) {}
|
|
bool bank_available = false, ticket_available = false;
|
|
try { (void)engine_bank_projection(engine_data_); bank_available = true; } catch (const std::exception &) {}
|
|
try { (void)engine_ticket_projection(engine_data_); ticket_available = true; } catch (const std::exception &) {}
|
|
const auto allowed = meta.at("scope").value("allowedCommands", Json::array());
|
|
bank_available = bank_available && std::find(allowed.begin(), allowed.end(), Json("bank.commit")) != allowed.end();
|
|
ticket_available = ticket_available && std::find(allowed.begin(), allowed.end(), Json("ticket.commit")) != allowed.end();
|
|
bool environment_available = false, advertising_available = false;
|
|
try { (void)engine_environment_projection(engine_data_); environment_available = true; } catch (const std::exception &) {}
|
|
try { (void)engine_advertising_projection(engine_data_); advertising_available = true; } catch (const std::exception &) {}
|
|
environment_available = environment_available && std::find(allowed.begin(), allowed.end(), Json("environment.commit")) != allowed.end();
|
|
advertising_available = advertising_available && (std::find(allowed.begin(), allowed.end(), Json("advertising.accept")) != allowed.end() || std::find(allowed.begin(), allowed.end(), Json("budget.commit")) != allowed.end());
|
|
bool contracts_available = false;
|
|
try { (void)engine_contracts_projection(engine_data_); contracts_available = true; } catch (const std::exception &) {}
|
|
bool calendar_available = false, scheduling_available = false;
|
|
try { (void)engine_calendar_projection(engine_data_); calendar_available = true; } catch (const std::exception &) {}
|
|
try { scheduling_available = engine_scheduling_projection(engine_data_).at("allowed"); } catch (const std::exception &) {}
|
|
bool friendlies_available = false;
|
|
try { (void)engine_friendly_plan(engine_data_); friendlies_available = true; } catch (const std::exception &) {}
|
|
init_desktop();
|
|
for (const auto &[id, o] : desktop_.at("objects").items()) {
|
|
if (!o.value("visible", false) || id == "trash") continue;
|
|
if (meta.at("scope").at("role") == "national" &&
|
|
(id == "account" || id == "warnings" || id == "fans" || id == "results" ||
|
|
id == "own-curve" || id == "opponent-curve" || id == "comparison-curve")) continue;
|
|
const auto style = rect(o.at("x"), o.at("y"), o.at("w"), o.at("h"));
|
|
if (o.value("widget", false)) {
|
|
std::string body = engine_widget(id, o);
|
|
if (id == "portrait") {
|
|
auto portrait = person.value("portraitGuiKey", "");
|
|
if (portrait.starts_with("gui:manager/photo/"))
|
|
body = img("manager." + portrait.substr(18), o.at("w"), o.at("h"), false, false, 768);
|
|
else if(portrait.starts_with("gui:manager/painted/"))body=img("manager-painted."+portrait.substr(20),o.at("w"),o.at("h"),false,false,768);
|
|
body += "<div class=\"desk-portrait-caption\"><small>Manager</small><strong>" + esc(person.at("name").get<std::string>()) + "</strong></div>";
|
|
} else if (id == "calendar") {
|
|
const auto date = meta.at("date").get<std::string>();
|
|
const int y = std::stoi(date.substr(0, 4)), m = std::stoi(date.substr(5, 2)), d = std::stoi(date.substr(8, 2));
|
|
const auto ymd = std::chrono::year_month_day{std::chrono::year(y), std::chrono::month(unsigned(m)), std::chrono::day(unsigned(d))};
|
|
if (!ymd.ok()) throw editor::Error("Ungültiges Engine-Datum.");
|
|
const std::array<const char *, 12> months{"Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"};
|
|
const std::array<const char *, 7> weekdays{"Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"};
|
|
body = "<div class=\"desk-calendar-month\"><span>" + std::string(months[size_t(m - 1)]) + " " + std::to_string(y) + "</span></div><div class=\"desk-calendar-body\"><span>" + weekdays[std::chrono::weekday{std::chrono::sys_days(ymd)}.c_encoding()] + "</span><strong>" + std::to_string(d) + "</strong><small>" + esc(meta.at("season").at("label").get<std::string>()) + "</small></div>";
|
|
} else if (id == "account") {
|
|
const auto savings = bank_available ? engine_data_.at("bank").at("data").at("accounts").at("deposit") : desk.at("accounts").at("savings");
|
|
body = widget_heading("Vereinskasse", false) + "<div class=\"desk-account-main\"><span>Guthaben</span><strong class=\"" + money_classes(engine_money_minor(desk.at("accounts").at("cash"))) + "\">" + esc(engine_price(desk.at("accounts").at("cash"))) + "</strong></div><div class=\"desk-account-bottom\"><div><span>Sparbuch</span><strong>" + (savings.is_null() ? std::string("—") : esc(engine_price(savings))) + "</strong></div>" + btn("engine-ticket", glyph("ticket", 36) + "<span><span>Eintritt</span><strong>" + (ticket_available ? esc(engine_price(engine_data_.at("stadium").at("data").at("ticketPrice"))) : std::string("—")) + "</strong></span>", "desk-ticket", "id=\"account-ticket\" " + std::string(ticket_available && engine_fresh_ && !engine_busy_ ? "" : "disabled")) + "</div>";
|
|
} else if (id == "crest") {
|
|
body = widget_heading("Dein Verein", false) + "<div class=\"center\" style=\"padding:30dp;\">" + engine_widget_crest(team, 220) + "<p>" + esc(engine_text(team.at("name"))) + "</p></div>";
|
|
} else if (id == "opponent-crest" && desk.at("nextFixture").is_object()) {
|
|
const auto &next = desk.at("nextFixture");
|
|
const auto &other = next.at(next.at("home").at("id") == team.at("id") ? "away" : "home");
|
|
body = widget_heading("Nächster Gegner", false) + "<div class=\"center\" style=\"padding:30dp;\">" + engine_widget_crest(other, 220) + "<p>" + esc(engine_text(other.at("name"))) + "</p></div>";
|
|
}
|
|
if (!body.empty()) {
|
|
std::string size = "s";
|
|
for (const auto &definition : widget_catalogue()) if (definition.at("id") == id)
|
|
for (const auto &[key, span] : definition.at("spans").items())
|
|
if (o.at("w") == span[0].get<int>() * 248 - 24 && o.at("h") == span[1].get<int>() * 248 - 24) size = key;
|
|
const auto route = id == "calendar" || id == "competition" ? std::string("calendar") : std::string();
|
|
home += "<div id=\"object-" + esc(id) + "\" class=\"desktop-card desk-card\" data-widget=\"" + esc(id) + "\" data-size=\"" + size + "\" " +
|
|
(route.empty() ? "" : "data-engine-route=\"" + route + "\" data-action=\"engine-open\" data-id=\"" + route + "\" tabindex=\"0\" role=\"button\" ") +
|
|
"style=\"" + style + "\">" + body + "</div>";
|
|
}
|
|
} else {
|
|
const auto route = id.substr(4);
|
|
const bool camp_allowed = desk.at("menuAvailability").at("camps").value("status", "") == "available";
|
|
const auto commands = meta.at("scope").value("allowedCommands", Json::array());
|
|
const bool supported = (route=="newplayer"&&engine_fresh_&&engine_manager_value_.is_object()) || (route=="settings"&&engine_fresh_&&engine_settings_value_.is_object()) || (route=="indoor"&&engine_fresh_&&engine_indoor_value_.is_object()) || ((route=="tables"||route=="strengths"||route=="league"||route=="other"||route=="scorers"||route=="fairplay")&&engine_fresh_&&meta.at("scope").at("role")=="club") || (route == "almanac" && engine_fresh_) || (route == "friendlies" && friendlies_available && engine_fresh_) || (route == "calendar" && calendar_available && engine_fresh_) || (route == "postpone" && scheduling_available && engine_fresh_) || (route == "contracts" && contracts_available && engine_fresh_) || (route == "environment" && environment_available && engine_fresh_) || (route == "advertising" && advertising_available && engine_fresh_) || (route == "bank" && bank_available && engine_fresh_) || (route == "training" && training_available && engine_fresh_) || (route == "tactics" && tactics_available && engine_fresh_) || (route == "lineup" && lineup_available && engine_fresh_) || (route=="balance"&&engine_fresh_&&engine_data_.at("balance").value("messageType","")=="snapshot") || (route=="news"&&engine_fresh_&&engine_news_value_.is_object()) || (route=="achievements"&&engine_fresh_&&engine_data_.at("achievements").value("messageType","")=="snapshot"&&engine_data_.at("achievements").at("data").at("available")==true) || (route=="transfer"&&engine_fresh_&&engine_transfer_value_.is_object()) || (route=="stadium"&&engine_fresh_&&engine_stadium_value_.is_object()) || (route=="toto"&&engine_fresh_&&engine_toto_value_.is_object()) || (route=="statistics"&&engine_fresh_) || route == "save" || route == "load" || (route == "kickoff" && engine_fresh_ && std::find(commands.begin(), commands.end(), Json("session.advance")) != commands.end()) || (route == "camp" && engine_fresh_ && camp_allowed && std::find(commands.begin(), commands.end(), Json("camp.book")) != commands.end());
|
|
route_open[route] = (supported && !engine_busy_ && (!engine_manager_value_.is_object() || engine_manager_value_.at("ended")!=true || route=="save" || route=="load" || route=="newplayer"));
|
|
}
|
|
}
|
|
out = notebook_shell([&](const std::string &route) { const auto found = route_open.find(route); return found != route_open.end() && found->second; }, head);
|
|
(void)home;
|
|
if (menu_.empty()) {
|
|
// the home page: the values of its cards
|
|
const auto date = meta.at("date").get<std::string>();
|
|
const int y = std::stoi(date.substr(0, 4)), mo = std::stoi(date.substr(5, 2)), d = std::stoi(date.substr(8, 2));
|
|
const auto ymd = std::chrono::year_month_day{std::chrono::year(y), std::chrono::month(unsigned(mo)), std::chrono::day(unsigned(d))};
|
|
static constexpr std::array<const char *, 12> months{"Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"};
|
|
static constexpr std::array<const char *, 7> weekdays{"Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"};
|
|
const bool club_role = meta.at("scope").at("role") == "club";
|
|
Json model = {{"day", d}, {"weekday", ymd.ok() ? weekdays[std::chrono::weekday{std::chrono::sys_days(ymd)}.c_encoding()] : ""}, {"month", std::string(months[size_t(std::clamp(mo, 1, 12) - 1)]) + " " + std::to_string(y)},
|
|
{"note", "Saison " + meta.at("season").at("label").get<std::string>()}, {"cash", engine_price(desk.at("accounts").at("cash"))}, {"savings", nullptr}, {"ticket", nullptr}, {"ticket_action", "engine-ticket"},
|
|
{"fixture", nullptr}, {"own", {{"name", engine_text(team.at("name"))}, {"team", team}, {"rank", "—"}, {"strength", "—"}}}, {"opponent", nullptr}, {"own_curve", Json::array()}, {"opponent_curve", Json::array()},
|
|
{"results", Json::array()}, {"warnings", Json::array()}, {"fans", nullptr}, {"news", engine_news_value_.is_object() ? notebook_news() : Json(nullptr)}, {"portrait", ""},
|
|
{"manager", engine_text(person.at("name"))}, {"duels", nullptr}};
|
|
const auto savings = bank_available ? engine_data_.at("bank").at("data").at("accounts").at("deposit") : desk.at("accounts").at("savings");
|
|
if (!savings.is_null()) model["savings"] = engine_price(savings);
|
|
if (ticket_available) model["ticket"] = engine_price(engine_data_.at("stadium").at("data").at("ticketPrice"));
|
|
if (const auto portrait = person.value("portraitGuiKey", std::string()); portrait.starts_with("gui:manager/photo/")) model["portrait"] = "manager." + portrait.substr(18);
|
|
else if (portrait.starts_with("gui:manager/painted/")) model["portrait"] = "manager-painted." + portrait.substr(20);
|
|
try {
|
|
const auto data = engine_widgets_projection(engine_data_);
|
|
const auto text = [](const Json &v) { return v.is_null() ? std::string("—") : std::to_string(v.get<int>()); };
|
|
model["own"]["rank"] = text(data.at("own").at("rank"));
|
|
model["own"]["strength"] = text(data.at("own").at("strength"));
|
|
if (data.at("fixture").is_object()) {
|
|
const auto &next = data.at("fixture");
|
|
const bool at_home = next.at("home").at("id") == data.at("own").at("teamId");
|
|
model["fixture"] = {{"home", {{"name", engine_text(next.at("home").at("name"))}, {"team", next.at("home")}}}, {"away", {{"name", engine_text(next.at("away").at("name"))}, {"team", next.at("away")}}},
|
|
{"competition", engine_text(next.at("competition"))}, {"venue", at_home ? "Heimspiel" : "Auswärtsspiel"}};
|
|
if (data.at("opponent").is_object()) {
|
|
const auto &other = next.at(at_home ? "away" : "home");
|
|
model["opponent"] = {{"name", engine_text(other.at("name"))}, {"team", other}, {"rank", text(data.at("opponent").at("rank"))}, {"strength", text(data.at("opponent").at("strength"))}};
|
|
}
|
|
}
|
|
if (club_role) {
|
|
if (data.at("rankCurve").is_array()) model["own_curve"] = data.at("rankCurve");
|
|
if (data.at("recent").is_array()) model["results"] = data.at("recent");
|
|
model["warnings"] = notebook_lamps(data.at("warnings"));
|
|
}
|
|
} catch (const std::exception &) {
|
|
}
|
|
out += notebook_home(model);
|
|
}
|
|
if(menu_=="save"||menu_=="load")out+="<div class=\"fill menu-layer\" style=\"z-index:100;\">"+window(menu_=="save"?"Spiel speichern":"Spiel laden",render_files(false,menu_=="save"))+"</div>";
|
|
if(menu_=="scorers")out+="<div class=\"fill menu-layer\" style=\"z-index:100;\">"+window("Spielerstatistiken",engine_rankings_value_.is_object()?render_scorers():"<div class=\"fill center\">"+esc(engine_busy_?"Spielerstatistiken werden geladen …":engine_notice_)+"</div>")+"</div>";
|
|
if(menu_=="fairplay")out+="<div class=\"fill menu-layer\" style=\"z-index:100;\">"+window("Fairplay",engine_fairplay_value_.is_object()?render_fairplay():"<div class=\"fill center\">"+esc(engine_busy_?"Fairplay wird geladen …":engine_notice_)+"</div>")+"</div>";
|
|
if(menu_=="other")out+="<div class=\"fill menu-layer\" style=\"z-index:100;\">"+window("Übrige Spiele",engine_other_value_.is_object()?render_reports("other"):"<div class=\"fill center\">"+esc(engine_busy_?"Wettbewerbe werden geladen …":engine_other_index_.is_object()?"Keine aktiven Wettbewerbe.":engine_notice_)+"</div>")+"</div>";
|
|
if(menu_=="newplayer")out+="<div class=\"fill\" style=\"z-index:100;\">"+(scene_=="manager"?render_manager():render_career())+"</div>";
|
|
if(menu_=="settings")out+="<div class=\"fill menu-layer\" style=\"z-index:100;\">"+window("Einstellungen",render_settings())+"</div>";
|
|
if(menu_=="indoor")out+="<div class=\"fill menu-layer\" style=\"z-index:100;\">"+window("Hallentabellen",render_indoor())+"</div>";
|
|
if(menu_=="balance")out+="<div class=\"fill menu-layer\" style=\"z-index:100;\">"+window("Bilanz",render_balance())+"</div>";
|
|
if(menu_=="news")out+="<div class=\"fill\" style=\"z-index:100;\">"+render_news()+"</div>";
|
|
if(menu_=="achievements")out+="<div class=\"fill menu-layer\" style=\"z-index:100;\">"+window("Erfolge",render_achievements())+"</div>";
|
|
if(menu_=="transfer")out+="<div class=\"fill menu-layer\" style=\"z-index:100;\">"+window("Transfers",render_transfer())+"</div>";
|
|
if(menu_=="stadium")out+="<div class=\"fill menu-layer\" style=\"z-index:100;\">"+window("Stadion",render_stadium())+"</div>";
|
|
if(menu_=="toto")out+="<div class=\"fill menu-layer\" style=\"z-index:100;\">"+window("Toto",render_toto())+"</div>";
|
|
if(menu_=="statistics")out+="<div class=\"fill menu-layer\" style=\"z-index:100;\">"+window("Statistiken",engine_statistics_value_.is_object()?render_statistics():"<div class=\"fill center\">"+esc(engine_busy_?"Statistik wird geladen …":engine_notice_)+"</div>")+"</div>";
|
|
if(menu_=="league")out+="<div class=\"fill menu-layer\" style=\"z-index:100;\">"+window("Ligaspiele",engine_fixtures_value_.is_object()?render_reports("league"):"<div class=\"fill center\">"+esc(engine_busy_?"Ligaspiele werden geladen …":engine_notice_)+"</div>")+"</div>";
|
|
if(menu_=="tables"||menu_=="strengths")out+="<div class=\"fill menu-layer\" style=\"z-index:100;\">"+window(menu_=="tables"?"Tabelle":"Stärken",engine_reports_read_.is_object()?render_reports(menu_):"<div class=\"fill center\">"+esc(engine_busy_?"Ligabericht wird geladen …":engine_notice_)+"</div>")+"</div>";
|
|
if(menu_=="almanac") out+="<div class=\"fill menu-layer\" style=\"z-index:100;\">"+window("Almanach",engine_almanac_cache_.contains("index")?render_almanac():"<div class=\"fill center\">"+esc(engine_busy_?"Spielarchiv wird geladen …":engine_notice_)+"</div>")+"</div>";
|
|
if (menu_ == "friendlies") out += "<div class=\"fill menu-layer\" style=\"z-index:100;\">" + window("Freundschaftsspiel", friendlies_available ? render_friendlies() : "<div class=\"fill center\">Freundschaftsplanung ist derzeit nicht verfügbar.</div>") + "</div>";
|
|
if (menu_ == "calendar") out += "<div class=\"fill menu-layer\" style=\"z-index:100;\">" + window("Kalender", calendar_available ? render_calendar() : "<div class=\"fill center\">Der Saisonkalender ist derzeit nicht verfügbar.</div>") + "</div>";
|
|
if (menu_ == "postpone") out += "<div class=\"fill menu-layer\" style=\"z-index:100;\">" + window("Verlegen", scheduling_available ? render_postpone() : "<div class=\"fill center\">Die Spielverlegung ist derzeit nicht verfügbar.</div>") + "</div>";
|
|
if (menu_ == "contracts") out += "<div class=\"fill menu-layer\" style=\"z-index:100;\">" + window("Verträge", render_contracts()) + "</div>";
|
|
if (menu_ == "environment") out += "<div class=\"fill menu-layer\" style=\"z-index:100;\">" + window("Umfeld", render_environment()) + "</div>";
|
|
if (menu_ == "advertising") out += "<div class=\"fill menu-layer\" style=\"z-index:100;\">" + window("Werbung", render_advertising()) + "</div>";
|
|
if (menu_ == "bank") out += "<div class=\"fill menu-layer\" style=\"z-index:100;\">" + window("Bank", render_bank()) + "</div>";
|
|
if (menu_ == "training") out += "<div class=\"fill menu-layer\" style=\"z-index:100;\">" + window("Training", render_training()) + "</div>";
|
|
if (menu_ == "tactics") out += "<div class=\"fill menu-layer\" style=\"z-index:100;\">" + window("Taktik", render_tactics()) + "</div>";
|
|
if (menu_ == "lineup") out += "<div class=\"fill menu-layer\" style=\"z-index:100;\">" + window("Aufstellung", render_lineup()) + "</div>";
|
|
if (menu_ == "camp") out += "<div class=\"fill menu-layer\" style=\"z-index:100;\">" + window("Trainingslager", render_camp()) + "</div>";
|
|
}
|
|
if ((menu_ == "stadium" || menu_ == "bank" || menu_ == "environment" || menu_ == "advertising" || menu_ == "contracts" || menu_ == "calendar" || menu_ == "postpone" || menu_ == "friendlies" || menu_ == "almanac" || menu_=="tables" || menu_=="strengths" || menu_=="league" || menu_=="other" || menu_=="scorers" || menu_=="fairplay") && !amount_ && contracts_dialog_.empty() && planning_dialog_.empty()) out += "<div class=\"panel\" style=\"position:absolute;bottom:12dp;left:700dp;right:700dp;padding:9dp;font-size:28dp;z-index:110;\" id=\"engine-status\">" + esc(engine_busy_ ? engine_operation_ : engine_notice_) + "</div>";
|
|
if ((menu_.empty() || engine_data_.empty()) && !(scene_ == "live" && live_.available())) out += "<div class=\"panel\" style=\"position:absolute;left:850dp;bottom:24dp;right:100dp;padding:18dp;font-size:28dp;\" id=\"engine-status\">" + esc(engine_busy_ ? engine_operation_ : engine_notice_) + "</div>";
|
|
if(menu_=="statistics")out+=render_statistics_trophy();
|
|
element("canvas")->SetProperty("overflow",statistics_trophy_.contains("asset")?"visible":"hidden");
|
|
setting_menu_markup_ = true;
|
|
element("canvas")->SetInnerRML(out); ++document_generation_;
|
|
setting_menu_markup_ = false;
|
|
sync_window_zoom();
|
|
live_detail_pending_ = live_ticker_pending_ = false;
|
|
scale_chalk_shadow();
|
|
if (!engine_player_.empty()) {
|
|
Rml::ElementList underlay; doc_->QuerySelectorAll(underlay, "#lineup-underlay button,#window-close");
|
|
for (auto *node : underlay) { node->SetAttribute("disabled", true); node->SetProperty("pointer-events", "none"); }
|
|
}
|
|
const auto size = context_->GetDimensions();
|
|
element("background")->SetInnerRML(img("background", size.x / scale_, size.y / scale_, false, true, 2048));
|
|
element("background")->SetProperty("filter", theme_ == "silver" ? "saturate(0.2) brightness(0.9)" : theme_ == "matchday" ? "saturate(0.13) brightness(0.56)" : "saturate(0.34) brightness(0.70)");
|
|
if (!contracts_dialog_.empty()) {
|
|
Rml::ElementList underlay; doc_->QuerySelectorAll(underlay, "#contracts-underlay button,.contracts-actions button,#window-close");
|
|
for (auto *node : underlay) { node->SetAttribute("disabled", true); node->SetProperty("pointer-events", "none"); }
|
|
}
|
|
if (!planning_dialog_.empty() && menu_ == "friendlies") {
|
|
Rml::ElementList underlay; doc_->QuerySelectorAll(underlay,"#report-underlay button,#report-underlay select,#window-close");
|
|
for (auto *node : underlay) { node->SetAttribute("disabled",true); node->SetProperty("pointer-events","none"); }
|
|
}
|
|
if (amount_) {
|
|
Rml::ElementList underlay; doc_->QuerySelectorAll(underlay, ".window>.content,.window>.titlebar");
|
|
for (auto *node : underlay) { node->SetProperty("pointer-events", "none"); node->SetProperty("filter", "blur(10dp)"); }
|
|
}
|
|
if(!report_detail_kind_.empty()&&(menu_=="indoor"||menu_=="tables"||menu_=="strengths"||menu_=="league"||menu_=="other"||menu_=="scorers"||menu_=="fairplay"||menu_=="statistics")){Rml::ElementList nodes;doc_->QuerySelectorAll(nodes,"#report-underlay button,.rankings-scorers button,.rankings-fairplay button,.statistics-native button,#window-close");for(auto *n:nodes){n->SetAttribute("disabled",true);n->SetProperty("pointer-events","none");}}
|
|
if(menu_=="stadium"&&stadium_view_.value("dialog",std::string())!=""){Rml::ElementList nodes;doc_->QuerySelectorAll(nodes,"#stadium-underlay button,.window>.titlebar button");for(auto *n:nodes){n->SetAttribute("disabled",true);n->SetProperty("pointer-events","none");}}
|
|
if(!toto_dialog_.empty()){Rml::ElementList nodes;doc_->QuerySelectorAll(nodes,"#toto-underlay button,.window>.titlebar button");for(auto *n:nodes){n->SetAttribute("disabled",true);n->SetProperty("pointer-events","none");}}
|
|
if(statistics_trophy_.contains("asset")){Rml::ElementList nodes;doc_->QuerySelectorAll(nodes,".window button,.window input");for(auto *n:nodes)n->SetAttribute("disabled",true);}
|
|
if(menu_=="achievements"&&career_view_.value("dialog",std::string())=="history"){Rml::ElementList nodes;doc_->QuerySelectorAll(nodes,"#career-report-underlay button,#window-close");for(auto*n:nodes){n->SetAttribute("disabled",true);n->SetProperty("pointer-events","none");}}
|
|
if(menu_=="transfer"&&!transfer_dialog_.empty()){Rml::ElementList nodes;doc_->QuerySelectorAll(nodes,".transfer-overview button,.transfer-overview input,#window-close");for(auto*n:nodes){n->SetAttribute("disabled",true);n->SetProperty("pointer-events","none");}if(transfer_dialog_=="search"){for(auto*id:{"transfer-criterion-foot","transfer-criterion-type","transfer-search-trait-0","transfer-search-trait-1","transfer-search-trait-2"})if(auto*n=element(id))n->SetAttribute("disabled",true);}}
|
|
if (engine_busy_) {
|
|
Rml::ElementList controls; doc_->QuerySelectorAll(controls, "#canvas button,#canvas input");
|
|
for (auto *node : controls) node->SetAttribute("disabled", true);
|
|
}
|
|
needs_render_ = false; dirty_ = true;
|
|
}
|