]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/hud/panel/ammo.qc
Allow to hide panels that don't make too much sense when dead (cl_deathscoreboard...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / hud / panel / ammo.qc
index 6c0621f42371af31916bb7d12c85323dea6bcef2..bd3ccd068160d9130db8f308fe28548a4c092dad 100644 (file)
@@ -1,3 +1,7 @@
+#include "ammo.qh"
+
+#include <common/t_items.qh>
+
 // Ammo (#1)
 
 void DrawNadeProgressBar(vector myPos, vector mySize, float progress, vector color)
@@ -14,6 +18,7 @@ void DrawAmmoNades(vector myPos, vector mySize, bool draw_expanding, float expan
 
 void DrawAmmoItem(vector myPos, vector mySize, .int ammoType, bool isCurrent, bool isInfinite)
 {
+    TC(bool, isCurrent); TC(bool, isInfinite);
        if(ammoType == ammo_none)
                return;
 
@@ -93,8 +98,10 @@ void HUD_Ammo()
        if(hud != HUD_NORMAL) return;
        if(!autocvar__hud_configure)
        {
-               if(!autocvar_hud_panel_ammo) return;
-               if(spectatee_status == -1) return;
+               if((!autocvar_hud_panel_ammo) || (spectatee_status == -1))
+                       return;
+               if(STAT(HEALTH) < 1 && autocvar_hud_panel_ammo_hide_ondeath)
+                       return;
        }
 
        HUD_Panel_UpdateCvars();
@@ -105,6 +112,10 @@ void HUD_Ammo()
        pos = panel_pos;
        mySize = panel_size;
 
+       if (autocvar_hud_panel_ammo_dynamichud)
+               HUD_Scale_Enable();
+       else
+               HUD_Scale_Disable();
        HUD_Panel_DrawBg(1);
        if(panel_bg_padding)
        {