diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /game/shared/tf2/weapon_objectselection.h | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'game/shared/tf2/weapon_objectselection.h')
| -rw-r--r-- | game/shared/tf2/weapon_objectselection.h | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/game/shared/tf2/weapon_objectselection.h b/game/shared/tf2/weapon_objectselection.h new file mode 100644 index 0000000..90f86bb --- /dev/null +++ b/game/shared/tf2/weapon_objectselection.h @@ -0,0 +1,69 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +// $NoKeywords: $ +//=============================================================================// + +#ifndef WEAPON_OBJECTSELECTION_H +#define WEAPON_OBJECTSELECTION_H +#ifdef _WIN32 +#pragma once +#endif + +#if defined( CLIENT_DLL ) +#define CWeaponObjectSelection C_WeaponObjectSelection +#endif + +//----------------------------------------------------------------------------- +// Purpose: This is a 'weapon' that's used to put objects into the client's weapon selection +//----------------------------------------------------------------------------- +class CWeaponObjectSelection : public CBaseTFCombatWeapon +{ + DECLARE_CLASS( CWeaponObjectSelection, CBaseTFCombatWeapon ); +public: + DECLARE_NETWORKCLASS(); + DECLARE_PREDICTABLE(); + + CWeaponObjectSelection(); + +#if defined( CLIENT_DLL ) + virtual void PreDataUpdate( DataUpdateType_t updateType ); + virtual void PostDataUpdate( DataUpdateType_t updateType ); + virtual void OnDataChanged( DataUpdateType_t updateType ); +#endif + + // Overridden to handle objects + virtual bool CanDeploy( void ); + virtual bool HasAmmo( void ); + virtual int GetSubType( void ); + virtual int GetSlot( void ) const; + virtual int GetPosition( void ) const; + virtual const char *GetPrintName( void ) const; + +#ifdef CLIENT_DLL + virtual CHudTexture const *GetSpriteActive( void ) const; + virtual CHudTexture const *GetSpriteInactive( void ) const; +#endif + + // Set this selection's object type + void SetType( int iType ); + void SetupObjectSelectionSprite( void ); + + virtual bool SupportsTwoHanded( void ) { return true; }; + +protected: + CNetworkVar( int, m_iObjectType ); + int m_iOldObjectType; + +#ifdef CLIENT_DLL + CHudTexture *m_pSelectionTexture; + bool m_bNeedSpriteSetup; + vgui::HFont m_hNumberFont; +#endif + +private: + CWeaponObjectSelection( const CWeaponObjectSelection & ); +}; + +#endif // WEAPON_OBJECTSELECTION_H |