summaryrefslogtreecommitdiff
path: root/game/client/vgui_bitmappanel.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/vgui_bitmappanel.h
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'game/client/vgui_bitmappanel.h')
-rw-r--r--game/client/vgui_bitmappanel.h72
1 files changed, 72 insertions, 0 deletions
diff --git a/game/client/vgui_bitmappanel.h b/game/client/vgui_bitmappanel.h
new file mode 100644
index 0000000..4ed1f43
--- /dev/null
+++ b/game/client/vgui_bitmappanel.h
@@ -0,0 +1,72 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose: This is a panel which is rendered image on top of an entity
+//
+// $Revision: $
+// $NoKeywords: $
+//=============================================================================//
+
+#ifndef VGUI_BITMAPPANEL_H
+#define VGUI_BITMAPPANEL_H
+
+#ifdef _WIN32
+#pragma once
+#endif
+
+#include <vgui_controls/Panel.h>
+
+//-----------------------------------------------------------------------------
+// forward declarations
+//-----------------------------------------------------------------------------
+class KeyValues;
+class BitmapImage;
+struct Bitmap_t;
+
+//-----------------------------------------------------------------------------
+// This is a base class for a panel which always is rendered on top of an entity
+//-----------------------------------------------------------------------------
+class CBitmapPanel : public vgui::Panel
+{
+ typedef vgui::Panel BaseClass;
+
+public:
+ // constructor
+ CBitmapPanel( );
+ CBitmapPanel( vgui::Panel *pParent, const char *pName );
+ ~CBitmapPanel();
+
+ // initialization
+ bool Init( KeyValues* pInitData );
+
+ // initialization from build-mode dialog style .res files
+ virtual void ApplySettings(KeyValues *inResourceData);
+
+ virtual void Paint( void );
+ virtual void PaintBackground( void ) {}
+
+ virtual void OnCursorEntered();
+ virtual void OnCursorExited();
+
+ // Setup for panels that aren't created by the commander overlay factory (i.e. aren't parsed from a keyvalues file)
+ virtual void SetImage( BitmapImage *pImage );
+
+ /// Set bitmap data directly
+ virtual void SetBitmap( const Bitmap_t &bitmap );
+
+ const char *GetMouseOverText( void );
+
+private:
+ enum
+ {
+ MAX_ENTITY_MOUSEOVER = 256
+ };
+ // The bitmap to render
+ BitmapImage *m_pImage;
+ int m_r, m_g, m_b, m_a;
+ bool m_bOwnsImage;
+
+ char m_szMouseOverText[ MAX_ENTITY_MOUSEOVER ];
+
+};
+
+#endif // VGUI_BITMAPPANEL_H \ No newline at end of file