X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fclient%2Fhud%2Fpanel%2Fhealtharmor.qc;h=6407628e85b5cf25bae92169f6a8bb4e053f9e8f;hb=d1179864ddf7821d800884ce58b57d206f68f761;hp=8f279f2aadc2e1e1c46db7d7118af4da94a75c12;hpb=45dfc727cef14412598d619e1704d1b70dc64b64;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/client/hud/panel/healtharmor.qc b/qcsrc/client/hud/panel/healtharmor.qc index 8f279f2aa..6407628e8 100644 --- a/qcsrc/client/hud/panel/healtharmor.qc +++ b/qcsrc/client/hud/panel/healtharmor.qc @@ -1,26 +1,30 @@ #include "healtharmor.qh" +#include "scoreboard.qh" #include -/** Health/armor (#3) */ +// Health/armor (#3) + void HUD_HealthArmor() { int armor, health, fuel; if(!autocvar__hud_configure) { - if(!autocvar_hud_panel_healtharmor) return; + if((!autocvar_hud_panel_healtharmor) || (spectatee_status == -1)) + return; if(hud != HUD_NORMAL) return; - if(spectatee_status == -1) return; health = STAT(HEALTH); if(health <= 0) { + health = 0; prev_health = -1; - return; + if(autocvar_hud_panel_healtharmor_hide_ondeath) + return; } armor = STAT(ARMOR); - // code to check for spectatee_status changes is in Ent_ClientData() + // code to check for spectatee_status changes is in ENT_CLIENT_CLIENTDATA // prev_p_health and prev_health can be set to -1 there if (prev_p_health == -1) @@ -54,7 +58,9 @@ void HUD_HealthArmor() fuel = 20; } - HUD_Panel_UpdateCvars(); + if(1 - scoreboard_fade_alpha <= 0) + return; + HUD_Panel_UpdateCvars(1 - scoreboard_fade_alpha); draw_beginBoldFont(); @@ -62,7 +68,11 @@ void HUD_HealthArmor() pos = panel_pos; mySize = panel_size; - HUD_Panel_DrawBg(1); + if (autocvar_hud_panel_healtharmor_dynamichud) + HUD_Scale_Enable(); + else + HUD_Scale_Disable(); + HUD_Panel_DrawBg(); if(panel_bg_padding) { pos += '1 1 0' * panel_bg_padding;