Port career setup, manager hub and context-aware native UI (by Codex)

This commit is contained in:
Codex authored and Codex committed 2026-10-27 01:57:58 +01:00
1 parent d88bf2872a
commit d085697bb9
37 files changed
+1447 -421

No files matched your search

+3 -3
View File
@@ -38,13 +38,13 @@ std::string App::files_details(bool layouts, bool save) {
const auto data = fresh ? snap().state : files_entry_->data;
const auto meta = DemoFiles::career_metadata(data);
const auto &managers = meta.at("managers");
const Json *own = managers.empty() ? nullptr : world_->find("clubs", managers.at(0).value("club", ""));
out = "<div class=\"files-detail-heading\"><div class=\"files-crest\">" + crest(own, 108) + "</div><div><p>" + std::string(fresh ? "Aktuelles Spiel" : "Gespeicherter Spielstand") + "</p><h2>" + esc(fresh ? "Neuer Speicherstand" : files_entry_->name) + "</h2><span>" + esc(own ? world_->name(*own) : "") + "</span></div></div>";
const Json *own = managers.empty() ? nullptr : world_->find("clubs", meta.at("current_manager").value("club", ""));
out = "<div class=\"files-detail-heading\"><div class=\"files-crest\">" + (meta.at("role")=="national"?img("career.national-de",108,108,false,false,256):crest(own,108)) + "</div><div><p>" + std::string(fresh ? "Aktuelles Spiel" : "Gespeicherter Spielstand") + "</p><h2>" + esc(fresh ? "Neuer Speicherstand" : files_entry_->name) + "</h2><span>" + esc(meta.at("role")=="national"?"Deutschland":own ? world_->name(*own) : "") + "</span></div></div>";
if (fresh) out += input();
out += "<div class=\"files-metadata\">";
const auto iso_date = meta.at("date").get<std::string>();
const auto display_date = iso_date.substr(8, 2) + "." + iso_date.substr(5, 2) + "." + iso_date.substr(0, 4);
const std::vector<std::pair<std::string, std::string>> cells = {{"Saison", meta.at("season")}, {"Spieltag", meta.at("matchday")}, {"Spieldatum", display_date}, {"Spieler", std::to_string(managers.size())}};
const std::vector<std::pair<std::string, std::string>> cells = {{"Saison", meta.at("season")}, {"Spieltag", meta.at("matchday")}, {"Spieldatum", display_date}, {"Spieler", std::to_string(meta.at("human_count").get<size_t>())}};
for (const auto &[label, value] : cells) out += "<div class=\"files-metadata-cell\"><span>" + esc(label) + "</span><strong>" + esc(value) + "</strong></div>";
out += "</div><section class=\"files-managers\"><h3>Mitspieler</h3>";
for (const auto &manager : managers) {