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"
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;
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)
{
}
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;
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)
{