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.

90 lines
2.6 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef DOD_HUD_CAPTUREPANEL_H
  8. #define DOD_HUD_CAPTUREPANEL_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. //-----------------------------------------------------------------------------
  13. // Purpose: Draws the progress bar
  14. //-----------------------------------------------------------------------------
  15. class CDoDCapturePanelProgressBar : public vgui::ImagePanel
  16. {
  17. public:
  18. DECLARE_CLASS_SIMPLE( CDoDCapturePanelProgressBar, vgui::ImagePanel );
  19. CDoDCapturePanelProgressBar( vgui::Panel *parent, const char *name );
  20. virtual void Paint();
  21. void SetPercentage( float flPercentage ){ m_flPercent = flPercentage; }
  22. private:
  23. float m_flPercent;
  24. int m_iTexture;
  25. CPanelAnimationVar( Color, m_clrActive, "color_active", "HudCaptureProgressBar.Active" );
  26. CPanelAnimationVar( Color, m_clrInActive, "color_inactive", "HudCaptureProgressBar.InActive" );
  27. };
  28. //-----------------------------------------------------------------------------
  29. // Purpose:
  30. //-----------------------------------------------------------------------------
  31. class CDoDCapturePanelIcon : public vgui::ImagePanel
  32. {
  33. public:
  34. DECLARE_CLASS_SIMPLE( CDoDCapturePanelIcon, vgui::ImagePanel );
  35. CDoDCapturePanelIcon( vgui::Panel *parent, const char *name );
  36. virtual void Paint();
  37. void SetActive( bool state ){ m_bActive = state; }
  38. private:
  39. bool m_bActive;
  40. int m_iTexture;
  41. CPanelAnimationVar( Color, m_clrActive, "color_active", "HudCaptureIcon.Active" );
  42. CPanelAnimationVar( Color, m_clrInActive, "color_inactive", "HudCaptureIcon.InActive" );
  43. };
  44. //-----------------------------------------------------------------------------
  45. //
  46. //-----------------------------------------------------------------------------
  47. class CDoDHudCapturePanel : public CHudElement, public vgui::EditablePanel
  48. {
  49. public:
  50. DECLARE_CLASS_SIMPLE( CDoDHudCapturePanel, vgui::EditablePanel );
  51. CDoDHudCapturePanel( const char *pElementName );
  52. virtual void OnThink();
  53. virtual void ApplySchemeSettings( vgui::IScheme *pScheme );
  54. virtual void OnScreenSizeChanged( int iOldWide, int iOldTall );
  55. private:
  56. CDoDCapturePanelProgressBar *m_pProgressBar;
  57. CUtlVector<CDoDCapturePanelIcon *> m_PlayerIcons;
  58. vgui::ImagePanel *m_pAlliesFlag;
  59. vgui::ImagePanel *m_pAxisFlag;
  60. vgui::ImagePanel *m_pNeutralFlag;
  61. vgui::Label *m_pMessage;
  62. vgui::Panel *m_pBackground;
  63. CPanelAnimationVarAliasType( float, m_nSpaceBetweenIcons, "icon_space", "2", "proportional_float" );
  64. };
  65. #endif // DOD_HUD_CAPTUREPANEL_H