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.

94 lines
2.8 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef DOD_HUD_PLAYERSTATUS_MGHEAT_H
  8. #define DOD_HUD_PLAYERSTATUS_MGHEAT_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. //-----------------------------------------------------------------------------
  13. // Purpose: MGHeat progress bar
  14. //-----------------------------------------------------------------------------
  15. class CDoDHudMGHeatProgressBar : public vgui::Panel
  16. {
  17. DECLARE_CLASS_SIMPLE( CDoDHudMGHeatProgressBar, vgui::Panel );
  18. public:
  19. CDoDHudMGHeatProgressBar( vgui::Panel *parent, const char *name ) : vgui::Panel( parent, name ){}
  20. virtual void Paint();
  21. virtual void ApplySchemeSettings( vgui::IScheme *pScheme );
  22. void SetPercentage( float flPercentage ){ m_flPercentage = flPercentage; }
  23. private:
  24. float m_flPercentage;
  25. Color m_clrActive;
  26. Color m_clrActiveLow;
  27. Color m_clrInactive;
  28. Color m_clrInactiveLow;
  29. CPanelAnimationVarAliasType( float, m_flSliceWidth, "slice_width", "5", "proportional_float" );
  30. CPanelAnimationVarAliasType( float, m_flSliceSpacer, "slice_spacer", "2", "proportional_float" );
  31. CPanelAnimationVar( float, m_flWarningLevel, "warning_level", "0.75" );
  32. };
  33. //-----------------------------------------------------------------------------
  34. // Purpose: MGHeat icon
  35. //-----------------------------------------------------------------------------
  36. class CDoDHudMGHeatIcon : public vgui::ImagePanel
  37. {
  38. DECLARE_CLASS_SIMPLE( CDoDHudMGHeatIcon, vgui::ImagePanel );
  39. public:
  40. CDoDHudMGHeatIcon( vgui::Panel *parent, const char *name ) : vgui::ImagePanel( parent, name ){};
  41. void Init( void );
  42. virtual void Paint();
  43. virtual void ApplySettings( KeyValues *inResourceData );
  44. virtual void ApplySchemeSettings( vgui::IScheme *pScheme );
  45. void SetType( int nType );
  46. void SetPercentage( float flPercentage ){ m_flPercentage = flPercentage; }
  47. private:
  48. float m_flPercentage;
  49. CHudTexture *m_icon;
  50. CPanelAnimationVar( float, m_flWarningLevel, "warning_level", "0.75" );
  51. // char m_szIcon30cal[128];
  52. char m_szIconMg42[128];
  53. int m_nType;
  54. Color m_clrActive;
  55. Color m_clrActiveLow;
  56. };
  57. //-----------------------------------------------------------------------------
  58. // Purpose: MGHeat panel
  59. //-----------------------------------------------------------------------------
  60. class CDoDHudMGHeat : public vgui::EditablePanel
  61. {
  62. DECLARE_CLASS_SIMPLE( CDoDHudMGHeat, vgui::EditablePanel );
  63. public:
  64. CDoDHudMGHeat( vgui::Panel *parent, const char *name );
  65. virtual void ApplySchemeSettings( vgui::IScheme *pScheme );
  66. virtual void OnThink();
  67. virtual void SetVisible( bool state );
  68. private:
  69. CDoDCutEditablePanel *m_pBackground;
  70. CDoDHudMGHeatIcon *m_pIcon;
  71. CDoDHudMGHeatProgressBar *m_pProgressBar;
  72. };
  73. #endif // DOD_HUD_PLAYERSTATUS_MGHEAT_H