29 Color bgColor = {20, 25, 35, 220};
30 Color borderColor = {60, 70, 90, 200};
31 Color accentColor = {210, 220, 240, 255};
36 std::string uptimeText;
46 if (uptimeMinutes > 0 || uptimeHours > 0)
51 std::unordered_map<std::string, int> teamPlayerCounts;
52 for (
const auto& teamName :
_world->
teams) teamPlayerCounts[teamName] = 0;
53 for (
const auto& [
id, player] :
_world->
players) teamPlayerCounts[player.team]++;
55 std::vector<std::pair<std::string, int>> sortedTeams(teamPlayerCounts.begin(),
56 teamPlayerCounts.end());
57 std::sort(sortedTeams.begin(), sortedTeams.end(),
58 [](
const auto& a,
const auto& b) { return a.second > b.second; });
64 Color fpsColor = fps >= 55 ? GREEN : (fps >= 30 ? YELLOW : RED);
74 builder.addLine(mapText, accentColor).addLine(uptimeText, accentColor);
76 for (
size_t i = 0; i < std::min(sortedTeams.size(),
size_t(5)); i++) {
77 const auto& [teamName, playerCount] = sortedTeams[i];
78 std::string teamLine = teamName +
": " + std::to_string(playerCount);
82 builder.setBackgroundColor(bgColor)
83 .setBackgroundAlpha(180)
84 .setBorderColor(borderColor)
85 .setBorderThickness(2)
87 .setFontSize(scaledFontSize)
89 .draw({10.0f, 10.0f});