// Only some HUD components can be customized here at the time.\r
-// Components left to do: Strength / Shield timer, Portrait, Sbar ring, "HUD disabled" warnings, some race timers, some spectator messages,.\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_item_score_nonteam_secondary_text_position "-0.2 0.965 0"\r
set hud_item_score_nonteam_secondary_text_scale 16\r
\r
+set hud_item_strength_icon_position "-0.35 -0.95 0"\r
+set hud_item_strength_icon_scale "0.025 0.035 0"\r
+set hud_item_strength_text_position "-0.3 -0.95 0"\r
+set hud_item_strength_text_scale 18\r
+\r
+set hud_item_invincible_icon_position "-0.35 -0.875 0"\r
+set hud_item_invincible_icon_scale "0.025 0.035 0"\r
+set hud_item_invincible_text_position "-0.3 -0.875 0"\r
+set hud_item_invincible_text_scale 18\r
+\r
set hud_item_weapon_position "0 -0.85 0"\r
set hud_item_weapon_scale "0.2 0.15 0"\r
\r
}\r
\r
void CSQC_Strength_Timer() {\r
- vector pos;\r
- vector bottomright;\r
-\r
- bottomright_x = vid_conwidth;\r
- bottomright_y = vid_conheight;\r
- bottomright_z = 0;\r
-\r
float stat_items, dt;\r
stat_items = getstati(STAT_ITEMS);\r
/*\r
if (getstati(STAT_HEALTH) <= 0)\r
return;\r
\r
- vector picsize;\r
- float strength_time, invincibility_time, countdown_fontsize;\r
-\r
- picsize = '22 22 0';\r
- countdown_fontsize = 18;\r
-\r
- pos = bottomright - '34 48 0';\r
+ vector pos, sz;\r
+ float strength_time, invincibility_time;\r
\r
//strength\r
strength_time = getstatf(STAT_STRENGTH_FINISHED);\r
- invincibility_time = getstatf(STAT_INVINCIBLE_FINISHED);\r
-\r
if (strength_time) {\r
dt = strength_time - time;\r
+ pos = Sbar_ConvertToScreen_PicPosition(stov(cvar_string("hud_item_strength_icon_position")), stov(cvar_string("hud_item_strength_icon_scale")));\r
+ sz = Sbar_ConvertToScreen_PicScale(stov(cvar_string("hud_item_strength_icon_scale")));\r
if(dt > 0)\r
{\r
if(dt < 5)\r
{\r
- drawpic_expanding_two(pos, "gfx/hud/sb_str", picsize, '1 1 1', sbar_alpha_fg, DRAWFLAG_ADDITIVE,\r
+ drawpic_expanding_two(pos, "gfx/hud/sb_str", sz, '1 1 1', sbar_alpha_fg, DRAWFLAG_ADDITIVE,\r
bound(0, (ceil(dt) - dt) / 0.5, 1));\r
}\r
else\r
{\r
- drawpic(pos, "gfx/hud/sb_str", picsize, '1 1 1', sbar_alpha_fg, DRAWFLAG_ADDITIVE);\r
+ drawpic(pos, "gfx/hud/sb_str", sz, '1 1 1', sbar_alpha_fg, DRAWFLAG_ADDITIVE);\r
}\r
- Sbar_DrawXNum(pos - '30 -2 0', ceil(dt), 2, 0, countdown_fontsize, '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+ Sbar_DrawXNum(stov(cvar_string("hud_item_strength_text_position")), ceil(dt), 2, 0, cvar("hud_item_strength_text_scale"), '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
}\r
else if(dt > -1)\r
{\r
- drawpic_expanding(pos, "gfx/hud/sb_str", picsize, '1 1 1', sbar_alpha_fg, DRAWFLAG_ADDITIVE,\r
+ drawpic_expanding(pos, "gfx/hud/sb_str", sz, '1 1 1', sbar_alpha_fg, DRAWFLAG_ADDITIVE,\r
bound(0, -dt / 0.5, 1));\r
}\r
}\r
\r
//invincibility\r
+ invincibility_time = getstatf(STAT_INVINCIBLE_FINISHED);\r
if (invincibility_time) {\r
dt = invincibility_time - time;\r
+ pos = Sbar_ConvertToScreen_PicPosition(stov(cvar_string("hud_item_invincible_icon_position")), stov(cvar_string("hud_item_invincible_icon_scale")));\r
+ sz = Sbar_ConvertToScreen_PicScale(stov(cvar_string("hud_item_invincible_icon_scale")));\r
if(dt > 0)\r
{\r
if(dt < 5)\r
{\r
- drawpic_expanding_two(pos - '0 -22 0', "gfx/hud/sb_invinc", picsize, '1 1 1', sbar_alpha_fg, DRAWFLAG_ADDITIVE,\r
+ drawpic_expanding_two(pos, "gfx/hud/sb_invinc", sz, '1 1 1', sbar_alpha_fg, DRAWFLAG_ADDITIVE,\r
bound(0, (ceil(dt) - dt) / 0.5, 1));\r
}\r
else\r
{\r
- drawpic(pos - '0 -22 0', "gfx/hud/sb_invinc", picsize, '1 1 1', sbar_alpha_fg, DRAWFLAG_ADDITIVE);\r
+ drawpic(pos, "gfx/hud/sb_invinc", sz, '1 1 1', sbar_alpha_fg, DRAWFLAG_ADDITIVE);\r
}\r
- Sbar_DrawXNum(pos - '30 -24 0', ceil(dt), 2, 0, countdown_fontsize, '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+ Sbar_DrawXNum(stov(cvar_string("hud_item_invincible_text_position")), ceil(dt), 2, 0, cvar("hud_item_invincible_text_scale"), '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
}\r
else if(dt > -1)\r
{\r
- drawpic_expanding(pos - '0 -22 0', "gfx/hud/sb_invinc", picsize, '1 1 1', sbar_alpha_fg, DRAWFLAG_ADDITIVE,\r
+ drawpic_expanding(pos, "gfx/hud/sb_invinc", sz, '1 1 1', sbar_alpha_fg, DRAWFLAG_ADDITIVE,\r
bound(0, -dt / 0.5, 1));\r
}\r
}\r