X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fclient%2Fhud%2Fpanel%2Fammo.qc;h=bd3ccd068160d9130db8f308fe28548a4c092dad;hb=a73bd5e59f556bba8d778bf2a7b5bc15d02523ee;hp=6c37aa13a89ea740d944d2a46aec0bd1d1c0bb9c;hpb=71ce27cd515d7e8157535466ef357f83253b64f0;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/client/hud/panel/ammo.qc b/qcsrc/client/hud/panel/ammo.qc index 6c37aa13a..bd3ccd068 100644 --- a/qcsrc/client/hud/panel/ammo.qc +++ b/qcsrc/client/hud/panel/ammo.qc @@ -1,3 +1,7 @@ +#include "ammo.qh" + +#include + // Ammo (#1) void DrawNadeProgressBar(vector myPos, vector mySize, float progress, vector color) @@ -14,6 +18,7 @@ void DrawAmmoNades(vector myPos, vector mySize, bool draw_expanding, float expan void DrawAmmoItem(vector myPos, vector mySize, .int ammoType, bool isCurrent, bool isInfinite) { + TC(bool, isCurrent); TC(bool, isInfinite); if(ammoType == ammo_none) return; @@ -93,8 +98,10 @@ void HUD_Ammo() if(hud != HUD_NORMAL) return; if(!autocvar__hud_configure) { - if(!autocvar_hud_panel_ammo) return; - if(spectatee_status == -1) return; + if((!autocvar_hud_panel_ammo) || (spectatee_status == -1)) + return; + if(STAT(HEALTH) < 1 && autocvar_hud_panel_ammo_hide_ondeath) + return; } HUD_Panel_UpdateCvars(); @@ -105,6 +112,10 @@ void HUD_Ammo() pos = panel_pos; mySize = panel_size; + if (autocvar_hud_panel_ammo_dynamichud) + HUD_Scale_Enable(); + else + HUD_Scale_Disable(); HUD_Panel_DrawBg(1); if(panel_bg_padding) { @@ -141,7 +152,7 @@ void HUD_Ammo() columns = ceil((total_ammo_count)/rows); ammo_size = eX * mySize.x*(1/columns) + eY * mySize.y*(1/rows); - vector offset = '0 0 0'; // fteqcc sucks + vector offset = '0 0 0'; float newSize; if(ammo_size.x/ammo_size.y > 3) { @@ -160,7 +171,7 @@ void HUD_Ammo() Weapon wep = switchweapon; int i; - bool infinite_ammo = (getstati(STAT_ITEMS, 0, 24) & IT_UNLIMITED_WEAPON_AMMO); + bool infinite_ammo = (STAT(ITEMS) & IT_UNLIMITED_WEAPON_AMMO); row = column = 0; if(autocvar_hud_panel_ammo_onlycurrent) {