#include "ammo.qh"
-#include <client/autocvars.qh>
-#include <client/defs.qh>
-#include <client/miscfunctions.qh>
+#include <client/draw.qh>
+#include <client/items/items.qh>
#include <client/view.qh>
-#include <common/t_items.qh>
+#include <common/mutators/mutator/nades/nades.qh>
#include <common/wepent.qh>
// Ammo (#1)
+void HUD_Ammo_Export(int fh)
+{
+ // allow saving cvars that aesthetically change the panel into hud skin files
+ HUD_Write_Cvar("hud_panel_ammo_onlycurrent");
+ HUD_Write_Cvar("hud_panel_ammo_noncurrent_alpha");
+ HUD_Write_Cvar("hud_panel_ammo_noncurrent_scale");
+ HUD_Write_Cvar("hud_panel_ammo_iconalign");
+ HUD_Write_Cvar("hud_panel_ammo_progressbar");
+ HUD_Write_Cvar("hud_panel_ammo_progressbar_name");
+ HUD_Write_Cvar("hud_panel_ammo_progressbar_xoffset");
+ HUD_Write_Cvar("hud_panel_ammo_text");
+}
+
void DrawNadeProgressBar(vector myPos, vector mySize, float progress, vector color)
{
HUD_Panel_DrawProgressBar(
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
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 + 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
);