summaryrefslogtreecommitdiff
path: root/serverbrowser/QuickListPanel.h
diff options
context:
space:
mode:
authorFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
committerFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
commit3bf9df6b2785fa6d951086978a3e66f49427166a (patch)
tree2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /serverbrowser/QuickListPanel.h
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'serverbrowser/QuickListPanel.h')
-rw-r--r--serverbrowser/QuickListPanel.h83
1 files changed, 83 insertions, 0 deletions
diff --git a/serverbrowser/QuickListPanel.h b/serverbrowser/QuickListPanel.h
new file mode 100644
index 0000000..5672b2b
--- /dev/null
+++ b/serverbrowser/QuickListPanel.h
@@ -0,0 +1,83 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+// $NoKeywords: $
+//=============================================================================
+
+#ifndef QUICKLISTPANEL
+#define QUICKLISTPANEL
+#ifdef _WIN32
+#pragma once
+#endif
+
+//-----------------------------------------------------------------------------
+// Purpose: Spectator games list
+//-----------------------------------------------------------------------------
+class CQuickListPanel : public vgui::EditablePanel
+{
+ DECLARE_CLASS_SIMPLE( CQuickListPanel, vgui::EditablePanel );
+
+public:
+ CQuickListPanel( vgui::Panel *parent, const char *panelName );
+
+ virtual void ApplySchemeSettings(vgui::IScheme *pScheme);
+ void SetMapName( const char *pMapName );
+ void SetImage( const char *pMapName );
+ void SetGameType( const char *pGameType );
+ const char *GetMapName( void ) { return m_szMapName; }
+ void SetRefreshing( void );
+
+ virtual void OnMousePressed( vgui::MouseCode code );
+ virtual void OnMouseDoublePressed( vgui::MouseCode code );
+ void SetServerInfo ( KeyValues *pKV, int iListID, int iTotalServers );
+ int GetListID( void ) { return m_iListID; }
+
+
+ MESSAGE_FUNC_INT( OnPanelSelected, "PanelSelected", state )
+ {
+ if ( state )
+ {
+ vgui::IScheme *pScheme = vgui::scheme()->GetIScheme( GetScheme() );
+
+ if ( pScheme && m_pBGroundPanel )
+ {
+ m_pBGroundPanel->SetBgColor( pScheme->GetColor("QuickListBGSelected", Color(255, 255, 255, 0 ) ) );
+ }
+ }
+ else
+ {
+ vgui::IScheme *pScheme = vgui::scheme()->GetIScheme( GetScheme() );
+
+ if ( pScheme && m_pBGroundPanel )
+ {
+ m_pBGroundPanel->SetBgColor( pScheme->GetColor("QuickListBGDeselected", Color(255, 255, 255, 0 ) ) );
+ }
+ }
+
+ PostMessage( GetParent()->GetVParent(), new KeyValues("PanelSelected") );
+ }
+
+private:
+
+ char m_szMapName[128];
+
+ vgui::ImagePanel *m_pLatencyImage;
+ vgui::Label *m_pLatencyLabel;
+ vgui::Label *m_pPlayerCountLabel;
+ vgui::Label *m_pOtherServersLabel;
+ vgui::Label *m_pServerNameLabel;
+ vgui::Panel *m_pBGroundPanel;
+ vgui::ImagePanel *m_pMapImage;
+
+ vgui::Panel *m_pListPanelParent;
+ vgui::Label *m_pGameTypeLabel;
+ vgui::Label *m_pMapNameLabel;
+
+ vgui::ImagePanel *m_pReplayImage;
+
+ int m_iListID;
+};
+
+
+#endif // QUICKLISTPANEL