Counter Strike : Global Offensive Source Code
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.

80 lines
2.1 KiB

  1. //========= Copyright � 1996-2001, Valve LLC, All rights reserved. ============
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================
  7. #ifndef QUICKLISTPANEL
  8. #define QUICKLISTPANEL
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. //-----------------------------------------------------------------------------
  13. // Purpose: Spectator games list
  14. //-----------------------------------------------------------------------------
  15. class CQuickListPanel : public vgui::EditablePanel
  16. {
  17. DECLARE_CLASS_SIMPLE( CQuickListPanel, vgui::EditablePanel );
  18. public:
  19. CQuickListPanel( vgui::Panel *parent, const char *panelName );
  20. virtual void ApplySchemeSettings(vgui::IScheme *pScheme);
  21. void SetMapName( const char *pMapName );
  22. void SetImage( const char *pMapName );
  23. void SetGameType( const char *pGameType );
  24. const char *GetMapName( void ) { return m_szMapName; }
  25. void SetRefreshing( void );
  26. virtual void OnMousePressed( vgui::MouseCode code );
  27. virtual void OnMouseDoublePressed( vgui::MouseCode code );
  28. void SetServerInfo ( KeyValues *pKV, int iListID );
  29. int GetListID( void ) { return m_iListID; }
  30. MESSAGE_FUNC_INT( OnPanelSelected, "PanelSelected", state )
  31. {
  32. if ( state )
  33. {
  34. vgui::IScheme *pScheme = vgui::scheme()->GetIScheme( GetScheme() );
  35. if ( pScheme && m_pBGroundPanel )
  36. {
  37. m_pBGroundPanel->SetBgColor( pScheme->GetColor("QuickListBGSelected", Color(255, 255, 255, 0 ) ) );
  38. }
  39. }
  40. else
  41. {
  42. vgui::IScheme *pScheme = vgui::scheme()->GetIScheme( GetScheme() );
  43. if ( pScheme && m_pBGroundPanel )
  44. {
  45. m_pBGroundPanel->SetBgColor( pScheme->GetColor("QuickListBGDeselected", Color(255, 255, 255, 0 ) ) );
  46. }
  47. }
  48. PostMessage( GetParent()->GetVParent(), new KeyValues("PanelSelected") );
  49. }
  50. private:
  51. char m_szMapName[64];
  52. vgui::ImagePanel *m_pLatencyImage;
  53. vgui::Label *m_pLatencyLabel;
  54. vgui::Label *m_pPlayerCountLabel;
  55. vgui::Label *m_pServerNameLabel;
  56. vgui::Panel *m_pBGroundPanel;
  57. vgui::ImagePanel *m_pMapImage;
  58. vgui::Panel *m_pListPanelParent;
  59. vgui::Label *m_pGameTypeLabel;
  60. vgui::Label *m_pMapNameLabel;
  61. int m_iListID;
  62. };
  63. #endif // QUICKLISTPANEL