#include "ammo.qh"
+
+#include <common/t_items.qh>
+
// Ammo (#1)
void DrawNadeProgressBar(vector myPos, vector mySize, float progress, vector color)
void DrawAmmoItem(vector myPos, vector mySize, .int ammoType, bool isCurrent, bool isInfinite)
{
+ TC(bool, isCurrent); TC(bool, isInfinite);
if(ammoType == ammo_none)
return;
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();
+ HUD_Panel_LoadCvars();
draw_beginBoldFont();
pos = panel_pos;
mySize = panel_size;
- HUD_Panel_DrawBg(1);
+ if (autocvar_hud_panel_ammo_dynamichud)
+ HUD_Scale_Enable();
+ else
+ HUD_Scale_Disable();
+ HUD_Panel_DrawBg();
if(panel_bg_padding)
{
pos += '1 1 0' * panel_bg_padding;
ammo_size.y = newSize;
}
- Weapon wep = switchweapon;
+ entity wepent = viewmodels[0]; // TODO: unhardcode
+
+ Weapon wep = wepent.switchweapon;
int i;
bool infinite_ammo = (STAT(ITEMS) & IT_UNLIMITED_WEAPON_AMMO);
row = column = 0;