The career as a notebook: a book on a table instead of a desk with windows

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>
This commit is contained in:
MichaelandClaude Fable 5.2 committed 2026-11-15 11:14:39 +01:00
1 parent b2500eb7b6
commit 0d8e7b4dd4
10 files changed
+1300 -73

No files matched your search

+85 -35
View File
@@ -65,11 +65,18 @@ void App::engine_render() {
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 + ";\"";
out = "<div class=\"desktop-layer\"><div class=\"info-bar\"" + club_line + "><div class=\"identity\">" + engine_widget_crest(team, 82) +
"<span><strong>" + esc(engine_text(team.at("name"))) + "</strong><small>" + esc(engine_text(person.at("name"))) +
"</small></span></div><div class=\"info-date\">" + esc(ui_long_date(meta.at("date").get<std::string>())) + "<small>Saison " +
esc(meta.at("season").at("label").get<std::string>()) + "</small></div><div class=\"info-cash\"><small>Guthaben</small><strong id=\"engine-cash\" class=\"" + money_classes(engine_money_minor(desk.at("accounts").at("cash"))) + "\">" +
esc(engine_price(desk.at("accounts").at("cash"))) + "</strong></div></div>";
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;
@@ -95,7 +102,7 @@ void App::engine_render() {
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)) continue;
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;
@@ -132,7 +139,7 @@ void App::engine_render() {
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();
out += "<div id=\"object-" + esc(id) + "\" class=\"desktop-card desk-card\" data-widget=\"" + esc(id) + "\" data-size=\"" + size + "\" " +
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>";
}
@@ -141,38 +148,81 @@ void App::engine_render() {
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());
out += desktop_button(id, o, "engine-open", supported && !engine_busy_ && (!engine_manager_value_.is_object() || engine_manager_value_.at("ended")!=true || route=="save" || route=="load" || route=="newplayer"));
route_open[route] = (supported && !engine_busy_ && (!engine_manager_value_.is_object() || engine_manager_value_.at("ended")!=true || route=="save" || route=="load" || route=="newplayer"));
}
}
out += "</div>";
if(menu_=="save"||menu_=="load")out+="<div class=\"fill\" style=\"z-index:100;\">"+window(menu_=="save"?"Spiel speichern":"Spiel laden",render_files(false,menu_=="save"))+"</div>";
if(menu_=="scorers")out+="<div class=\"fill\" 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\" 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\" 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>";
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\" style=\"z-index:100;\">"+window("Einstellungen",render_settings())+"</div>";
if(menu_=="indoor")out+="<div class=\"fill\" style=\"z-index:100;\">"+window("Hallentabellen",render_indoor())+"</div>";
if(menu_=="balance")out+="<div class=\"fill\" style=\"z-index:100;\">"+window("Bilanz",render_balance())+"</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\" style=\"z-index:100;\">"+window("Erfolge",render_achievements())+"</div>";
if(menu_=="transfer")out+="<div class=\"fill\" style=\"z-index:100;\">"+window("Transfers",render_transfer())+"</div>";
if(menu_=="stadium")out+="<div class=\"fill\" style=\"z-index:100;\">"+window("Stadion",render_stadium())+"</div>";
if(menu_=="toto")out+="<div class=\"fill\" style=\"z-index:100;\">"+window("Toto",render_toto())+"</div>";
if(menu_=="statistics")out+="<div class=\"fill\" 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\" 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\" 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\" 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\" 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\" 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\" 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\" style=\"z-index:100;\">" + window("Verträge", render_contracts()) + "</div>";
if (menu_ == "environment") out += "<div class=\"fill\" style=\"z-index:100;\">" + window("Umfeld", render_environment()) + "</div>";
if (menu_ == "advertising") out += "<div class=\"fill\" style=\"z-index:100;\">" + window("Werbung", render_advertising()) + "</div>";
if (menu_ == "bank") out += "<div class=\"fill\" style=\"z-index:100;\">" + window("Bank", render_bank()) + "</div>";
if (menu_ == "training") out += "<div class=\"fill\" style=\"z-index:100;\">" + window("Training", render_training()) + "</div>";
if (menu_ == "tactics") out += "<div class=\"fill\" style=\"z-index:100;\">" + window("Taktik", render_tactics()) + "</div>";
if (menu_ == "lineup") out += "<div class=\"fill\" style=\"z-index:100;\">" + window("Aufstellung", render_lineup()) + "</div>";
if (menu_ == "camp") out += "<div class=\"fill\" style=\"z-index:100;\">" + window("Trainingslager", render_camp()) + "</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>";