A club analysis in the statistics: the season as charts; larger trophies

The engine counts the manager's club's running season from the almanac (read
"analysis"): matches, the points course beside the league's pace, records by venue,
what the first goal decided, goals by quarter of an hour, scorers and goal kinds. The
statistics open with it; the archive tables keep their place with larger type and
trophies.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
MichaelandClaude Fable 5.2 committed 2026-11-14 23:10:50 +01:00
1 parent 9006b7a05d
commit 8f607a9d89
13 files changed
+444 -9

No files matched your search

+6 -5
View File
@@ -78,11 +78,12 @@ std::string App::statistics_trophy_asset(const std::string &id) const {
std::string App::render_statistics() {
statistics_remember_scroll();
if((!source_&&!engine_mode_)||!world_)return "<p>Statistiken sind nicht verfügbar.</p>";
if(engine_mode_&&statistics_mode_=="analysis")return render_statistics_analysis()+render_report_detail();
const auto data=statistics_data();
if(!data.value("ok",false))return "<p>Statistiken sind nicht verfügbar.</p>";
const int section=data.at("section").get<int>(),category=data.at("category").get<int>();
const bool winners=section==7,minutes=section==8,finals=section==4&&data.at("country")==3;
std::string out="<section class=\"statistics-native statistics-section-"+std::to_string(section)+(finals?" statistics-finals":"")+"\"><div class=\"statistics-panel\"><h2 class=\"statistics-heading\">"+esc(data.at("title").get<std::string>())+"</h2>";
std::string out="<section class=\"statistics-native statistics-section-"+std::to_string(section)+(finals?" statistics-finals":"")+"\"><div class=\"statistics-panel\">"+(engine_mode_?btn("statistics-mode","‹ Vereinsanalyse","statistics-back","id=\"statistics-mode-analysis\" data-id=\"analysis\""):std::string())+"<h2 class=\"statistics-heading\">"+esc(data.at("title").get<std::string>())+"</h2>";
if(winners)out+="<p class=\"statistics-winner-note\">"+statistics_text(data.value("note",""))+"</p>";
if(engine_mode_&&!data.value("available",false)){out+="<p class=\"statistics-empty\">"+statistics_text(data.value("reason","")=="not_recorded"?"Diese Auswertung wurde in der Karriere noch nicht aufgezeichnet.":"Keine Statistikdaten für diese Auswahl vorhanden.")+"</p>";}
else if(section==2) {
@@ -109,7 +110,7 @@ std::string App::render_statistics() {
const double rest=count>1?(table_width-first)/double(count-1):0;
const auto width=[&](size_t column){return finals?(column==1?160:1194):column?rest:first;};
const bool trophies=winners&&std::any_of(columns.begin(),columns.end(),[](const Json &column){return !column.value("trophy","").empty();});
const double head_height=trophies?200:winners?78:66;
const double head_height=trophies?400:winners?78:76;
out+="<div id=\"statistics-list\" class=\"statistics-list "+std::string(winners?"statistics-winners ":"")+(minutes?"statistics-minutes ":"")+"\" data-scroll-key=\""+esc(statistics_scroll_key(data))+"\"><div class=\"statistics-table\" role=\"table\"><div class=\"statistics-row statistics-head\" role=\"row\" style=\"height:"+scalar(head_height)+"dp;\">";
for(size_t c=0;c<count;++c) {
const auto &column=columns[c];
@@ -117,7 +118,7 @@ std::string App::render_statistics() {
std::string heading=statistics_text(column.at("text").get<std::string>());
if(column.contains("round"))heading="<span class=\"statistics-fixture-round\"><span>"+esc(column.at("round").get<std::string>())+"</span></span>"+heading;
if(!trophy.empty()) {
const auto art=asset.empty()?std::string():"<span class=\"statistics-trophy-icon\">"+img(asset,105,105,asset.starts_with("asset:"),false,320)+"</span>";
const auto art=asset.empty()?std::string():"<span class=\"statistics-trophy-icon\">"+img(asset,290,290,asset.starts_with("asset:"),false,640)+"</span>";
heading=btn("statistics-trophy",art+"<span class=\"statistics-trophy-label\">"+esc(column.at("text").get<std::string>())+"</span>","statistics-trophy-heading",
"id=\"statistics-trophy-heading-"+std::to_string(c)+"\" data-column=\""+std::to_string(c)+"\" data-row=\"-1\" aria-label=\""+esc(column.at("text").get<std::string>()+" · Siegerbild ansehen")+"\" "+(asset.empty()||!column.contains("winner")?"disabled":""));
}
@@ -127,7 +128,7 @@ std::string App::render_statistics() {
for(size_t r=0;r<rows.size();++r) {
const auto &cells=rows[r].at("cells");
const bool world_trophies=section==4&&(data.at("country")==0||data.at("country")==5);
const double row_height=minutes?200:winners?100:world_trophies?78:66;
const double row_height=minutes?200:winners?120:world_trophies?110:76;
out+="<div class=\"statistics-row "+std::string(r%2==0?"striped":"")+"\" role=\"row\" style=\"height:"+scalar(row_height)+"dp;\">";
for(size_t c=0;c<cells.size();++c) {
const auto &value=cells[c];const auto title=value.value("text","");const auto token=std::to_string(r)+"-"+std::to_string(c);
@@ -140,7 +141,7 @@ std::string App::render_statistics() {
content=btn("club-detail",reverse?name+badge:badge+name,"report-club-button statistics-club "+std::string(reverse?"name-first ":"")+(data.at("club")==id?"current":""),"id=\"statistics-club-"+token+"\" data-id=\""+esc(id)+"\" title=\""+esc(title)+"\"");
} else if(value.contains("trophy")) {
const auto asset=statistics_trophy_asset(value.at("trophy").get<std::string>());
content=btn("statistics-trophy",(asset.empty()?std::string():"<span class=\"statistics-world-trophy-art\">"+img(asset,58,58,asset.starts_with("asset:"),false,192)+"</span>")+statistics_text(title),"statistics-world-trophy","id=\"statistics-trophy-row-"+token+"\" data-row=\""+std::to_string(r)+"\" data-column=\""+std::to_string(c)+"\" "+(asset.empty()?"disabled":""));
content=btn("statistics-trophy",(asset.empty()?std::string():"<span class=\"statistics-world-trophy-art\">"+img(asset,92,92,asset.starts_with("asset:"),false,256)+"</span>")+statistics_text(title),"statistics-world-trophy","id=\"statistics-trophy-row-"+token+"\" data-row=\""+std::to_string(r)+"\" data-column=\""+std::to_string(c)+"\" "+(asset.empty()?"disabled":""));
} else content=statistics_text(value.value("prefix","")+title);
if(value.contains("round"))content="<span class=\"statistics-fixture-round\"><span>"+esc(value.at("round").get<std::string>())+"</span></span>"+content;
out+="<div class=\"statistics-cell statistics-col-"+std::to_string(c)+" "+esc(value.value("tone",""))+"\" role=\"cell\" style=\"width:"+scalar(width(c))+"dp;height:"+scalar(row_height)+"dp;\">"+content+"</div>";