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.

67 lines
1.9 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================
  7. #ifndef PLAYERPANEL_H
  8. #define PLAYERPANEL_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include <KeyValues.h>
  13. #include <vgui_controls/Frame.h>
  14. #include <vgui_controls/PHandle.h>
  15. #include <vgui_controls/ListPanel.h>
  16. #include <vgui_controls/PropertyPage.h>
  17. #include "PlayerContextMenu.h"
  18. #include "RemoteServer.h"
  19. //-----------------------------------------------------------------------------
  20. // Purpose: Dialog for displaying information about a game server
  21. //-----------------------------------------------------------------------------
  22. class CPlayerPanel : public vgui::PropertyPage, public IServerDataResponse
  23. {
  24. DECLARE_CLASS_SIMPLE( CPlayerPanel, vgui::PropertyPage );
  25. public:
  26. CPlayerPanel(vgui::Panel *parent, const char *name);
  27. ~CPlayerPanel();
  28. // returns the keyvalues for the currently selected row
  29. KeyValues *GetSelected();
  30. protected:
  31. // property page handlers
  32. virtual void OnResetData();
  33. virtual void OnThink();
  34. virtual void OnKeyCodeTyped(vgui::KeyCode code);
  35. // called when the server has returned a requested value
  36. virtual void OnServerDataResponse(const char *value, const char *response);
  37. private:
  38. // vgui overrides
  39. virtual void OnCommand(const char *command);
  40. // msg handlers
  41. MESSAGE_FUNC_INT( OnOpenContextMenu, "OpenContextMenu", itemID );
  42. MESSAGE_FUNC( OnItemSelected, "ItemSelected" );
  43. MESSAGE_FUNC( OnKickButtonPressed, "KickPlayer" );
  44. MESSAGE_FUNC( OnBanButtonPressed, "BanPlayer" );
  45. MESSAGE_FUNC( KickSelectedPlayers, "KickSelectedPlayers" );
  46. MESSAGE_FUNC_CHARPTR_CHARPTR( AddBanByID, "AddBanValue", id, time );
  47. vgui::ListPanel *m_pPlayerListPanel;
  48. vgui::Button *m_pKickButton;
  49. vgui::Button *m_pBanButton;
  50. CPlayerContextMenu *m_pPlayerContextMenu;
  51. float m_flUpdateTime;
  52. };
  53. #endif // PLAYERPANEL_H