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.

68 lines
1.9 KiB

  1. //====== Copyright � 1996-2003, Valve Corporation, All rights reserved. =======
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================
  6. #ifndef CUSTOMGAMES_H
  7. #define CUSTOMGAMES_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #define MAX_TAG_CHARACTERS 128
  12. class TagInfoLabel : public vgui::URLLabel
  13. {
  14. DECLARE_CLASS_SIMPLE( TagInfoLabel, vgui::URLLabel );
  15. public:
  16. TagInfoLabel(Panel *parent, const char *panelName);
  17. TagInfoLabel(Panel *parent, const char *panelName, const char *text, const char *pszURL);
  18. virtual void OnMousePressed(vgui::MouseCode code);
  19. MESSAGE_FUNC( DoOpenCustomServerInfoURL, "DoOpenCustomServerInfoURL" );
  20. };
  21. class TagMenuButton : public vgui::MenuButton
  22. {
  23. DECLARE_CLASS_SIMPLE( TagMenuButton, vgui::MenuButton );
  24. public:
  25. TagMenuButton( Panel *parent, const char *panelName, const char *text);
  26. virtual void OnShowMenu(vgui::Menu *menu);
  27. };
  28. //-----------------------------------------------------------------------------
  29. // Purpose: Internet games with tags
  30. //-----------------------------------------------------------------------------
  31. class CCustomGames : public CInternetGames
  32. {
  33. DECLARE_CLASS_SIMPLE( CCustomGames, CInternetGames );
  34. public:
  35. CCustomGames(vgui::Panel *parent);
  36. ~CCustomGames();
  37. virtual void UpdateDerivedLayouts( void );
  38. virtual void OnLoadFilter(KeyValues *filter);
  39. virtual void OnSaveFilter(KeyValues *filter);
  40. bool CheckTagFilter( gameserveritem_t &server );
  41. virtual void SetRefreshing(bool state);
  42. virtual void ServerResponded( int iServer, gameserveritem_t *pServerItem );
  43. MESSAGE_FUNC_PARAMS( OnAddTag, "AddTag", params );
  44. MESSAGE_FUNC( OnTagMenuButtonOpened, "TagMenuButtonOpened" );
  45. void RecalculateCommonTags( void );
  46. void AddTagToFilterList( const char *pszTag );
  47. private:
  48. TagInfoLabel *m_pTagInfoURL;
  49. TagMenuButton *m_pAddTagList;
  50. vgui::Menu *m_pTagListMenu;
  51. vgui::TextEntry *m_pTagFilter;
  52. char m_szTagFilter[MAX_TAG_CHARACTERS];
  53. };
  54. #endif // CUSTOMGAMES_H