31 progress, 0, 0,
color,
37 TC(
bool, isCurrent);
TC(
bool, isInfinite);
38 if (ammoType == RES_NONE)
46 isCurrent = (ammoType == RES_ROCKETS);
55 myPos += (mySize - mySize *
scale) * 0.5;
62 iconPos = myPos +
eX * 2 * mySize.y;
68 textPos = myPos +
eX * mySize.y;
71 bool isShadowed = (
ammo <= 0 && !isCurrent && !isInfinite);
73 vector iconColor = isShadowed ?
'0 0 0' :
'1 1 1';
75 if (isInfinite) textColor =
'0.2 0.95 0';
76 else if (isShadowed) textColor =
'0 0 0';
77 else if (
ammo < 10) textColor =
'0.8 0.04 0';
78 else textColor =
'1 1 1';
88 string text = isInfinite ?
"\xE2\x88\x9E" :
ftos(
ammo);
138 int rows = 0, columns, row, column;
139 float nade_cnt =
STAT(NADE_BONUS), nade_score =
STAT(NADE_BONUS_SCORE);
140 bool draw_nades = (nade_cnt > 0 || nade_score > 0);
141 float nade_statuschange_elapsedtime;
142 int total_ammo_count;
146 total_ammo_count = 1;
164 columns =
ceil(total_ammo_count / rows);
165 ammo_size =
vec2(mySize.x / columns, mySize.y / rows);
169 if (ammo_size.x / ammo_size.y > 3)
171 newSize = 3 * ammo_size.y;
172 offset.x = ammo_size.x - newSize;
173 pos.x += offset.x * 0.5;
174 ammo_size.x = newSize;
178 newSize = 1/3 * ammo_size.x;
179 offset.y = ammo_size.y - newSize;
180 pos.y += offset.y * 0.5;
181 ammo_size.y = newSize;
186 Weapon wep = wepent.switchweapon;
216 pos + vec2(column * (ammo_size.x + offset.x), row * (ammo_size.y + offset.y)),
219 (wep.ammo_type == it),
236 float f =
bound(0, nade_statuschange_elapsedtime * 2, 1);
237 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);
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
void DrawAmmoNades(vector myPos, vector mySize, bool draw_expanding, float expand_time)
fields which are explicitly/manually set are marked with "M", fields set automatically are marked wit...
Resource ammo_type
M: ammotype : main ammo type.
void drawstring_aspect(vector pos, string text, vector sz, vector color, float theAlpha, float drawflag)
#define drawpic_aspect_skin(pos, pic, sz, color, theAlpha, drawflag)
#define draw_beginBoldFont()
#define draw_endBoldFont()
void HUD_Ammo_Export(int fh)
void DrawAmmoItem(vector myPos, vector mySize, Resource ammoType, bool isCurrent, bool isInfinite)
void DrawNadeProgressBar(vector myPos, vector mySize, float progress, vector color)
float nade_statuschange_time
bool autocvar_hud_panel_ammo
bool autocvar_hud_panel_ammo_text
bool autocvar_hud_panel_ammo_progressbar
bool autocvar_hud_panel_ammo_hide_ondeath
bool autocvar_hud_panel_ammo_dynamichud
bool autocvar_hud_panel_ammo_onlycurrent
int autocvar_hud_panel_ammo_maxammo
bool autocvar_hud_panel_ammo_iconalign
string autocvar_hud_panel_ammo_progressbar_name
float autocvar_hud_panel_ammo_noncurrent_alpha
float autocvar_hud_panel_ammo_noncurrent_scale
float autocvar_hud_panel_ammo_progressbar_xoffset
int spectatee_status
the -1 disables HUD panels before CSQC receives necessary data
const int IT_UNLIMITED_AMMO
const float DRAWFLAG_NORMAL
void HUD_Panel_DrawProgressBar(vector theOrigin, vector theSize, string pic, float length_ratio, bool vertical, float baralign, vector theColor, float theAlpha, int drawflag)
void HUD_Panel_LoadCvars()
float HUD_GetRowCount(int item_count, vector size, float item_aspect)
float autocvar_hud_progressbar_alpha
#define HUD_Panel_DrawBg()
#define HUD_Write_Cvar(cvar)
bool autocvar__hud_configure
#define IL_EACH(this, cond, body)
IntrusiveList default_order_resources
entity viewmodels[MAX_WEAPONSLOTS]
int GetAmmoStat(Resource ammotype)