summaryrefslogtreecommitdiff
path: root/game/client/tf2/playeroverlayclass.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/tf2/playeroverlayclass.h
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'game/client/tf2/playeroverlayclass.h')
-rw-r--r--game/client/tf2/playeroverlayclass.h72
1 files changed, 72 insertions, 0 deletions
diff --git a/game/client/tf2/playeroverlayclass.h b/game/client/tf2/playeroverlayclass.h
new file mode 100644
index 0000000..ab4483d
--- /dev/null
+++ b/game/client/tf2/playeroverlayclass.h
@@ -0,0 +1,72 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+// $Workfile: $
+// $Date: $
+// $NoKeywords: $
+//=============================================================================//
+
+#if !defined( PLAYEROVERLAYCLASS_H )
+#define PLAYEROVERLAYCLASS_H
+#ifdef _WIN32
+#pragma once
+#endif
+
+#include "vgui_basepanel.h"
+
+class BitmapImage;
+class KeyValues;
+class CHudPlayerOverlay;
+
+class CHudPlayerOverlayClass : public CBasePanel
+{
+public:
+ DECLARE_CLASS( CHudPlayerOverlayClass, CBasePanel );
+
+ CHudPlayerOverlayClass( CHudPlayerOverlay *baseOverlay );
+ virtual ~CHudPlayerOverlayClass( void );
+
+ bool Init( KeyValues* pKeyValues );
+
+ void SetColor( int r, int g, int b, int a );
+ void SetImage( BitmapImage *pImage );
+ void SetTeamAndClass( int team, int playerclass );
+
+ // Keeps the image size correct
+ virtual void SetSize( int w, int h );
+
+ virtual void Paint( void );
+
+ virtual void OnCursorEntered();
+ virtual void OnCursorExited();
+
+private:
+ class CMapClassColors
+ {
+ public:
+ CMapClassColors() : m_pClassImage(0) {}
+
+ BitmapImage *m_pClassImage;
+ Color m_clrClass;
+ };
+
+ // Initialize class info only once
+ static bool InitClassInfo( KeyValues* pKeyValues );
+ static bool ParseTeamClassInfo( KeyValues *pClassIcons, const char *classname, CMapClassColors *pClassColors );
+ static bool ParseTeamClassIcons( CMapClassColors *pT, KeyValues *pTeam );
+
+ static CMapClassColors** s_ppClassInfo;
+
+ int m_r, m_g, m_b, m_a;
+ BitmapImage *m_pImage;
+
+ Color m_fgColor;
+ Color m_bgColor;
+
+ CHudPlayerOverlay *m_pBaseOverlay;
+
+ friend class CCleanupPlayerOverlayClass;
+};
+
+#endif // PLAYEROVERLAYCLASS_H \ No newline at end of file