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.

57 lines
2.2 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #if !defined( HUD_SUITPOWER_H )
  8. #define HUD_SUITPOWER_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "hudelement.h"
  13. #include "hud_numericdisplay.h"
  14. #include <vgui_controls/Panel.h>
  15. //-----------------------------------------------------------------------------
  16. // Purpose: Shows the sprint power bar
  17. //-----------------------------------------------------------------------------
  18. class CHudSuitPower : public CHudElement, public vgui::Panel
  19. {
  20. DECLARE_CLASS_SIMPLE( CHudSuitPower, vgui::Panel );
  21. public:
  22. CHudSuitPower( const char *pElementName );
  23. virtual void Init( void );
  24. virtual void Reset( void );
  25. virtual void OnThink( void );
  26. bool ShouldDraw( void );
  27. protected:
  28. virtual void Paint();
  29. private:
  30. CPanelAnimationVar( Color, m_AuxPowerColor, "AuxPowerColor", "255 0 0 255" );
  31. CPanelAnimationVar( int, m_iAuxPowerDisabledAlpha, "AuxPowerDisabledAlpha", "70" );
  32. CPanelAnimationVarAliasType( float, m_flBarInsetX, "BarInsetX", "8", "proportional_float" );
  33. CPanelAnimationVarAliasType( float, m_flBarInsetY, "BarInsetY", "8", "proportional_float" );
  34. CPanelAnimationVarAliasType( float, m_flBarWidth, "BarWidth", "80", "proportional_float" );
  35. CPanelAnimationVarAliasType( float, m_flBarHeight, "BarHeight", "10", "proportional_float" );
  36. CPanelAnimationVarAliasType( float, m_flBarChunkWidth, "BarChunkWidth", "10", "proportional_float" );
  37. CPanelAnimationVarAliasType( float, m_flBarChunkGap, "BarChunkGap", "2", "proportional_float" );
  38. CPanelAnimationVar( vgui::HFont, m_hTextFont, "TextFont", "Default" );
  39. CPanelAnimationVarAliasType( float, text_xpos, "text_xpos", "8", "proportional_float" );
  40. CPanelAnimationVarAliasType( float, text_ypos, "text_ypos", "20", "proportional_float" );
  41. CPanelAnimationVarAliasType( float, text2_xpos, "text2_xpos", "8", "proportional_float" );
  42. CPanelAnimationVarAliasType( float, text2_ypos, "text2_ypos", "40", "proportional_float" );
  43. CPanelAnimationVarAliasType( float, text2_gap, "text2_gap", "10", "proportional_float" );
  44. float m_flSuitPower;
  45. int m_nSuitPowerLow;
  46. int m_iActiveSuitDevices;
  47. };
  48. #endif // HUD_SUITPOWER_H