29 mySize -
eX * autocvar_hud_panel_ammo_progressbar_xoffset * mySize.x,
31 progress, 0, 0, color,
37 TC(
bool, isCurrent);
TC(
bool, isInfinite);
38 if(ammoType == RES_NONE)
46 isCurrent = (ammoType == RES_ROCKETS);
50 ammo = getstati(GetAmmoStat(ammoType));
55 myPos = myPos + (mySize - mySize *
scale) * 0.5;
56 mySize = mySize *
scale;
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';
76 textColor =
'0.2 0.95 0';
80 textColor =
'0.8 0.04 0';
92 string text = isInfinite ?
"\xE2\x88\x9E" :
ftos(ammo);
114 if(
hud != HUD_NORMAL)
return;
142 int rows = 0, columns, row, column;
143 float nade_cnt = STAT(NADE_BONUS), nade_score = STAT(NADE_BONUS_SCORE);
144 bool draw_nades = (nade_cnt > 0 || nade_score > 0);
145 float nade_statuschange_elapsedtime;
146 int total_ammo_count;
150 total_ammo_count = 1;
168 columns =
ceil((total_ammo_count)/rows);
169 ammo_size =
vec2(mySize.x / columns, mySize.y / rows);
173 if(ammo_size.x/ammo_size.y > 3)
175 newSize = 3 * ammo_size.y;
176 offset.x = ammo_size.x - newSize;
178 ammo_size.x = newSize;
182 newSize = 1/3 * ammo_size.x;
183 offset.y = ammo_size.y - newSize;
185 ammo_size.y = newSize;
190 Weapon wep = wepent.switchweapon;
192 bool infinite_ammo = (STAT(ITEMS) & IT_UNLIMITED_AMMO);
225 Resource ammotype = GetAmmoTypeFromNum(j);
227 pos +
vec2(column * (ammo_size.x + offset.x), row * (ammo_size.y + offset.y)),
247 float f =
bound(0, nade_statuschange_elapsedtime*2, 1);
249 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);
bool autocvar_hud_panel_ammo_onlycurrent
bool autocvar_hud_panel_ammo_progressbar
#define draw_endBoldFont()
bool autocvar_hud_panel_ammo_iconalign
bool autocvar_hud_panel_ammo
void HUD_Panel_DrawProgressBar(vector theOrigin, vector theSize, string pic, float length_ratio, bool vertical, float baralign, vector theColor, float theAlpha, int drawflag)
void drawstring_aspect(vector pos, string text, vector sz, vector color, float theAlpha, float drawflag)
float HUD_GetRowCount(int item_count, vector size, float item_aspect)
string GetAmmoPicture(Resource ammotype)
bool autocvar__hud_configure
#define draw_beginBoldFont()
entity viewmodels[MAX_WEAPONSLOTS]
bool autocvar_hud_panel_ammo_hide_ondeath
bool autocvar_hud_panel_ammo_dynamichud
bool autocvar_hud_panel_ammo_text
float autocvar_hud_panel_ammo_progressbar_xoffset
void DrawNadeProgressBar(vector myPos, vector mySize, float progress, vector color)
#define HUD_Panel_DrawBg()
#define drawpic_aspect_skin(pos, pic, sz, color, theAlpha, drawflag)
Resource ammo_type
M: ammotype : main ammo type.
void DrawAmmoItem(vector myPos, vector mySize, Resource ammoType, bool isCurrent, bool isInfinite)
const float DRAWFLAG_NORMAL
int autocvar_hud_panel_ammo_maxammo
vector(float skel, float bonenum) _skel_get_boneabs_hidden
string autocvar_hud_panel_ammo_progressbar_name
float nade_statuschange_time
void HUD_Ammo_Export(int fh)
float autocvar_hud_panel_ammo_noncurrent_alpha
fields which are explicitly/manually set are marked with "M", fields set automatically are marked wit...
float autocvar_hud_progressbar_alpha
#define HUD_Write_Cvar(cvar)
float autocvar_hud_panel_ammo_noncurrent_scale
void HUD_Panel_LoadCvars()