#include "ammo.qh"
+#include <client/autocvars.qh>
+#include <client/defs.qh>
+#include <client/miscfunctions.qh>
+#include <client/view.qh>
#include <common/t_items.qh>
+#include <common/wepent.qh>
+#include <common/mutators/mutator/nades/nades.qh>
// Ammo (#1)
autocvar_hud_progressbar_alpha * 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)
+void DrawAmmoItem(vector myPos, vector mySize, int ammoType, bool isCurrent, bool isInfinite)
{
- TC(bool, isCurrent); TC(bool, isInfinite);
- if(ammoType == ammo_none)
+ TC(bool, isCurrent); TC(bool, isInfinite);
+ if(ammoType == RES_NONE)
return;
// Initialize variables
int ammo;
if(autocvar__hud_configure)
{
- isCurrent = (ammoType == ammo_rockets); // Rockets always current
+ isCurrent = (ammoType == RES_ROCKETS); // Rockets always current
ammo = 60;
}
else
rows = HUD_GetRowCount(total_ammo_count, mySize, 3);
columns = ceil((total_ammo_count)/rows);
- ammo_size = eX * mySize.x*(1/columns) + eY * mySize.y*(1/rows);
+ ammo_size = vec2(mySize.x / columns, mySize.y / rows);
vector offset = '0 0 0';
float newSize;
Weapon wep = wepent.switchweapon;
int i;
- bool infinite_ammo = (STAT(ITEMS) & IT_UNLIMITED_WEAPON_AMMO);
+ bool infinite_ammo = (STAT(ITEMS) & IT_UNLIMITED_AMMO);
row = column = 0;
if(autocvar_hud_panel_ammo_onlycurrent)
{
if(autocvar__hud_configure)
{
- DrawAmmoItem(pos, ammo_size, ammo_rockets, true, false);
+ DrawAmmoItem(pos, ammo_size, RES_ROCKETS, true, false);
}
else
{
DrawAmmoItem(
pos,
ammo_size,
- wep.ammo_field,
+ wep.ammo_type,
true,
infinite_ammo
);
}
else
{
- .int ammotype;
+ int ammotype;
row = column = 0;
for(i = 0; i < AMMO_COUNT; ++i)
{
- ammotype = GetAmmoFieldFromNum(i);
+ ammotype = GetAmmoTypeFromNum(i);
DrawAmmoItem(
- pos + eX * column * (ammo_size.x + offset.x) + eY * row * (ammo_size.y + offset.y),
+ pos + vec2(column * (ammo_size.x + offset.x), row * (ammo_size.y + offset.y)),
ammo_size,
ammotype,
- (wep.ammo_field == ammotype),
+ (wep.ammo_type == ammotype),
infinite_ammo
);
float f = bound(0, nade_statuschange_elapsedtime*2, 1);
- DrawAmmoNades(pos + eX * column * (ammo_size.x + offset.x) + eY * row * (ammo_size.y + offset.y), ammo_size, nade_prevstatus < nade_cnt && nade_cnt != 0 && f < 1, f);
+ DrawAmmoNades(pos + vec2(column * (ammo_size.x + offset.x), row * (ammo_size.y + offset.y)), ammo_size, nade_prevstatus < nade_cnt && nade_cnt != 0 && f < 1, f);
}
draw_endBoldFont();