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.

58 lines
1.5 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef TF_PING_PANEL_H
  8. #define TF_PING_PANEL_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include <vgui_controls/EditablePanel.h>
  13. #include <../common/GameUI/cvarslider.h>
  14. using namespace vgui;
  15. class CTFPingPanel : public EditablePanel, public CGameEventListener
  16. {
  17. DECLARE_CLASS_SIMPLE( CTFPingPanel, EditablePanel )
  18. public:
  19. CTFPingPanel( Panel* pPanel, const char *pszName, EMatchGroup eMatchGroup );
  20. ~CTFPingPanel();
  21. virtual void ApplySchemeSettings( IScheme *pScheme ) OVERRIDE;
  22. virtual void PerformLayout() OVERRIDE;
  23. virtual void OnCommand( const char *command ) OVERRIDE;
  24. virtual void FireGameEvent( IGameEvent *event ) OVERRIDE;
  25. private:
  26. void CleanupPingPanels();
  27. void UpdateCurrentPing();
  28. MESSAGE_FUNC_PTR( OnCheckButtonChecked, "CheckButtonChecked", panel );
  29. MESSAGE_FUNC( OnSliderMoved, "SliderMoved" );
  30. CPanelAnimationVarAliasType( int, m_iDataCenterY, "datacenter_y", "0", "proportional_int" );
  31. CPanelAnimationVarAliasType( int, m_iDataCenterYSpace, "datacenter_y_space", "0", "proportional_int" );
  32. EditablePanel *m_pMainContainer;
  33. CheckButton *m_pCheckButton;
  34. Label *m_pCurrentPingLabel;
  35. CCvarSlider *m_pPingSlider;
  36. struct PingPanelInfo
  37. {
  38. EditablePanel *m_pPanel;
  39. float m_flPopulationRatio;
  40. int m_nPing;
  41. };
  42. CUtlVector< PingPanelInfo > m_vecDataCenterPingPanels;
  43. EMatchGroup m_eMatchGroup;
  44. };
  45. #endif // TF_PING_PANEL_H