From: terencehill Date: Tue, 26 Apr 2011 09:46:41 +0000 (+0200) Subject: Now each progressbar effect got its own cvar X-Git-Tag: xonotic-v0.5.0~269^2~4 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=56e0d92ffdf1b4d56f97876104228228ede51557;p=xonotic%2Fxonotic-data.pk3dir.git Now each progressbar effect got its own cvar hud_panel_healtharmor_progressbar_gfx hud_panel_healtharmor_progressbar_gfx_damage hud_panel_healtharmor_progressbar_gfx_lowhealth hud_panel_healtharmor_progressbar_gfx_smooth --- diff --git a/defaultXonotic.cfg b/defaultXonotic.cfg index b6200b11c..16249a026 100644 --- a/defaultXonotic.cfg +++ b/defaultXonotic.cfg @@ -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" diff --git a/qcsrc/client/autocvars.qh b/qcsrc/client/autocvars.qh index a623a39c9..102ea1e30 100644 --- a/qcsrc/client/autocvars.qh +++ b/qcsrc/client/autocvars.qh @@ -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; diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index dec1b7ff1..749a23a4a 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -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) {