- switch(type) {
- case 0: fullammo = autocvar_hud_panel_weapons_ammo_full_shells; break;
- case 1: fullammo = autocvar_hud_panel_weapons_ammo_full_nails; break;
- case 2: fullammo = autocvar_hud_panel_weapons_ammo_full_rockets; break;
- case 3: fullammo = autocvar_hud_panel_weapons_ammo_full_cells; break;
- case 4: fullammo = autocvar_hud_panel_weapons_ammo_full_fuel; break;
- default: fullammo = 60;
- }
-
- vector barsize;
- vector barpos;
- if(wpnsize_x/wpnsize_y > autocvar_hud_panel_weapons_aspect)
- {
- barsize_x = autocvar_hud_panel_weapons_aspect * wpnsize_y;
- barsize_y = wpnsize_y;
-
- barpos_x = wpnpos_x + (wpnsize_x - barsize_x) / 2;
- barpos_y = wpnpos_y;
- }
- else
- {
- barsize_y = 1/autocvar_hud_panel_weapons_aspect * wpnsize_x;
- barsize_x = wpnsize_x;
-
- barpos_y = wpnpos_y + (wpnsize_y - barsize_y) / 2;
- barpos_x = wpnpos_x;
- }
-
- drawsetcliparea(
- barpos_x,
- barpos_y,
- barsize_x * bound(0, a/fullammo, 1),
- barsize_y);
- drawpic_aspect_skin(wpnpos, "weapon_ammo", wpnsize, autocvar_hud_panel_weapons_ammo_color, panel_fg_alpha * autocvar_hud_panel_weapons_ammo_alpha, DRAWFLAG_NORMAL);
- drawresetcliparea();
+ barsize_x = autocvar_hud_panel_weapons_aspect * wpnsize_y;
+ barsize_y = wpnsize_y;
+
+ barpos_x = wpnpos_x + (wpnsize_x - barsize_x) / 2;
+ barpos_y = wpnpos_y;