]> de.git.xonotic.org Git - voretournament/voretournament.git/commitdiff
Adapt Strength & Invincible HUD elements to the new system
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sat, 2 Feb 2013 22:18:12 +0000 (00:18 +0200)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sat, 2 Feb 2013 22:18:12 +0000 (00:18 +0200)
data/hudVT.cfg
data/qcsrc/client/hud.qc

index b4e9a4b651d4d1d447060c250be15ca8023449f6..ce3b606a896a82889a1876234f99a1cc5cd2fff2 100644 (file)
@@ -1,5 +1,5 @@
 // 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
@@ -23,6 +23,16 @@ set hud_item_score_nonteam_primary_text_scale 34
 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
index 01bd95a8cb63876463d9ab02954dfbe513fa2773..5e9b0717ea3c4284844ede607023df37f8d81591 100644 (file)
@@ -2325,13 +2325,6 @@ void Sbar_Ring()
 }\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
@@ -2343,59 +2336,57 @@ void CSQC_Strength_Timer() {
        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