summaryrefslogtreecommitdiff
path: root/game/client/tf/tf_hud_ammostatus.h
diff options
context:
space:
mode:
authorFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
committerFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
commit3bf9df6b2785fa6d951086978a3e66f49427166a (patch)
tree2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /game/client/tf/tf_hud_ammostatus.h
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'game/client/tf/tf_hud_ammostatus.h')
-rw-r--r--game/client/tf/tf_hud_ammostatus.h66
1 files changed, 66 insertions, 0 deletions
diff --git a/game/client/tf/tf_hud_ammostatus.h b/game/client/tf/tf_hud_ammostatus.h
new file mode 100644
index 0000000..a78b00f
--- /dev/null
+++ b/game/client/tf/tf_hud_ammostatus.h
@@ -0,0 +1,66 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+// $NoKeywords: $
+//=============================================================================//
+
+#ifndef TF_HUD_AMMOSTATUS_H
+#define TF_HUD_AMMOSTATUS_H
+#ifdef _WIN32
+#pragma once
+#endif
+
+#define TF_MAX_GRENADES 4
+#define TF_MAX_FILENAME_LENGTH 128
+
+//-----------------------------------------------------------------------------
+// Purpose: Displays weapon ammo data
+//-----------------------------------------------------------------------------
+class CTFHudWeaponAmmo : public CHudElement, public vgui::EditablePanel
+{
+ DECLARE_CLASS_SIMPLE( CTFHudWeaponAmmo, vgui::EditablePanel );
+
+public:
+
+ CTFHudWeaponAmmo( const char *pElementName );
+
+ virtual void ApplySchemeSettings( vgui::IScheme *pScheme );
+ virtual void Reset();
+
+ virtual bool ShouldDraw( void );
+
+protected:
+
+ virtual void OnThink();
+
+private:
+
+ void UpdateAmmoLabels( bool bPrimary, bool bReserve, bool bNoClip );
+ void ShowLowAmmoIndicator( void );
+ void SizeLowAmmoIndicator( float flCurrentAmount, float flMaxAmount );
+ void HideLowAmmoIndicator( void );
+
+private:
+
+ float m_flNextThink;
+
+ CHandle<C_BaseCombatWeapon> m_hCurrentActiveWeapon;
+ int m_nAmmo;
+ int m_nAmmo2;
+
+ int m_nLowAmmoImageOrigX;
+ int m_nLowAmmoImageOrigY;
+ int m_nLowAmmoImageOrigW;
+ int m_nLowAmmoImageOrigH;
+
+ CExLabel *m_pInClip;
+ CExLabel *m_pInClipShadow;
+ CExLabel *m_pInReserve;
+ CExLabel *m_pInReserveShadow;
+ CExLabel *m_pNoClip;
+ CExLabel *m_pNoClipShadow;
+ vgui::ImagePanel *m_pLowAmmoImage;
+};
+
+#endif // TF_HUD_AMMOSTATUS_H