]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/hud/panel/healtharmor.qc
Port more scoreboard cvars to the hud skins
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / hud / panel / healtharmor.qc
index bab17556d477bf9801af055822d450c2fa165a10..bc4291a948648e8eb5f8cf843c683cdc17d7ba1c 100644 (file)
@@ -1,3 +1,7 @@
+#include "healtharmor.qh"
+
+#include <common/deathtypes/all.qh>
+
 /** Health/armor (#3) */
 void HUD_HealthArmor()
 {
@@ -8,13 +12,13 @@ void HUD_HealthArmor()
                if(hud != HUD_NORMAL) return;
                if(spectatee_status == -1) return;
 
-               health = getstati(STAT_HEALTH);
+               health = STAT(HEALTH);
                if(health <= 0)
                {
                        prev_health = -1;
                        return;
                }
-               armor = getstati(STAT_ARMOR);
+               armor = STAT(ARMOR);
 
                // code to check for spectatee_status changes is in Ent_ClientData()
                // prev_p_health and prev_health can be set to -1 there
@@ -58,6 +62,10 @@ void HUD_HealthArmor()
        pos = panel_pos;
        mySize = panel_size;
 
+       if (autocvar_hud_panel_healtharmor_dynamichud)
+               HUD_Scale_Enable();
+       else
+               HUD_Scale_Disable();
        HUD_Panel_DrawBg(1);
        if(panel_bg_padding)
        {
@@ -70,7 +78,7 @@ void HUD_HealthArmor()
 
     int maxhealth = autocvar_hud_panel_healtharmor_maxhealth;
     int maxarmor = autocvar_hud_panel_healtharmor_maxarmor;
-       if(autocvar_hud_panel_healtharmor == 2) // combined health and armor display
+       if(autocvar_hud_panel_healtharmor_combined) // combined health and armor display
        {
                vector v;
                v = healtharmor_maxdamage(health, armor, armorblockpercent, DEATH_WEAPON.m_id);