]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Now each progressbar effect got its own cvar
authorterencehill <piuntn@gmail.com>
Tue, 26 Apr 2011 09:46:41 +0000 (11:46 +0200)
committerterencehill <piuntn@gmail.com>
Tue, 26 Apr 2011 09:46:41 +0000 (11:46 +0200)
hud_panel_healtharmor_progressbar_gfx
hud_panel_healtharmor_progressbar_gfx_damage
hud_panel_healtharmor_progressbar_gfx_lowhealth
hud_panel_healtharmor_progressbar_gfx_smooth

defaultXonotic.cfg
qcsrc/client/autocvars.qh
qcsrc/client/hud.qc

index b6200b11c329386db38930bde5e1757745377892..16249a026fe5cade9aafaa629c3119503d22a295 100644 (file)
@@ -1421,8 +1421,10 @@ seta hud_panel_ammo_maxammo "40" "when you have this much ammo, the ammo status
 
 seta hud_panel_healtharmor_maxhealth "200" "when you have this much health, the health status bar is full"
 seta hud_panel_healtharmor_maxarmor "200" "when you have this much armor, the armor status bar is full"
-seta hud_panel_healtharmor_progressbar_gfx 1 "add graphic effects to the progressbars when spawning and when being damaged"
-seta hud_panel_healtharmor_progressbar_gfx_damage 5 "show damage effect when damaged at least by this amount; 0 disables damage effect"
+seta hud_panel_healtharmor_progressbar_gfx 1 "enable graphic effects on the progressbars"
+seta hud_panel_healtharmor_progressbar_gfx_damage 5 "show damage effect when damaged at least by this amount; 0 disables the effect"
+seta hud_panel_healtharmor_progressbar_gfx_lowhealth 40 "health progressbar blinks when health is lower than this amount"
+seta hud_panel_healtharmor_progressbar_gfx_smooth 2 "smooth changes of the progressbar when health/armor change at least by this amount; 0 disables the effect"
 
 seta hud_panel_notify_time 10 "time that a new entry stays until it fades out"
 seta hud_panel_notify_fadetime 3 "fade out time"
index a623a39c91a59e44862a720ae0784c66292b80b6..102ea1e30f96147378c672e0d90cd2d6867855ec 100644 (file)
@@ -200,6 +200,9 @@ string autocvar_hud_panel_healtharmor_progressbar_armor;
 string autocvar_hud_panel_healtharmor_progressbar_health;
 float autocvar_hud_panel_healtharmor_progressbar_gfx;
 float autocvar_hud_panel_healtharmor_progressbar_gfx_damage;
+float autocvar_hud_panel_healtharmor_progressbar_gfx_lowhealth;
+float autocvar_hud_panel_healtharmor_progressbar_gfx_smooth;
+
 float autocvar_hud_panel_healtharmor_text;
 float autocvar_hud_panel_infomessages;
 float autocvar_hud_panel_infomessages_flip;
index dec1b7ff1176e4e01581fda429bd4f6265735810..749a23a4a3cbad3a32e7ea95c67c7ff4e2e75d5f 100644 (file)
@@ -1476,18 +1476,21 @@ void HUD_HealthArmor(void)
                                pain_health_alpha = 1;
                                if (autocvar_hud_panel_healtharmor_progressbar_gfx)
                                {
-                                       if (fabs(prev_health - health) >= 2)
+                                       if (autocvar_hud_panel_healtharmor_progressbar_gfx_smooth > 0)
                                        {
+                                               if (fabs(prev_health - health) >= autocvar_hud_panel_healtharmor_progressbar_gfx_smooth)
+                                               {
+                                                       if (time - old_p_healthtime < 1)
+                                                               old_p_health = prev_p_health;
+                                                       else
+                                                               old_p_health = prev_health;
+                                                       old_p_healthtime = time;
+                                               }
                                                if (time - old_p_healthtime < 1)
-                                                       old_p_health = prev_p_health;
-                                               else
-                                                       old_p_health = prev_health;
-                                               old_p_healthtime = time;
-                                       }
-                                       if (time - old_p_healthtime < 1)
-                                       {
-                                               p_health += (old_p_health - health) * (1 - (time - old_p_healthtime));
-                                               prev_p_health = p_health;
+                                               {
+                                                       p_health += (old_p_health - health) * (1 - (time - old_p_healthtime));
+                                                       prev_p_health = p_health;
+                                               }
                                        }
                                        if (autocvar_hud_panel_healtharmor_progressbar_gfx_damage > 0)
                                        {
@@ -1505,7 +1508,7 @@ void HUD_HealthArmor(void)
                                        }
                                        prev_health = health;
 
-                                       if (health <= 40)
+                                       if (health <= autocvar_hud_panel_healtharmor_progressbar_gfx_lowhealth)
                                        {
                                                float BLINK_FACTOR = 0.15;
                                                float BLINK_BASE = 0.85;
@@ -1528,18 +1531,21 @@ void HUD_HealthArmor(void)
                                p_armor = armor;
                                if (autocvar_hud_panel_healtharmor_progressbar_gfx)
                                {
-                                       if (fabs(prev_armor - armor) >= 2)
+                                       if (autocvar_hud_panel_healtharmor_progressbar_gfx_smooth > 0)
                                        {
+                                               if (fabs(prev_armor - armor) >= autocvar_hud_panel_healtharmor_progressbar_gfx_smooth)
+                                               {
+                                                       if (time - old_p_armortime < 1)
+                                                               old_p_armor = prev_p_armor;
+                                                       else
+                                                               old_p_armor = prev_armor;
+                                                       old_p_armortime = time;
+                                               }
                                                if (time - old_p_armortime < 1)
-                                                       old_p_armor = prev_p_armor;
-                                               else
-                                                       old_p_armor = prev_armor;
-                                               old_p_armortime = time;
-                                       }
-                                       if (time - old_p_armortime < 1)
-                                       {
-                                               p_armor += (old_p_armor - armor) * (1 - (time - old_p_armortime));
-                                               prev_p_armor = p_armor;
+                                               {
+                                                       p_armor += (old_p_armor - armor) * (1 - (time - old_p_armortime));
+                                                       prev_p_armor = p_armor;
+                                               }
                                        }
                                        if (autocvar_hud_panel_healtharmor_progressbar_gfx_damage > 0)
                                        {