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.

88 lines
2.3 KiB

  1. //========= Copyright 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 <vgui/KeyCode.h>
  16. #include <utlvector.h>
  17. namespace vgui
  18. {
  19. class RichText;
  20. class HTML;
  21. }
  22. class TeamFortressViewport;
  23. //-----------------------------------------------------------------------------
  24. // Purpose: Displays the team menu
  25. //-----------------------------------------------------------------------------
  26. class CTeamMenu : public vgui::Frame, public IViewPortPanel
  27. {
  28. private:
  29. DECLARE_CLASS_SIMPLE( CTeamMenu, vgui::Frame );
  30. public:
  31. CTeamMenu(IViewPort *pViewPort);
  32. virtual ~CTeamMenu();
  33. virtual const char *GetName( void ) { return PANEL_TEAM; }
  34. virtual void SetData(KeyValues *data) {};
  35. virtual void Reset() {};
  36. virtual void Update();
  37. virtual bool NeedsUpdate( void ) { return false; }
  38. virtual bool HasInputElements( void ) { return true; }
  39. virtual void ShowPanel( bool bShow );
  40. // both vgui::Frame and IViewPortPanel define these, so explicitly define them here as passthroughs to vgui
  41. vgui::VPANEL GetVPanel( void ) { return BaseClass::GetVPanel(); }
  42. virtual bool IsVisible() { return BaseClass::IsVisible(); }
  43. virtual void SetParent( vgui::VPANEL parent ) { BaseClass::SetParent( parent ); }
  44. virtual GameActionSet_t GetPreferredActionSet() { return GAME_ACTION_SET_IN_GAME_HUD; }
  45. public:
  46. void AutoAssign();
  47. protected:
  48. // int GetNumTeams() { return m_iNumTeams; }
  49. // VGUI2 overrides
  50. virtual void ApplySchemeSettings(vgui::IScheme *pScheme);
  51. virtual void OnKeyCodePressed(vgui::KeyCode code);
  52. // helper functions
  53. virtual void SetLabelText(const char *textEntryName, const char *text);
  54. virtual void LoadMapPage( const char *mapName );
  55. // virtual void MakeTeamButtons( void );
  56. // command callbacks
  57. // MESSAGE_FUNC_INT( OnTeamButton, "TeamButton", team );
  58. IViewPort *m_pViewPort;
  59. vgui::RichText *m_pMapInfo;
  60. vgui::HTML *m_pMapInfoHTML;
  61. // int m_iNumTeams;
  62. ButtonCode_t m_iJumpKey;
  63. ButtonCode_t m_iScoreBoardKey;
  64. char m_szMapName[ MAX_PATH ];
  65. };
  66. #endif // TEAMMENU_H