]> git.rm.cloudns.org Git - voretournament/voretournament.git/commitdiff
Revert change I made to the text coloring function. It should always be centered...
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 18 Jul 2011 16:26:21 +0000 (19:26 +0300)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 18 Jul 2011 16:26:21 +0000 (19:26 +0300)
data/qcsrc/client/sbar.qc

index cb86bf750d3790a53a52e3382a2d87df17f21e16..afaee4d67d9997649938156cb8742aeffe59d3fe 100644 (file)
@@ -122,32 +122,32 @@ void Sbar_DrawXNum (vector pos, float num, float digits, float showminusplus, fl
        drawstring(pos, final_num, vsize, rgb, alpha, dflags);\r
 }\r
 \r
-vector Sbar_NumColor (float x, float center)\r
+vector Sbar_NumColor (float x)\r
 {\r
-       if(x > center*2) {\r
+       if(x > 200) {\r
                color_x = 0;\r
                color_y = 1;\r
                color_z = 0;\r
        }\r
-       else if(x > center*1.5) {\r
-               color_x = 0.4 - (x-center*1.5)*0.02 * 0.4; //red value between 0.4 -> 0\r
-               color_y = 0.9 + (x-center*1.5)*0.02 * 0.1; // green value between 0.9 -> 1\r
+       else if(x > 150) {\r
+               color_x = 0.4 - (x-150)*0.02 * 0.4; //red value between 0.4 -> 0\r
+               color_y = 0.9 + (x-150)*0.02 * 0.1; // green value between 0.9 -> 1\r
                color_z = 0;\r
        }\r
-       else if(x > center*1) {\r
-               color_x = 1 - (x-center*1)*0.02 * 0.6; //red value between 1 -> 0.4\r
-               color_y = 1 - (x-center*1)*0.02 * 0.1; // green value between 1 -> 0.9\r
-               color_z = 1 - (x-center*1)*0.02; // blue value between 1 -> 0\r
+       else if(x > 100) {\r
+               color_x = 1 - (x-100)*0.02 * 0.6; //red value between 1 -> 0.4\r
+               color_y = 1 - (x-100)*0.02 * 0.1; // green value between 1 -> 0.9\r
+               color_z = 1 - (x-100)*0.02; // blue value between 1 -> 0\r
        }\r
-       else if(x > center*0.5) {\r
+       else if(x > 50) {\r
                color_x = 1;\r
                color_y = 1;\r
-               color_z = 0.2 + (x-center*0.5)*0.02 * 0.8; // blue value between 0.2 -> 1\r
+               color_z = 0.2 + (x-50)*0.02 * 0.8; // blue value between 0.2 -> 1\r
        }\r
-       else if(x > center*0.25) {\r
+       else if(x > 25) {\r
                color_x = 1;\r
-               color_y = (x-center*0.25)*90/27/100; // green value between 0 -> 1\r
-               color_z = (x-center*0.25)*90/27/100 * 0.2; // blue value between 0 -> 0.2\r
+               color_y = (x-25)*90/27/100; // green value between 0 -> 1\r
+               color_z = (x-25)*90/27/100 * 0.2; // blue value between 0 -> 0.2\r
        }\r
        else {\r
                color_x = 1;\r
@@ -3034,7 +3034,7 @@ void Sbar_Draw (void)
                        vector status_pos;\r
                        string status_text, status_color;\r
                        float status_size;\r
-                       status_color = rgb_to_hexcolor(Sbar_NumColor(stomach_maxload, cvar("g_balance_vore_load_pred_capacity")));\r
+                       status_color = rgb_to_hexcolor(Sbar_NumColor(stomach_maxload));\r
                        if(stomach_load)\r
                        {\r
                                status_text = strcat(ftos(stomach_load), "^8/", status_color, ftos(stomach_maxload), "%");\r
@@ -3120,14 +3120,14 @@ void Sbar_Draw (void)
                {\r
                        drawpic(armor_pos + '-8 -13.5 0', "gfx/hud/sb_armor", '16 16 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
                        armor_pos -= '1 0 0' * stringwidth(ftos(x), FALSE, '12 12 0') * 0.5;\r
-                       Sbar_DrawXNum(armor_pos, x, 3, 0, 12, Sbar_NumColor(x, 100), sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+                       Sbar_DrawXNum(armor_pos, x, 3, 0, 12, Sbar_NumColor(x), sbar_alpha_fg, DRAWFLAG_NORMAL);\r
                }\r
 \r
                // health\r
                x = health;\r
                drawpic(health_pos + '-11 16 0', "gfx/hud/sb_health", '32 32 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
                health_pos -= '1 0 0' * stringwidth(ftos(x), FALSE, '22 22 0') * 0.5;\r
-               Sbar_DrawXNum(health_pos, x, 3, 0, 22, Sbar_NumColor(x, 100), sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+               Sbar_DrawXNum(health_pos, x, 3, 0, 22, Sbar_NumColor(x), sbar_alpha_fg, DRAWFLAG_NORMAL);\r
 \r
                // ammo\r
                pos_x = bottom_x + 140;\r