+#include "ammo.qh"
+
+#include <common/t_items.qh>
+
// Ammo (#1)
void DrawNadeProgressBar(vector myPos, vector mySize, float progress, vector color)
autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
}
-void DrawAmmoNades(vector myPos, vector mySize, bool draw_expanding, float expand_time)
-{
- float bonusNades = STAT(NADE_BONUS);
- float bonusProgress = STAT(NADE_BONUS_SCORE);
- float bonusType = STAT(NADE_BONUS_TYPE);
- Nade def = Nades_from(bonusType);
- vector nadeColor = def.m_color;
- string nadeIcon = def.m_icon;
-
- vector iconPos, textPos;
-
- if(autocvar_hud_panel_ammo_iconalign)
- {
- iconPos = myPos + eX * 2 * mySize.y;
- textPos = myPos;
- }
- else
- {
- iconPos = myPos;
- textPos = myPos + eX * mySize.y;
- }
-
- if(bonusNades > 0 || bonusProgress > 0)
- {
- DrawNadeProgressBar(myPos, mySize, bonusProgress, nadeColor);
-
- if(autocvar_hud_panel_ammo_text)
- drawstring_aspect(textPos, ftos(bonusNades), eX * (2/3) * mySize.x + eY * mySize.y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
-
- if(draw_expanding)
- drawpic_aspect_skin_expanding(iconPos, nadeIcon, '1 1 0' * mySize.y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL, expand_time);
-
- drawpic_aspect_skin(iconPos, nadeIcon, '1 1 0' * mySize.y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
- }
-}
+void DrawAmmoNades(vector myPos, vector mySize, bool draw_expanding, float expand_time); // TODO: mutator
void DrawAmmoItem(vector myPos, vector mySize, .int ammoType, bool isCurrent, bool isInfinite)
{
+ TC(bool, isCurrent); TC(bool, isInfinite);
if(ammoType == ammo_none)
return;
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)
{
columns = ceil((total_ammo_count)/rows);
ammo_size = eX * mySize.x*(1/columns) + eY * mySize.y*(1/rows);
- vector offset = '0 0 0'; // fteqcc sucks
+ vector offset = '0 0 0';
float newSize;
if(ammo_size.x/ammo_size.y > 3)
{
ammo_size.y = newSize;
}
+ Weapon wep = switchweapon;
int i;
- bool infinite_ammo = (getstati(STAT_ITEMS, 0, 24) & IT_UNLIMITED_WEAPON_AMMO);
+ bool infinite_ammo = (STAT(ITEMS) & IT_UNLIMITED_WEAPON_AMMO);
row = column = 0;
if(autocvar_hud_panel_ammo_onlycurrent)
{
DrawAmmoItem(
pos,
ammo_size,
- (get_weaponinfo(switchweapon)).ammo_field,
+ wep.ammo_field,
true,
infinite_ammo
);
pos + eX * column * (ammo_size.x + offset.x) + eY * row * (ammo_size.y + offset.y),
ammo_size,
ammotype,
- ((get_weaponinfo(switchweapon)).ammo_field == ammotype),
+ (wep.ammo_field == ammotype),
infinite_ammo
);