aboutsummaryrefslogtreecommitdiff
path: root/mp/src/game/server/vguiscreen.h
diff options
context:
space:
mode:
authorJoe Ludwig <[email protected]>2013-06-26 15:22:04 -0700
committerJoe Ludwig <[email protected]>2013-06-26 15:22:04 -0700
commit39ed87570bdb2f86969d4be821c94b722dc71179 (patch)
treeabc53757f75f40c80278e87650ea92808274aa59 /mp/src/game/server/vguiscreen.h
downloadsource-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.tar.xz
source-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.zip
First version of the SOurce SDK 2013
Diffstat (limited to 'mp/src/game/server/vguiscreen.h')
-rw-r--r--mp/src/game/server/vguiscreen.h88
1 files changed, 88 insertions, 0 deletions
diff --git a/mp/src/game/server/vguiscreen.h b/mp/src/game/server/vguiscreen.h
new file mode 100644
index 00000000..aa3b6793
--- /dev/null
+++ b/mp/src/game/server/vguiscreen.h
@@ -0,0 +1,88 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose: This is an entity that represents a vgui screen
+//
+// $NoKeywords: $
+//=============================================================================//
+
+#ifndef VGUISCREEN_H
+#define VGUISCREEN_H
+
+#ifdef _WIN32
+#pragma once
+#endif
+
+
+//-----------------------------------------------------------------------------
+// This is an entity that represents a vgui screen
+//-----------------------------------------------------------------------------
+class CVGuiScreen : public CBaseEntity
+{
+public:
+ DECLARE_CLASS( CVGuiScreen, CBaseEntity );
+
+ DECLARE_SERVERCLASS();
+ DECLARE_DATADESC();
+
+ CVGuiScreen();
+
+ virtual void Precache();
+ virtual bool KeyValue( const char *szKeyName, const char *szValue );
+ virtual void Spawn();
+ virtual void Activate();
+ virtual void OnRestore();
+
+ const char *GetPanelName() const;
+
+ // Sets the screen size + resolution
+ void SetActualSize( float flWidth, float flHeight );
+
+ // Activates/deactivates the screen
+ bool IsActive() const;
+ void SetActive( bool bActive );
+
+ // Is this screen only visible to teammates?
+ bool IsVisibleOnlyToTeammates() const;
+ void MakeVisibleOnlyToTeammates( bool bActive );
+ bool IsVisibleToTeam( int nTeam );
+
+ // Sets the overlay material
+ void SetOverlayMaterial( const char *pMaterial );
+
+ void SetAttachedToViewModel( bool bAttached );
+ bool IsAttachedToViewModel() const;
+
+ void SetTransparency( bool bTransparent );
+
+ virtual int UpdateTransmitState( void );
+ virtual int ShouldTransmit( const CCheckTransmitInfo *pInfo );
+
+ void SetPlayerOwner( CBasePlayer *pPlayer, bool bOwnerOnlyInput = false );
+
+private:
+ void SetAttachmentIndex( int nIndex );
+ void SetPanelName( const char *pPanelName );
+ void InputSetActive( inputdata_t &inputdata );
+ void InputSetInactive( inputdata_t &inputdata );
+
+ string_t m_strOverlayMaterial;
+
+ CNetworkVar( float, m_flWidth );
+ CNetworkVar( float, m_flHeight );
+ CNetworkVar( int, m_nPanelName ); // The name of the panel
+ CNetworkVar( int, m_nAttachmentIndex );
+ CNetworkVar( int, m_nOverlayMaterial );
+ CNetworkVar( int, m_fScreenFlags );
+ CNetworkVar( EHANDLE, m_hPlayerOwner );
+
+ friend CVGuiScreen *CreateVGuiScreen( const char *pScreenClassname, const char *pScreenType, CBaseEntity *pAttachedTo, CBaseEntity *pOwner, int nAttachmentIndex );
+};
+
+
+void PrecacheVGuiScreen( const char *pScreenType );
+void PrecacheVGuiScreenOverlayMaterial( const char *pMaterialName );
+CVGuiScreen *CreateVGuiScreen( const char *pScreenClassname, const char *pScreenType, CBaseEntity *pAttachedTo, CBaseEntity *pOwner, int nAttachmentIndex );
+void DestroyVGuiScreen( CVGuiScreen *pVGuiScreen );
+
+
+#endif // VGUISCREEN_H