From a0c9917b6e9fd338ddc147db44f50e53d081159a Mon Sep 17 00:00:00 2001 From: terencehill Date: Sat, 13 Nov 2010 16:17:57 +0100 Subject: [PATCH] Show scores of empty teams too because this info tells u which teams exist and because it IS meaningful on many game modes (e.g. DOM: a team becomes empty but it's still scoring and could even win the match) Also some cleanups: use score_size, remove teamnum and recycle row instead, remove unneeded leader var --- qcsrc/client/hud.qc | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index f3e3ae027..add8ab1a8 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -3678,7 +3678,6 @@ void HUD_Score(void) float max_fragcount; max_fragcount = -99; - float teamnum; float scores_count, row, column, rows, columns; vector offset; vector score_pos, score_size; //for scores other than myteam @@ -3687,7 +3686,7 @@ void HUD_Score(void) if (autocvar__hud_configure) scores_count = 4; else for(tm = teams.sort_next; tm; tm = tm.sort_next) { - if(tm.team == COLOR_SPECTATOR || !tm.team_size) + if(tm.team == COLOR_SPECTATOR) continue; ++scores_count; } @@ -3715,13 +3714,14 @@ void HUD_Score(void) score_size_y = newSize; } } + else + score_size = eX * mySize_x*(1/4) + eY * mySize_y*(1/3); for(tm = teams.sort_next; tm; tm = tm.sort_next) { - if(tm.team == COLOR_SPECTATOR || (!tm.team_size && !autocvar__hud_configure)) // no players? don't display + if(tm.team == COLOR_SPECTATOR) continue; score = tm.(teamscores[ts_primary]); if(autocvar__hud_configure) score = 123; - leader = 0; if (score > max_fragcount) max_fragcount = score; @@ -3730,8 +3730,6 @@ void HUD_Score(void) { score_pos = pos + eX * column * (score_size_x + offset_x) + eY * row * (score_size_y + offset_y); if (max_fragcount == score) - leader = 1; - if (leader) HUD_Panel_DrawHighlight(score_pos, score_size, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL); drawfont = hud_bigfont; drawstring_aspect(score_pos, ftos(score), score_size, GetTeamRGB(tm.team) * 0.8, panel_fg_alpha, DRAWFLAG_NORMAL); @@ -3745,19 +3743,15 @@ void HUD_Score(void) } else if(tm.team == myteam) { if (max_fragcount == score) - leader = 1; - if (leader) HUD_Panel_DrawHighlight(pos, eX * 0.75 * mySize_x + eY * mySize_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL); drawfont = hud_bigfont; drawstring_aspect(pos, ftos(score), eX * 0.75 * mySize_x + eY * mySize_y, GetTeamRGB(tm.team) * 0.8, panel_fg_alpha, DRAWFLAG_NORMAL); drawfont = hud_font; } else { if (max_fragcount == score) - leader = 1; - if (leader) - HUD_Panel_DrawHighlight(pos + eX * 0.75 * mySize_x + eY * (1/3) * teamnum * mySize_y, eX * 0.25 * mySize_x + eY * (1/3) * mySize_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL); - drawstring_aspect(pos + eX * 0.75 * mySize_x + eY * (1/3) * teamnum * mySize_y, ftos(score), eX * 0.25 * mySize_x + eY * (1/3) * mySize_y, GetTeamRGB(tm.team) * 0.8, panel_fg_alpha, DRAWFLAG_NORMAL); - teamnum += 1; + HUD_Panel_DrawHighlight(pos + eX * 0.75 * mySize_x + eY * (1/3) * rows * mySize_y, score_size, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL); + drawstring_aspect(pos + eX * 0.75 * mySize_x + eY * (1/3) * rows * mySize_y, ftos(score), score_size, GetTeamRGB(tm.team) * 0.8, panel_fg_alpha, DRAWFLAG_NORMAL); + ++rows; } } } -- 2.39.2