diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /game/client/tf/vgui/tf_ping_panel.h | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'game/client/tf/vgui/tf_ping_panel.h')
| -rw-r--r-- | game/client/tf/vgui/tf_ping_panel.h | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/game/client/tf/vgui/tf_ping_panel.h b/game/client/tf/vgui/tf_ping_panel.h new file mode 100644 index 0000000..e9e6102 --- /dev/null +++ b/game/client/tf/vgui/tf_ping_panel.h @@ -0,0 +1,58 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +// $NoKeywords: $ +//=============================================================================// + +#ifndef TF_PING_PANEL_H +#define TF_PING_PANEL_H +#ifdef _WIN32 +#pragma once +#endif + +#include <vgui_controls/EditablePanel.h> +#include <../common/GameUI/cvarslider.h> + +using namespace vgui; + +class CTFPingPanel : public EditablePanel, public CGameEventListener +{ + DECLARE_CLASS_SIMPLE( CTFPingPanel, EditablePanel ) +public: + CTFPingPanel( Panel* pPanel, const char *pszName, EMatchGroup eMatchGroup ); + ~CTFPingPanel(); + + virtual void ApplySchemeSettings( IScheme *pScheme ) OVERRIDE; + virtual void PerformLayout() OVERRIDE; + virtual void OnCommand( const char *command ) OVERRIDE; + + virtual void FireGameEvent( IGameEvent *event ) OVERRIDE; + +private: + void CleanupPingPanels(); + void UpdateCurrentPing(); + + MESSAGE_FUNC_PTR( OnCheckButtonChecked, "CheckButtonChecked", panel ); + MESSAGE_FUNC( OnSliderMoved, "SliderMoved" ); + + CPanelAnimationVarAliasType( int, m_iDataCenterY, "datacenter_y", "0", "proportional_int" ); + CPanelAnimationVarAliasType( int, m_iDataCenterYSpace, "datacenter_y_space", "0", "proportional_int" ); + + EditablePanel *m_pMainContainer; + CheckButton *m_pCheckButton; + Label *m_pCurrentPingLabel; + CCvarSlider *m_pPingSlider; + + struct PingPanelInfo + { + EditablePanel *m_pPanel; + float m_flPopulationRatio; + int m_nPing; + }; + CUtlVector< PingPanelInfo > m_vecDataCenterPingPanels; + + EMatchGroup m_eMatchGroup; +}; + +#endif // TF_PING_PANEL_H |