From 023819769f5fb5f829054d5f59066fca4382bdc6 Mon Sep 17 00:00:00 2001 From: terencehill Date: Wed, 15 Dec 2010 23:19:56 +0100 Subject: [PATCH] Reduce self highlight alpha in rankings of the score panel and make constants some variable --- qcsrc/client/hud.qc | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index f4ebdec55..51015fe6a 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -3670,15 +3670,16 @@ void HUD_Score(void) { #define SCOREPANEL_MAX_ENTRIES 6 #define SCOREPANEL_ASPECTRATIO 2 - float entries = bound(1, floor(SCOREPANEL_MAX_ENTRIES * mySize_y/mySize_x * SCOREPANEL_ASPECTRATIO), SCOREPANEL_MAX_ENTRIES); - float height = mySize_y/entries; - vector fontsize = '0.9 0.9 0' * height; + const float entries = bound(1, floor(SCOREPANEL_MAX_ENTRIES * mySize_y/mySize_x * SCOREPANEL_ASPECTRATIO), SCOREPANEL_MAX_ENTRIES); + const float height = mySize_y/entries; + const vector fontsize = '0.9 0.9 0' * height; pos_y += height * (1 - 0.9) / 2; vector rgb; rgb = '1 1 1'; - float name_size = mySize_x*0.75; + const float name_size = mySize_x*0.75; + const float highlight_alpha = 0.2; float i, me_printed; string s; if (autocvar__hud_configure) @@ -3692,7 +3693,7 @@ void HUD_Score(void) if (i == entries-1 && autocvar_hud_panel_score_rankings == 1) { rgb = '1 1 0'; - drawfill(pos - eY * (height * (1 - 0.9) / 2), eX * mySize_x + eY * height, rgb, 0.3 * panel_fg_alpha, DRAWFLAG_NORMAL); + drawfill(pos - eY * (height * (1 - 0.9) / 2), eX * mySize_x + eY * height, rgb, highlight_alpha * panel_fg_alpha, DRAWFLAG_NORMAL); s = GetPlayerName(pl.sv_entnum); score = 7; } @@ -3737,7 +3738,7 @@ void HUD_Score(void) if (i == 0) rgb = '0 1 0'; //first: green me_printed = 1; - drawfill(pos - eY * (height * (1 - 0.9) / 2), eX * mySize_x + eY * height, rgb, 0.3 * panel_fg_alpha, DRAWFLAG_NORMAL); + drawfill(pos - eY * (height * (1 - 0.9) / 2), eX * mySize_x + eY * height, rgb, highlight_alpha * panel_fg_alpha, DRAWFLAG_NORMAL); } s = textShortenToWidth(GetPlayerName(pl.sv_entnum), name_size, fontsize, stringwidth_colors); drawcolorcodedstring(pos + eX * (name_size - stringwidth(s, TRUE, fontsize)), s, fontsize, panel_fg_alpha, DRAWFLAG_NORMAL); -- 2.39.2