summaryrefslogtreecommitdiff
path: root/game/client/tf/vgui/tf_ping_panel.h
diff options
context:
space:
mode:
Diffstat (limited to 'game/client/tf/vgui/tf_ping_panel.h')
-rw-r--r--game/client/tf/vgui/tf_ping_panel.h58
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