Team Fortress 2 Source Code as on 22/4/2020
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.

92 lines
2.2 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================
  7. #ifndef BASEGAMESPAGE_H
  8. #define BASEGAMESPAGE_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include <VGUI_Frame.h>
  13. #include "ServerList.h"
  14. #include "IServerRefreshResponse.h"
  15. #include "server.h"
  16. #include "IGameList.h"
  17. namespace vgui
  18. {
  19. class ListPanel;
  20. class ImagePanel;
  21. class ComboBox;
  22. class ToggleButton;
  23. class CheckButton;
  24. class TextEntry;
  25. class MenuButton;
  26. class Menu;
  27. };
  28. //-----------------------------------------------------------------------------
  29. // Purpose: Base property page for all the games lists (internet/favorites/lan/etc.)
  30. //-----------------------------------------------------------------------------
  31. class CBaseGamesPage : public vgui2::Frame, public IServerRefreshResponse, public IGameList
  32. {
  33. public:
  34. CBaseGamesPage(vgui::Panel *parent, const char *name);
  35. ~CBaseGamesPage();
  36. virtual void PerformLayout();
  37. virtual void ApplySchemeSettings(vgui::IScheme *pScheme);
  38. // gets information about specified server
  39. virtual serveritem_t &GetServer(unsigned int serverID);
  40. virtual void SetRefreshing(bool state);
  41. protected:
  42. virtual void OnTick();
  43. virtual void OnCommand(const char *command);
  44. // virtual void OnOnMouseDoublePressed(enum vgui::MouseCode code);
  45. // an inner class
  46. class OurListPanel: public vgui::ListPanel
  47. {
  48. public:
  49. OurListPanel(vgui::Panel *parent, const char *panelName): vgui::ListPanel(parent,panelName) { m_pParent=parent;};
  50. virtual void OnMouseDoublePressed( vgui::MouseCode code );
  51. private:
  52. vgui::Panel *m_pParent;
  53. };
  54. // a list panel we grab the double click event from :)
  55. OurListPanel *m_pGameList;
  56. CServerList m_Servers;
  57. vgui::ImagePanel *m_pPasswordIcon; // password icon
  58. private:
  59. void OnButtonToggled(vgui::Panel *panel, int state);
  60. void OnTextChanged(vgui::Panel *panel, const char *text);
  61. void OnManage();
  62. // command buttons
  63. vgui::Button *m_pConnect;
  64. vgui::Button *m_pRefresh;
  65. vgui::Button *m_pManage;
  66. vgui::Button *m_pAddIP;
  67. vgui::Panel *m_pParent;
  68. // vgui::Menu *m_pRefreshMenu;
  69. typedef vgui::Frame BaseClass;
  70. DECLARE_PANELMAP();
  71. };
  72. #endif // BASEGAMESPAGE_H