]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/hud/panel/scoreboard.qc
Display current and maximum player numbers on scoreboard
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / hud / panel / scoreboard.qc
index 22c93b1f8a56d7bdee4b66f61d2d55a99af4d7ba..727fc411be32e111647544076b574e410d2baf2b 100644 (file)
@@ -80,7 +80,6 @@ float autocvar_hud_panel_scoreboard_table_highlight_alpha = 0.2;
 float autocvar_hud_panel_scoreboard_table_highlight_alpha_self = 0.4;
 float autocvar_hud_panel_scoreboard_table_highlight_alpha_eliminated = 0.6;
 float autocvar_hud_panel_scoreboard_bg_teams_color_team = 0;
-float autocvar_hud_panel_scoreboard_namesize = 15;
 float autocvar_hud_panel_scoreboard_team_size_position = 0;
 float autocvar_hud_panel_scoreboard_spectators_position = 1;
 
@@ -185,6 +184,8 @@ void HUD_Scoreboard_UI_Disable_Instantly()
 // mode: 0 normal, 1 team selection
 void Scoreboard_UI_Enable(int mode)
 {
+       if(isdemo()) return;
+
        if (mode == 1)
        {
                if (scoreboard_ui_enabled == 2 || !teamplay || intermission)
@@ -546,9 +547,11 @@ void Scoreboard_UpdatePlayerTeams()
        update_time = time;
 
        entity pl, tmp;
+       numplayers = 0;
        //int num = 0;
        for(pl = players.sort_next; pl; pl = pl.sort_next)
        {
+               numplayers += pl.team != NUM_SPECTATOR;
                //num += 1;
                int Team = entcs_GetScoreTeam(pl.sv_entnum);
                if(SetTeam(pl, Team))
@@ -2329,8 +2332,9 @@ void Scoreboard_Draw()
                        }
                }
                drawcolorcodedstring(pos + '1 0 0' * (panel_size.x - stringwidth(str, true, sb_gameinfo_detail_fontsize)), str, sb_gameinfo_detail_fontsize, panel_fg_alpha, DRAWFLAG_NORMAL); // align right
-               // map name
-               str = sprintf(_("^7Map: ^2%s"), shortmapname);
+               // map name and player count
+               str = sprintf(_("^5%d^7/^5%d ^7players"), numplayers, srv_maxplayers ? srv_maxplayers : maxclients);
+               str = strcat("^7", _("Map:"), " ^2", mi_shortname, "    ", str); // reusing "Map:" translatable string
                drawcolorcodedstring(pos, str, sb_gameinfo_detail_fontsize, panel_fg_alpha, DRAWFLAG_NORMAL); // align left
        }
        // End of Game Info Section