From ad05535c6d8943e82db8aef058d06913c5ee3028 Mon Sep 17 00:00:00 2001 From: MirceaKitsune Date: Thu, 14 Apr 2011 17:28:31 +0300 Subject: [PATCH] Render number strings whole in sbar --- data/qcsrc/client/sbar.qc | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/data/qcsrc/client/sbar.qc b/data/qcsrc/client/sbar.qc index 304f4e5b..06e2a27e 100644 --- a/data/qcsrc/client/sbar.qc +++ b/data/qcsrc/client/sbar.qc @@ -111,10 +111,10 @@ void Sbar_DrawXNum (vector pos, float num, float digits, float showminusplus, fl if(l > digits) { - str = substring(str, l-digits, 999); + str = substring(str, l - digits, 999); l = strlen(str); } else if(l < digits) - pos_x += (digits-l) * lettersize; + pos_x += (digits - l) * lettersize; if (highlighted == 1) { vector hl_size; @@ -125,8 +125,8 @@ void Sbar_DrawXNum (vector pos, float num, float digits, float showminusplus, fl hl_size_x = hl_size_x + vsize_x; vector hl_pos; - hl_pos_x = pos_x - lettersize/10; - hl_pos_y = pos_y - lettersize/20; + hl_pos_x = pos_x - lettersize / 10; + hl_pos_y = pos_y - lettersize / 20; hl_pos_z = 0; drawpic(hl_pos, strcat("gfx/hud/sb_highlight_", l_length), hl_size, '1 1 1', alpha, dflags); @@ -151,14 +151,9 @@ void Sbar_DrawXNum (vector pos, float num, float digits, float showminusplus, fl pos_x += lettersize; } - for(i = 0; i < l; ++i) - { - tmp = substring(str, i, 1); - if (stroke == 1) - drawstring(pos, tmp, vsize, rgb, alpha, dflags); - drawstring(pos, tmp, vsize, num_color, alpha, dflags); - pos_x += lettersize; - } + if (stroke == 1) + drawstring(pos, str, vsize, rgb, alpha, dflags); + drawstring(pos, str, vsize, num_color, alpha, dflags); } void Sbar_DrawXNum_Colored (vector pos, float x, float lettersize, float alpha) -- 2.39.2