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.

75 lines
2.6 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef MATCH_MAKING_PANEL_H
  8. #define MATCH_MAKING_PANEL_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "vgui_controls/EditablePanel.h"
  13. #include <game/client/iviewport.h>
  14. #include "quest_log_panel.h"
  15. using namespace vgui;
  16. class CBaseLobbyPanel;
  17. class CMatchMakingPanel *GetMatchMakingPanel();
  18. //-----------------------------------------------------------------------------
  19. // The default quest log panel
  20. //-----------------------------------------------------------------------------
  21. class CMatchMakingPanel : public EditablePanel, public IViewPortPanel, public CGameEventListener
  22. {
  23. DECLARE_CLASS_SIMPLE( CMatchMakingPanel, EditablePanel );
  24. public:
  25. CMatchMakingPanel( IViewPort *pViewPort );
  26. virtual ~CMatchMakingPanel();
  27. void AttachToGameUI();
  28. virtual const char *GetName( void ) OVERRIDE;
  29. virtual void SetData( KeyValues *data ) OVERRIDE {}
  30. virtual void Reset() OVERRIDE { Update(); SetVisible( true ); }
  31. virtual void Update() OVERRIDE { return; }
  32. virtual bool NeedsUpdate( void ) OVERRIDE { return false; }
  33. virtual bool HasInputElements( void ) OVERRIDE { return true; }
  34. virtual void ShowPanel( bool bShow ) OVERRIDE;
  35. // both vgui::Frame and IViewPortPanel define these, so explicitly define them here as passthroughs to vgui
  36. vgui::VPANEL GetVPanel( void ){ return BaseClass::GetVPanel(); }
  37. virtual bool IsVisible() OVERRIDE { return BaseClass::IsVisible(); }
  38. virtual void SetParent( vgui::VPANEL parent ) OVERRIDE { BaseClass::SetParent( parent ); }
  39. virtual GameActionSet_t GetPreferredActionSet() { return GAME_ACTION_SET_MENUCONTROLS; }
  40. virtual void ApplySchemeSettings( IScheme *pScheme ) OVERRIDE;
  41. virtual void PerformLayout() OVERRIDE;
  42. virtual void OnCommand( const char *pCommand ) OVERRIDE;
  43. virtual void FireGameEvent( IGameEvent *event ) OVERRIDE;
  44. virtual void SetVisible( bool bState ) OVERRIDE;
  45. virtual void OnKeyCodePressed( KeyCode code ) OVERRIDE;
  46. virtual void OnKeyCodeTyped(KeyCode code) OVERRIDE;
  47. virtual void OnThink() OVERRIDE;
  48. MESSAGE_FUNC_PARAMS( OnTextChanged, "TextChanged", data );
  49. private:
  50. void StartSearch( void );
  51. void StopSearch( void );
  52. ButtonCode_t m_iMMPanelKey;
  53. vgui::EditablePanel *m_pMainContainer;
  54. vgui::EditablePanel *m_pCompetitiveModeGroupPanel;
  55. vgui::Label *m_pModeLabel;
  56. vgui::ComboBox *m_pModeComboBox;
  57. vgui::Button *m_pStopSearchButton;
  58. vgui::Button *m_pSearchButton;
  59. vgui::EditablePanel *m_pSearchActiveGroupBox;
  60. vgui::Label *m_pSearchActiveTitleLabel;
  61. };
  62. #endif // MATCH_MAKING_PANEL_H