Some tweaks to show-minus-plus
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Fri, 15 Apr 2011 11:06:04 +0000 (14:06 +0300)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Fri, 15 Apr 2011 11:06:04 +0000 (14:06 +0300)
data/qcsrc/client/sbar.qc

index c041ce6..b7a7d20 100644 (file)
@@ -72,7 +72,7 @@ vector Sbar_AccuracyColor(float accuracy)
 void Sbar_DrawXNum (vector pos, float num, float digits, float showminusplus, float lettersize, vector rgb, float alpha, float dflags)\r
 {\r
        float l;\r
-       string str, tmp, l_length;\r
+       string str, tmp, l_length, final_num;\r
        float minus, plus;\r
        vector vsize;\r
 \r
@@ -114,16 +114,12 @@ void Sbar_DrawXNum (vector pos, float num, float digits, float showminusplus, fl
        }\r
 \r
        if(minus)\r
-       {\r
-               drawstring(pos, "-", vsize, rgb, alpha, dflags);\r
-               pos_x += lettersize / 2;\r
-       } else if(plus)\r
-       {\r
-               drawstring(pos, "+", vsize, rgb, alpha, dflags);\r
-               pos_x += lettersize / 2;\r
-       }\r
+               final_num = "-";\r
+       else if(plus)\r
+               final_num = "+";\r
 \r
-       drawstring(pos, str, vsize, rgb, alpha, dflags);\r
+       final_num = strcat(final_num, str);\r
+       drawstring(pos, final_num, vsize, rgb, alpha, dflags);\r
 }\r
 \r
 void Sbar_DrawXNum_Colored (vector pos, float x, float lettersize, float alpha)\r
@@ -1747,7 +1743,7 @@ void Sbar_Score()
                else\r
                        distribution_color = '1 0 0';\r
                \r
-               Sbar_DrawXNum(secondary_score_pos, distribution, 6, 0, 16, distribution_color, sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+               Sbar_DrawXNum(secondary_score_pos, distribution, 6, 3, 16, distribution_color, sbar_alpha_fg, DRAWFLAG_NORMAL);\r
                Sbar_DrawXNum(score_pos, score, 6, 0, 34, distribution_color, sbar_alpha_fg, DRAWFLAG_NORMAL);\r
        } else { // teamgames\r
                float max_fragcount;\r
@@ -1769,7 +1765,7 @@ void Sbar_Score()
                        } else {\r
                                if (max_fragcount == score)\r
                                        leader = 1;\r
-                               Sbar_DrawXNum(secondary_score_pos, score, 6, 0, 16, GetTeamRGB(tm.team) * 0.4 + '0.6 0.6 0.6', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+                               Sbar_DrawXNum(secondary_score_pos, score, 6, 3, 16, GetTeamRGB(tm.team) * 0.4 + '0.6 0.6 0.6', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
                                secondary_score_pos = secondary_score_pos + '0 16 0';\r
                        }\r
                }\r