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.

106 lines
3.2 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef TEAMMENU_H
  8. #define TEAMMENU_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include <vgui_controls/Frame.h>
  13. #include <vgui_controls/Button.h>
  14. #include <game/client/iviewport.h>
  15. #include "GameEventListener.h"
  16. #include <vgui/KeyCode.h>
  17. #include <utlvector.h>
  18. namespace vgui
  19. {
  20. class RichText;
  21. class HTML;
  22. }
  23. class TeamFortressViewport;
  24. //-----------------------------------------------------------------------------
  25. // Purpose: Displays the team menu
  26. //-----------------------------------------------------------------------------
  27. //=============================================================================
  28. // HPE_BEGIN:
  29. // [Forrest] Added CGameEventListener for hooking cs_match_end_restart.
  30. //=============================================================================
  31. class CTeamMenu : public vgui::Frame, public IViewPortPanel, public CGameEventListener
  32. //=============================================================================
  33. // HPE_END
  34. //=============================================================================
  35. {
  36. private:
  37. DECLARE_CLASS_SIMPLE( CTeamMenu, vgui::Frame );
  38. public:
  39. CTeamMenu(IViewPort *pViewPort);
  40. virtual ~CTeamMenu();
  41. virtual const char *GetName( void ) { return PANEL_TEAM; }
  42. virtual void SetData(KeyValues *data) {};
  43. virtual void Reset() {};
  44. virtual void Update();
  45. virtual bool NeedsUpdate( void ) { return false; }
  46. virtual bool HasInputElements( void ) { return true; }
  47. virtual void ShowPanel( bool bShow );
  48. // both vgui::Frame and IViewPortPanel define these, so explicitly define them here as passthroughs to vgui
  49. vgui::VPANEL GetVPanel( void ) { return BaseClass::GetVPanel(); }
  50. virtual bool IsVisible() { return BaseClass::IsVisible(); }
  51. virtual void SetParent( vgui::VPANEL parent ) { BaseClass::SetParent( parent ); }
  52. //=============================================================================
  53. // HPE_BEGIN:
  54. // [Forrest] For hooking cs_match_end_restart.
  55. //=============================================================================
  56. // IGameEventListener interface:
  57. virtual void FireGameEvent( IGameEvent *event);
  58. //=============================================================================
  59. // HPE_END
  60. //=============================================================================
  61. virtual bool WantsBackgroundBlurred( void ) { return false; }
  62. public:
  63. void AutoAssign();
  64. protected:
  65. // int GetNumTeams() { return m_iNumTeams; }
  66. // VGUI2 overrides
  67. virtual void ApplySchemeSettings(vgui::IScheme *pScheme);
  68. virtual void OnKeyCodePressed(vgui::KeyCode code);
  69. // helper functions
  70. virtual void SetLabelText(const char *textEntryName, const char *text);
  71. virtual void LoadMapPage( const char *mapName );
  72. // virtual void MakeTeamButtons( void );
  73. // command callbacks
  74. // MESSAGE_FUNC_INT( OnTeamButton, "TeamButton", team );
  75. IViewPort *m_pViewPort;
  76. vgui::RichText *m_pMapInfo;
  77. vgui::HTML *m_pMapInfoHTML;
  78. // int m_iNumTeams;
  79. ButtonCode_t m_iJumpKey;
  80. ButtonCode_t m_iScoreBoardKey;
  81. char m_szMapName[ MAX_PATH ];
  82. };
  83. #endif // TEAMMENU_H