HUD_Write_Cvar("hud_panel_scoreboard_bg_teams_color_team");
HUD_Write_Cvar("hud_panel_scoreboard_accuracy_doublerows");
HUD_Write_Cvar("hud_panel_scoreboard_accuracy_nocolors");
+ HUD_Write_Cvar("hud_panel_scoreboard_spectators_position");
}
const int MAX_SBT_FIELDS = MAX_SCORE;
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 = 2;
bool autocvar_hud_panel_scoreboard_accuracy = true;
bool autocvar_hud_panel_scoreboard_accuracy_doublerows = false;
return true;
}
+vector Scoreboard_Spectators_Draw(vector pos, entity tm, string str, vector hud_fontsize) {
+
+ entity pl;
+
+ for(pl = players.sort_next; pl; pl = pl.sort_next)
+ {
+ if(pl.team == NUM_SPECTATOR)
+ {
+ for(tm = teams.sort_next; tm; tm = tm.sort_next)
+ if(tm.team == NUM_SPECTATOR)
+ break;
+ str = sprintf("%s (%d)", _("Spectators"), tm.team_size);
+ draw_beginBoldFont();
+ drawstring(pos, str, hud_fontsize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+ draw_endBoldFont();
+ pos.y += 1.25 * hud_fontsize.y;
+
+ pos = Scoreboard_DrawOthers(pos, '0 0 0', pl.team, NULL, pl, 0);
+ pos.y += 1.25 * hud_fontsize.y;
+
+ break;
+ }
+ }
+
+ return pos;
+}
+
void Scoreboard_Draw()
{
if(!autocvar__hud_configure)
float initial_pos_y = panel_pos.y;
vector pos = panel_pos;
- entity pl, tm;
+ entity tm;
string str;
vector str_pos;
pos = Scoreboard_MakeTable(pos, tm, panel_bg_color, bg_size);
}
+ // draw scoreboard spectators before accuracy and item stats
+ if (autocvar_hud_panel_scoreboard_spectators_position == 0) {
+ pos = Scoreboard_Spectators_Draw(pos, tm, str, hud_fontsize);
+ }
+
+ // draw accuracy and item stats
if (Scoreboard_AccuracyStats_WouldDraw(pos.y))
pos = Scoreboard_AccuracyStats_Draw(pos, panel_bg_color, bg_size);
if (Scoreboard_ItemStats_WouldDraw(pos.y))
pos = Scoreboard_ItemStats_Draw(pos, panel_bg_color, bg_size);
+ // draw scoreboard spectators after accuracy and item stats and before rankings
+ if (autocvar_hud_panel_scoreboard_spectators_position == 1) {
+ pos = Scoreboard_Spectators_Draw(pos, tm, str, hud_fontsize);
+ }
+
if(MUTATOR_CALLHOOK(ShowRankings)) {
string ranktitle = M_ARGV(0, string);
if(race_speedaward) {
pos = Scoreboard_Rankings_Draw(pos, ranktitle, playerslots[player_localnum], panel_bg_color, bg_size);
}
- pos = Scoreboard_MapStats_Draw(pos, panel_bg_color, bg_size);
-
- // List spectators
- for(pl = players.sort_next; pl; pl = pl.sort_next)
- {
- if(pl.team == NUM_SPECTATOR)
- {
- for(tm = teams.sort_next; tm; tm = tm.sort_next)
- if(tm.team == NUM_SPECTATOR)
- break;
- str = sprintf("%s (%d)", _("Spectators"), tm.team_size);
- draw_beginBoldFont();
- drawstring(pos, str, hud_fontsize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
- draw_endBoldFont();
- pos.y += 1.25 * hud_fontsize.y;
+ // draw scoreboard spectators after rankings
+ if (autocvar_hud_panel_scoreboard_spectators_position == 2) {
+ pos = Scoreboard_Spectators_Draw(pos, tm, str, hud_fontsize);
+ }
- pos = Scoreboard_DrawOthers(pos, '0 0 0', pl.team, NULL, pl, 0);
- pos.y += 1.25 * hud_fontsize.y;
+ pos = Scoreboard_MapStats_Draw(pos, panel_bg_color, bg_size);
- break;
- }
+ // draw scoreboard spectators after mapstats
+ if (autocvar_hud_panel_scoreboard_spectators_position == 3) {
+ pos = Scoreboard_Spectators_Draw(pos, tm, str, hud_fontsize);
}