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
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
{\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