From 93f50b205a245339d7fd14c72f7824b4500ceb8e Mon Sep 17 00:00:00 2001 From: FruitieX Date: Wed, 27 Oct 2010 12:51:11 +0300 Subject: [PATCH] add a +/- sign to the distribution display --- qcsrc/client/hud.qc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index 50ebcfe28f..c2f4e65c20 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -3515,6 +3515,7 @@ void HUD_Score(void) } float score, distribution, leader; + string sign; vector distribution_color; entity tm, pl, me; me = (spectatee_status > 0) ? playerslots[spectatee_status - 1] : playerslots[player_localentnum - 1]; @@ -3536,15 +3537,17 @@ void HUD_Score(void) // distribution display distribution = me.(scores[ps_primary]) - pl.(scores[ps_primary]); - distrtimer = ftos_decimals(distribution/pow(10, TIME_DECIMALS), TIME_DECIMALS); + distrtimer = ftos_decimals(fabs(distribution/pow(10, TIME_DECIMALS)), TIME_DECIMALS); if (distribution <= 0) { distribution_color = '0 1 0'; + sign = "-"; } else { distribution_color = '1 0 0'; + sign = "+"; } - drawstring_aspect(pos + eX * 0.75 * mySize_x, distrtimer, eX * 0.25 * mySize_x + eY * (1/3) * mySize_y, distribution_color, panel_fg_alpha, DRAWFLAG_NORMAL); + drawstring_aspect(pos + eX * 0.75 * mySize_x, strcat(sign, distrtimer), eX * 0.25 * mySize_x + eY * (1/3) * mySize_y, distribution_color, panel_fg_alpha, DRAWFLAG_NORMAL); } // race record display if (distribution <= 0) -- 2.39.2