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.

61 lines
1.7 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================
  6. #ifndef NAVPROGRESS_H
  7. #define NAVPROGRESS_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include <vgui_controls/Frame.h>
  12. #include <vgui_controls/ProgressBar.h>
  13. #include <game/client/iviewport.h>
  14. class CNavProgress : public vgui::Frame, public IViewPortPanel
  15. {
  16. private:
  17. DECLARE_CLASS_SIMPLE( CNavProgress, vgui::Frame );
  18. public:
  19. CNavProgress(IViewPort *pViewPort);
  20. virtual ~CNavProgress();
  21. virtual const char *GetName( void ) { return PANEL_NAV_PROGRESS; }
  22. virtual void SetData(KeyValues *data);
  23. virtual void Reset();
  24. virtual void Update();
  25. virtual bool NeedsUpdate( void ) { return false; }
  26. virtual bool HasInputElements( void ) { return true; }
  27. virtual void ShowPanel( bool bShow );
  28. // both vgui::Frame and IViewPortPanel define these, so explicitly define them here as passthroughs to vgui
  29. vgui::VPANEL GetVPanel( void ) { return BaseClass::GetVPanel(); }
  30. virtual bool IsVisible() { return BaseClass::IsVisible(); }
  31. virtual void SetParent( vgui::VPANEL parent ) { BaseClass::SetParent( parent ); }
  32. virtual GameActionSet_t GetPreferredActionSet() { return GAME_ACTION_SET_NONE; }
  33. public:
  34. virtual void ApplySchemeSettings( vgui::IScheme *pScheme );
  35. virtual void PerformLayout();
  36. void Init( const char *title, int numTicks, int currentTick );
  37. protected:
  38. IViewPort *m_pViewPort;
  39. int m_numTicks;
  40. int m_currentTick;
  41. vgui::Label * m_pTitle;
  42. vgui::Label * m_pText;
  43. vgui::Panel * m_pProgressBarBorder;
  44. vgui::Panel * m_pProgressBar;
  45. vgui::Panel * m_pProgressBarSizer;
  46. };
  47. #endif // NAVPROGRESS_H