Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

89 lines
2.7 KiB

  1. //========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: This is an entity that represents a vgui screen
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef VGUISCREEN_H
  8. #define VGUISCREEN_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. //-----------------------------------------------------------------------------
  13. // This is an entity that represents a vgui screen
  14. //-----------------------------------------------------------------------------
  15. class CVGuiScreen : public CBaseEntity
  16. {
  17. public:
  18. DECLARE_CLASS( CVGuiScreen, CBaseEntity );
  19. DECLARE_SERVERCLASS();
  20. DECLARE_DATADESC();
  21. CVGuiScreen();
  22. virtual void Precache();
  23. virtual bool KeyValue( const char *szKeyName, const char *szValue );
  24. virtual void Spawn();
  25. virtual void Activate();
  26. virtual void OnRestore();
  27. const char *GetPanelName() const;
  28. // Sets the screen size + resolution
  29. void SetActualSize( float flWidth, float flHeight );
  30. // Activates/deactivates the screen
  31. bool IsActive() const;
  32. void SetActive( bool bActive );
  33. // Is this screen only visible to teammates?
  34. bool IsVisibleOnlyToTeammates() const;
  35. void MakeVisibleOnlyToTeammates( bool bActive );
  36. bool IsVisibleToTeam( int nTeam );
  37. // Sets the overlay material
  38. void SetOverlayMaterial( const char *pMaterial );
  39. void SetAttachedToViewModel( bool bAttached );
  40. bool IsAttachedToViewModel() const;
  41. void SetTransparency( bool bTransparent );
  42. virtual int UpdateTransmitState( void );
  43. virtual int ShouldTransmit( const CCheckTransmitInfo *pInfo );
  44. void SetPlayerOwner( CBasePlayer *pPlayer, bool bOwnerOnlyInput = false );
  45. private:
  46. void SetAttachmentIndex( int nIndex );
  47. void SetPanelName( const char *pPanelName );
  48. void InputSetActive( inputdata_t &inputdata );
  49. void InputSetInactive( inputdata_t &inputdata );
  50. string_t m_strOverlayMaterial;
  51. bool m_bIsTransparent;
  52. CNetworkVar( float, m_flWidth );
  53. CNetworkVar( float, m_flHeight );
  54. CNetworkVar( int, m_nPanelName ); // The name of the panel
  55. CNetworkVar( int, m_nAttachmentIndex );
  56. CNetworkVar( int, m_nOverlayMaterial );
  57. CNetworkVar( int, m_fScreenFlags );
  58. CNetworkVar( EHANDLE, m_hPlayerOwner );
  59. friend CVGuiScreen *CreateVGuiScreen( const char *pScreenClassname, const char *pScreenType, CBaseEntity *pAttachedTo, CBaseEntity *pOwner, int nAttachmentIndex );
  60. };
  61. void PrecacheVGuiScreen( const char *pScreenType );
  62. void PrecacheVGuiScreenOverlayMaterial( const char *pMaterialName );
  63. CVGuiScreen *CreateVGuiScreen( const char *pScreenClassname, const char *pScreenType, CBaseEntity *pAttachedTo, CBaseEntity *pOwner, int nAttachmentIndex );
  64. void DestroyVGuiScreen( CVGuiScreen *pVGuiScreen );
  65. #endif // VGUISCREEN_H