";
} else {
const auto route = id.substr(4);
const std::array colors = {
"#3d789b", "#375a83", "#477c73", "#42846b", "#a58a49", "#586ba0",
"#517d71", "#668a98", "#af6860", "#6b809c", "#657cb3", "#507b9c",
"#559b76", "#a7474e", "#967d50", "#648f91", "#54856b", "#558f93",
"#6379a3", "#788598", "#8d7856", "#a66d64", "#748474", "#6887a2",
"#6b9270", "#7c8b9c", "#ac8b52", "#7783a4", "#648f83", "#927d9d",
"#ac5e63", "#806c98"};
const auto i = std::find(routes.begin(), routes.end(), route);
const auto color = colors[size_t(i - routes.begin())];
const auto top = theme_ == "matchday" ? mixed_color(color, "#27282e", .55)
: mixed_color(color, "#c5ddf1", .1);
const auto bottom =
theme_ == "matchday" ? "#272a30" : mixed_color(color, "#07111e", .38);
out += "";
}
}
return out + "
";
}
std::string App::render_camp() {
const auto index_file =
Json::parse(editor::read_file(gui_.root() / "gui-assets.json"));
const auto demo = index_file.at("demo"), camps = demo.at("training_camps");
const auto s = snap();
const auto id = s.state.at("camp").value("selected", std::string("resort:4"));
const Json *chosen = nullptr;
for (const auto &c : camps)
if (c.value("id", "") == id)
chosen = &c;
if (!chosen)
chosen = &camps.at(0);
auto region = selections_["camp-region"];
if (region.empty())
region = chosen->value("map", "map:eu");
std::string body = "
";
for (const auto &m : demo.at("maps"))
body += btn("camp-region", esc(m.value("name", "")),
m.value("id", "") == region ? "primary" : "",
"data-id=\"" + esc(m.value("id", "")) + "\"");
body += "
" +
img("map." + region.substr(4), 1440, 1603.2, false, false, 1600);
for (const auto &c : camps)
if (c.value("map", "") == region) {
const double x = c.value("x", 0) * 1.2, y = c.value("y", 0) * 1.2;
body += btn("camp-select",
"",
c.value("id", "") == id ? "primary" : "",
"data-id=\"" + esc(c.value("id", "")) +
"\" style=\"position:absolute;" +
rect(x - 34, y - 34, 68, 68) +
"padding:23dp;border-radius:34dp;\"");
}
body += "
";
const std::array focus = {"Kondition", "Technik", "Spiel",
"Erholung"};
const auto values = s.state.at("camp").at("focus");
int sum = 0;
for (const auto &v : values)
sum += v.get();
for (int i = 0; i < 4; ++i) {
const int value = i == 3 ? 15 - sum / 3 : values[size_t(i)].get();
body += "
";
std::string body;
if (key == "tables" || key == "strengths" || key == "league" || key == "other")
body = render_reports(key);
else if (key == "almanac")
body = render_almanac();
else if (key == "postpone")
body = render_postpone();
else if (key == "friendlies")
body = render_friendlies();
else if (key == "indoor")
body = render_indoor();
else if (key == "lineup")
body = render_lineup();
else if (key == "transfer")
body = render_transfer();
else if (key == "achievements")
body = render_achievements();
else if (key == "scorers")
body = render_scorers();
else if (key == "fairplay")
body = render_fairplay();
else if (key == "highscore")
body = render_highscore();
else if (key == "stadium")
body = render_stadium();
else if (key == "statistics")
body = render_statistics();
else if (key == "environment")
body = render_environment();
else if (key == "advertising")
body = render_advertising();
else if (key == "toto")
body = render_toto();
else if (key == "bank")
body = render_bank();
else if (key == "balance")
body = render_balance();
else if (key == "contracts")
body = render_contracts();
else if (key == "training")
body = render_training();
else if (key == "tactics")
body = render_tactics();
else if (key == "calendar")
body = render_calendar();
else if (key == "camp")
body = render_camp();
else if (key == "settings")
body = render_settings();
else if (key == "save" || key == "load")
body = render_files(false,key == "save");
else
throw editor::Error("Diese native Ansicht ist noch nicht verfügbar.");
std::string heading = key == "postpone" ? "Spiel verlegen" : title(key);
if (key == "bank" && bank_view_ != "entrance") {
const std::map labels = {{"savings", "Sparbuch"}, {"properties", "Immobilien"},
{"stocks", "Aktien"}, {"credit", "Kredit"}, {"overview", "Finanzübersicht"}};
if (labels.contains(bank_view_)) heading += " · " + labels.at(bank_view_);
}
return "