diff options
| author | Joe Ludwig <[email protected]> | 2013-06-26 15:22:04 -0700 |
|---|---|---|
| committer | Joe Ludwig <[email protected]> | 2013-06-26 15:22:04 -0700 |
| commit | 39ed87570bdb2f86969d4be821c94b722dc71179 (patch) | |
| tree | abc53757f75f40c80278e87650ea92808274aa59 /mp/src/game/client/vgui_entitypanel.h | |
| download | source-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.tar.xz source-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.zip | |
First version of the SOurce SDK 2013
Diffstat (limited to 'mp/src/game/client/vgui_entitypanel.h')
| -rw-r--r-- | mp/src/game/client/vgui_entitypanel.h | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/mp/src/game/client/vgui_entitypanel.h b/mp/src/game/client/vgui_entitypanel.h new file mode 100644 index 00000000..f881b3ef --- /dev/null +++ b/mp/src/game/client/vgui_entitypanel.h @@ -0,0 +1,84 @@ +//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose: This is a panel which is rendered on top of an entity
+//
+// $Revision: $
+// $NoKeywords: $
+//=============================================================================//
+
+#ifndef VGUI_ENTITYPANEL_H
+#define VGUI_ENTITYPANEL_H
+
+#ifdef _WIN32
+#pragma once
+#endif
+
+#include "c_baseentity.h"
+#include <vgui/MouseCode.h>
+#include "vgui_basepanel.h"
+
+// forward declarations
+class KeyValues;
+
+
+//-----------------------------------------------------------------------------
+// This is a base class for a panel which always is rendered on top of an entity
+//-----------------------------------------------------------------------------
+class CEntityPanel : public CBasePanel
+{
+public:
+ DECLARE_CLASS( CEntityPanel, CBasePanel );
+
+ // constructor
+ CEntityPanel( vgui::Panel *pParent, const char *panelName );
+
+ virtual void ComputeParent( void );
+ virtual void ComputeAndSetSize( void );
+
+ // Initialize from key values
+ bool Init( KeyValues* pKeyValues, C_BaseEntity* pEntity );
+
+ // Determine where our entity is in screen space.
+ void GetEntityPosition( int& sx, int& sy );
+
+ // Base implementation of ShouldDraw
+ bool ShouldDraw();
+
+ // called when we're ticked (updates our position)...
+ virtual void OnTick( void );
+
+ virtual void OnCursorEntered();
+ virtual void OnCursorExited();
+
+ const char *GetMouseOverText( void );
+
+ C_BaseEntity* GetEntity() { return (C_BaseEntity*)m_pBaseEntity; }
+
+ // Attach to a new entity
+ void SetEntity( C_BaseEntity* pEntity );
+
+public:
+ enum
+ {
+ MAX_ENTITY_MOUSEOVER = 256
+ };
+
+ // Offset from entity that we should draw
+ int m_OffsetX, m_OffsetY;
+
+ char m_szMouseOverText[ MAX_ENTITY_MOUSEOVER ];
+
+ bool m_bShowInNormal;
+
+ int m_iOrgWidth;
+ int m_iOrgHeight;
+ int m_iOrgOffsetX;
+ int m_iOrgOffsetY;
+ float m_flScale;
+
+private:
+ // This is the entity to which we're attached
+ EHANDLE m_pBaseEntity;
+};
+
+#endif // VGUI_ENTITYPANEL_H
\ No newline at end of file |