// Only some HUD components can be customized here at the time.\r
// Components left to do: Portrait, Sbar ring, "HUD disabled" warnings, some race timers, some spectator messages.\r
\r
-set hud_panel_status_background_position "0 -0.85 0"\r
-set hud_panel_status_background_scale "0.2 0.15 0"\r
+set hud_backgrounds 4 // total number of backgrounds defined\r
+set hud_background_1_texture "gfx/hud/bg_status"\r
+set hud_background_1_position "0 -0.85 0"\r
+set hud_background_1_scale "0.2 0.15 0"\r
+set hud_background_1_colortype 1 // 0 = white, 1 = HUD / team color, 2 = vore color\r
+set hud_background_2_texture "gfx/hud/bg_stomach"\r
+set hud_background_2_position "-0.68 -0.58 0"\r
+set hud_background_2_scale "0.325 0.475 0"\r
+set hud_background_2_colortype 1 // 0 = white, 1 = HUD / team color, 2 = vore color\r
+set hud_background_3_texture "gfx/hud/bg_stomach_status"\r
+set hud_background_3_position "-0.68 -0.58 0"\r
+set hud_background_3_scale "0.325 0.475 0"\r
+set hud_background_3_colortype 2 // 0 = white, 1 = HUD / team color, 2 = vore color\r
+set hud_background_4_texture "gfx/hud/bg_timer"\r
+set hud_background_4_position "0.875 0.95 0"\r
+set hud_background_4_scale "0.125 0.05 0"\r
+set hud_background_4_colortype 1 // 0 = white, 1 = HUD / team color, 2 = vore color\r
\r
set hud_item_timer_text_position "0.875 0.96 0"\r
set hud_item_timer_text_scale 16\r
set hud_item_ammo_load_clip_text_position "0.03 -0.89 0"\r
set hud_item_ammo_load_clip_text_scale 16\r
\r
-set hud_item_digestion_icon_position "-0.89 -0.53 0"\r
+set hud_item_digestion_icon_position "-0.895 -0.53 0"\r
set hud_item_digestion_icon_scale "0.02 0.03 0"\r
\r
-set hud_item_stomach_load_single_text_position "-0.89 -0.47 0"\r
+set hud_item_stomach_load_single_text_position "-0.895 -0.46 0"\r
set hud_item_stomach_load_single_text_scale 20\r
-set hud_item_stomach_load_double_text_position "-0.89 -0.47 0"\r
+set hud_item_stomach_load_double_text_position "-0.895 -0.46 0"\r
set hud_item_stomach_load_double_text_scale 16\r
\r
set hud_item_predator_position "-0.64 -0.525 0"\r
}\r
}\r
\r
+void Sbar_DrawBackgrounds()\r
+{\r
+ // Draw all backgrounds defined by our HUD setup\r
+ if (cvar("viewsize") > 100 || !sbar_hudselector)\r
+ return;\r
+\r
+ float total = cvar("hud_backgrounds");\r
+ float i;\r
+ for(i = 1; i <= total; i++)\r
+ {\r
+ string img = cvar_string(strcat("hud_background_", ftos(i), "_texture"));\r
+ vector pos = stov(cvar_string(strcat("hud_background_", ftos(i), "_position")));\r
+ vector sz = stov(cvar_string(strcat("hud_background_", ftos(i), "_scale")));\r
+\r
+ pos = Sbar_ConvertToScreen_PicPosition(pos, sz);\r
+ sz = Sbar_ConvertToScreen_PicScale(sz);\r
+\r
+ vector col;\r
+ switch(cvar(strcat("hud_background_", ftos(i), "_colortype")))\r
+ {\r
+ case 1:\r
+ if(teamplay)\r
+ col = GetTeamRGB(myteam) * sbar_color_bg_team;\r
+ else\r
+ col = stov(cvar_string("sbar_color_bg"));\r
+ break;\r
+ case 2:\r
+ col = Sbar_ColorFade(Sbar_GetVoreColor());\r
+ break;\r
+ default:\r
+ col = '1 1 1';\r
+ break;\r
+ }\r
+\r
+ drawpic(pos, img, sz, col, sbar_alpha_bg, DRAWFLAG_NORMAL);\r
+ }\r
+}\r
+\r
float race_status_time;\r
float race_status_prev;\r
string race_status_name_prev;\r
float stat_items;\r
stat_items = getstati(STAT_ITEMS);\r
\r
- if (cvar("viewsize") <= 100 && sbar_hudselector)\r
- Sbar_DrawPic("gfx/hud/bg_status", stov(cvar_string("hud_panel_status_background_position")), stov(cvar_string("hud_panel_status_background_scale")), TRUE);\r
-\r
// armor\r
x = armor;\r
if (x > 0)\r
entity e;\r
e = get_weaponinfo(activeweapon);\r
if (e && e.netname != "" && e.netname != "N/A")\r
- Sbar_DrawPic(strcat("gfx/hud/bg_status_activeweapon_", e.netname), stov(cvar_string("hud_item_weapon_position")), stov(cvar_string("hud_item_weapon_scale")), FALSE);\r
+ Sbar_DrawPic(strcat("gfx/hud/sb_activeweapon_", e.netname), stov(cvar_string("hud_item_weapon_position")), stov(cvar_string("hud_item_weapon_scale")), FALSE);\r
}\r
\r
void Sbar_Timer()\r
seconds = secondsLeft;\r
}\r
\r
- if (cvar("viewsize") <= 100 && sbar_hudselector) { // draw timer background when viewsize <= 100\r
- if (teamplay)\r
- drawpic('1 0 0' * (vid_conwidth - (70 + 17 + 12)), "gfx/hud/bg_timer", '120 30 0', GetTeamRGB(myteam) * sbar_color_bg_team, sbar_alpha_bg, DRAWFLAG_NORMAL); // timer bg color = myteam color\r
- else {\r
- color = stov(cvar_string("sbar_color_bg"));\r
-\r
- drawpic('1 0 0' * (vid_conwidth - (70 + 17 + 12)), "gfx/hud/bg_timer", '120 30 0', color, sbar_alpha_bg, DRAWFLAG_NORMAL);\r
- }\r
- }\r
-\r
Sbar_DrawPic("gfx/hud/sb_time", stov(cvar_string("hud_item_timer_icon_position")), stov(cvar_string("hud_item_timer_icon_scale")), FALSE);\r
\r
finaltime = strcat(ftos(minutes), ":");\r
}\r
}\r
\r
+ Sbar_DrawBackgrounds();\r
+\r
if(g_vore) // only when the vore system is active\r
{\r
// draw the stomach board\r
- if (cvar("viewsize") <= 100 && sbar_hudselector) {\r
- if (teamplay)\r
- drawpic(bottomleft- '0 256 0', "gfx/hud/bg_stomach", '256 256 0', GetTeamRGB(myteam) * sbar_color_bg_team, sbar_alpha_bg, DRAWFLAG_NORMAL); // hud color = myteam color\r
- else {\r
- // allow for custom HUD colors in non-teamgames\r
- color = stov(cvar_string("sbar_color_bg"));\r
-\r
- drawpic(bottomleft - '0 256 0', "gfx/hud/bg_stomach", '256 256 0', color, sbar_alpha_bg, DRAWFLAG_NORMAL);\r
- }\r
- }\r
-\r
- drawpic(bottomleft - '0 256 0', "gfx/hud/bg_stomach_status", '256 256 0', Sbar_ColorFade(Sbar_GetVoreColor()), cvar("sbar_stomachboard_status_alpha") * sbar_alpha_fg, DRAWFLAG_NORMAL);\r
\r
float stomach_load, stomach_maxload; // shows the predator's stomach load when we are eaten, and ours otherwise\r
stomach_load = getstati(STAT_VORE_LOAD);\r