Team Fortress 2 Source Code as on 22/4/2020
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.

71 lines
1.6 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $Workfile: $
  6. // $Date: $
  7. // $NoKeywords: $
  8. //=============================================================================//
  9. #if !defined( PLAYEROVERLAYCLASS_H )
  10. #define PLAYEROVERLAYCLASS_H
  11. #ifdef _WIN32
  12. #pragma once
  13. #endif
  14. #include "vgui_basepanel.h"
  15. class BitmapImage;
  16. class KeyValues;
  17. class CHudPlayerOverlay;
  18. class CHudPlayerOverlayClass : public CBasePanel
  19. {
  20. public:
  21. DECLARE_CLASS( CHudPlayerOverlayClass, CBasePanel );
  22. CHudPlayerOverlayClass( CHudPlayerOverlay *baseOverlay );
  23. virtual ~CHudPlayerOverlayClass( void );
  24. bool Init( KeyValues* pKeyValues );
  25. void SetColor( int r, int g, int b, int a );
  26. void SetImage( BitmapImage *pImage );
  27. void SetTeamAndClass( int team, int playerclass );
  28. // Keeps the image size correct
  29. virtual void SetSize( int w, int h );
  30. virtual void Paint( void );
  31. virtual void OnCursorEntered();
  32. virtual void OnCursorExited();
  33. private:
  34. class CMapClassColors
  35. {
  36. public:
  37. CMapClassColors() : m_pClassImage(0) {}
  38. BitmapImage *m_pClassImage;
  39. Color m_clrClass;
  40. };
  41. // Initialize class info only once
  42. static bool InitClassInfo( KeyValues* pKeyValues );
  43. static bool ParseTeamClassInfo( KeyValues *pClassIcons, const char *classname, CMapClassColors *pClassColors );
  44. static bool ParseTeamClassIcons( CMapClassColors *pT, KeyValues *pTeam );
  45. static CMapClassColors** s_ppClassInfo;
  46. int m_r, m_g, m_b, m_a;
  47. BitmapImage *m_pImage;
  48. Color m_fgColor;
  49. Color m_bgColor;
  50. CHudPlayerOverlay *m_pBaseOverlay;
  51. friend class CCleanupPlayerOverlayClass;
  52. };
  53. #endif // PLAYEROVERLAYCLASS_H