Counter Strike : Global Offensive Source Code
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.

62 lines
2.2 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #ifndef HUD_BASETIMER_H
  7. #define HUD_BASETIMER_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "hud_numericdisplay.h"
  12. //-----------------------------------------------------------------------------
  13. // Purpose: Base class for all the hud elements that are just a numeric display
  14. // with some options for text and icons
  15. //-----------------------------------------------------------------------------
  16. class CHudBaseTimer : public CHudNumericDisplay
  17. {
  18. DECLARE_CLASS_SIMPLE( CHudBaseTimer, CHudNumericDisplay );
  19. public:
  20. CHudBaseTimer(vgui::Panel *parent, const char *name);
  21. void SetMinutes( int minutes );
  22. void SetSeconds( int seconds );
  23. protected:
  24. // vgui overrides
  25. virtual void Paint();
  26. void SetToPrimaryColor();
  27. void SetToSecondaryColor();
  28. private:
  29. void PaintTime(vgui::HFont font, int xpos, int ypos, int mins, int secs);
  30. int m_iMinutes;
  31. int m_iSeconds;
  32. wchar_t m_LabelText[32];
  33. CPanelAnimationVar( float, m_flBlur, "Blur", "0" );
  34. CPanelAnimationVar( float, m_flAlphaOverride, "Alpha", "255" );
  35. CPanelAnimationVar( Color, m_TextColor, "TextColor", "FgColor" );
  36. CPanelAnimationVar( Color, m_FlashColor, "SecondaryColor", "FgColor" );
  37. CPanelAnimationVar( vgui::HFont, m_hNumberFont, "NumberFont", "HudNumbers" );
  38. CPanelAnimationVar( vgui::HFont, m_hNumberGlowFont, "NumberGlowFont", "HudNumbersGlow" );
  39. CPanelAnimationVar( vgui::HFont, m_hSmallNumberFont, "SmallNumberFont", "HudNumbersSmall" );
  40. CPanelAnimationVar( vgui::HFont, m_hTextFont, "TextFont", "Default" );
  41. CPanelAnimationVarAliasType( float, text_xpos, "text_xpos", "8", "proportional_float" );
  42. CPanelAnimationVarAliasType( float, text_ypos, "text_ypos", "20", "proportional_float" );
  43. CPanelAnimationVarAliasType( float, digit_xpos, "digit_xpos", "50", "proportional_float" );
  44. CPanelAnimationVarAliasType( float, digit_ypos, "digit_ypos", "2", "proportional_float" );
  45. CPanelAnimationVarAliasType( float, digit2_xpos, "digit2_xpos", "98", "proportional_float" );
  46. CPanelAnimationVarAliasType( float, digit2_ypos, "digit2_ypos", "16", "proportional_float" );
  47. };
  48. #endif // HUD_BASETIMER_H