From: terencehill Date: Mon, 25 Apr 2011 10:34:19 +0000 (+0200) Subject: cvar hud_panel_healtharmor_progressbar_gfx_damage to customize the amount of damage... X-Git-Tag: xonotic-v0.5.0~269^2~11 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=a4848a2ac66e8651754639a5415d40e36f36d2ab;p=xonotic%2Fxonotic-data.pk3dir.git cvar hud_panel_healtharmor_progressbar_gfx_damage to customize the amount of damage needed to show the damage effect, 0 to disable the effect (default 5) Use it when refreshing the effect too; in this case when damaged and health quickly rotting the previous value of 1 caused the effect to look like it get stuck --- diff --git a/defaultXonotic.cfg b/defaultXonotic.cfg index 675034af3..b6200b11c 100644 --- a/defaultXonotic.cfg +++ b/defaultXonotic.cfg @@ -1422,6 +1422,7 @@ 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_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 d06c31a12..a623a39c9 100644 --- a/qcsrc/client/autocvars.qh +++ b/qcsrc/client/autocvars.qh @@ -198,7 +198,8 @@ float autocvar_hud_panel_healtharmor_maxhealth; float autocvar_hud_panel_healtharmor_progressbar; string autocvar_hud_panel_healtharmor_progressbar_armor; string autocvar_hud_panel_healtharmor_progressbar_health; -string autocvar_hud_panel_healtharmor_progressbar_gfx; +float autocvar_hud_panel_healtharmor_progressbar_gfx; +float autocvar_hud_panel_healtharmor_progressbar_gfx_damage; 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 05b268d63..886fd8fee 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -1466,9 +1466,9 @@ void HUD_HealthArmor(void) pain_health_alpha = 1; if (autocvar_hud_panel_healtharmor_progressbar_gfx) { - if (saved_health == -1) + if (autocvar_hud_panel_healtharmor_progressbar_gfx_damage > 0 && saved_health == -1) { - if (prev_health == 0 || prev_health - health >= 3) + if (prev_health == 0 || prev_health - health >= autocvar_hud_panel_healtharmor_progressbar_gfx_damage) { health_time = time; saved_health = prev_health; @@ -1484,7 +1484,7 @@ void HUD_HealthArmor(void) else { HUD_Panel_DrawProgressBar(pos + health_offset, mySize, autocvar_hud_panel_healtharmor_progressbar_health, saved_health/maxhealth, is_vertical, health_baralign, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * (1 - d * d), DRAWFLAG_NORMAL); - if (prev_health - health >= 1) //refresh the effect if repeatedly damaged + if (prev_health - health >= autocvar_hud_panel_healtharmor_progressbar_gfx_damage) //refresh the effect if repeatedly damaged health_time = time; } } @@ -1516,9 +1516,9 @@ void HUD_HealthArmor(void) p_armor = armor; if (autocvar_hud_panel_healtharmor_progressbar_gfx) { - if (saved_armor == -1) + if (autocvar_hud_panel_healtharmor_progressbar_gfx_damage > 0 && saved_armor == -1) { - if (prev_armor == 0 || prev_armor - armor >= 3) + if (prev_armor == 0 || prev_armor - armor >= autocvar_hud_panel_healtharmor_progressbar_gfx_damage) { armor_time = time; saved_armor = prev_armor; @@ -1534,7 +1534,7 @@ void HUD_HealthArmor(void) else { HUD_Panel_DrawProgressBar(pos + armor_offset, mySize, autocvar_hud_panel_healtharmor_progressbar_armor, saved_armor/maxarmor, is_vertical, armor_baralign, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * (1 - d * d), DRAWFLAG_NORMAL); - if (prev_armor - armor >= 1) //refresh the effect if repeatedly damaged + if (prev_armor - armor >= autocvar_hud_panel_healtharmor_progressbar_gfx_damage) //refresh the effect if repeatedly damaged armor_time = time; } }