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.

87 lines
2.3 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #ifndef TF_LOBBY_CONTAINER_FRAME_H
  7. #define TF_LOBBY_CONTAINER_FRAME_H
  8. #include "cbase.h"
  9. #include "vgui_controls/PropertyDialog.h"
  10. #include "GameEventListener.h"
  11. // memdbgon must be the last include file in a .cpp file!!!
  12. #include <tier0/memdbgon.h>
  13. bool BIsPartyLeader();
  14. bool BIsPartyInUIState();
  15. CSteamID SteamIDFromDecimalString( const char *pszUint64InDecimal );
  16. class CBaseLobbyPanel;
  17. // This is a big fat kludge so I can use the PropertyPage
  18. class CBaseLobbyContainerFrame : public vgui::PropertyDialog, public CGameEventListener
  19. {
  20. DECLARE_CLASS_SIMPLE( CBaseLobbyContainerFrame, PropertyDialog );
  21. public:
  22. CBaseLobbyContainerFrame( const char *pszPanelName );
  23. virtual ~CBaseLobbyContainerFrame();
  24. //
  25. // PropertyDialog overrides
  26. //
  27. virtual void ApplySchemeSettings( vgui::IScheme *pScheme ) OVERRIDE;
  28. virtual void PerformLayout( void ) OVERRIDE;
  29. virtual void OnKeyCodeTyped(vgui::KeyCode code) OVERRIDE;
  30. virtual void OnKeyCodePressed(vgui::KeyCode code) OVERRIDE;
  31. virtual void OnCommand( const char *command ) OVERRIDE;
  32. //
  33. // CGameEventListener overrides
  34. //
  35. virtual void FireGameEvent( IGameEvent *event ) OVERRIDE;
  36. void StartSearch( void );
  37. virtual void ShowPanel(bool bShow);
  38. void SetNextButtonEnabled( bool bValue );
  39. virtual void OnThink() OVERRIDE;
  40. static void LeaveLobbyPanel( bool bConfirmed, void *pContext )
  41. {
  42. CBaseLobbyContainerFrame* pCaller = (CBaseLobbyContainerFrame*)pContext;
  43. if ( bConfirmed && pCaller )
  44. {
  45. pCaller->OnCommand( "back" );
  46. }
  47. }
  48. MESSAGE_FUNC( OpenPingOptions, "Context_Ping" );
  49. protected:
  50. bool ShouldShowPartyButton() const;
  51. virtual void WriteControls();
  52. virtual void HandleBackPressed();
  53. void OpenOptionsContextMenu();
  54. CBaseLobbyPanel *m_pContents;
  55. vgui::Button *m_pNextButton;
  56. vgui::Button *m_pBackButton;
  57. private:
  58. virtual const char* GetResFile() const = 0;
  59. virtual TF_MatchmakingMode GetHandledMode() const = 0;
  60. virtual bool VerifyPartyAuthorization() const = 0;
  61. vgui::Button *m_pStartPartyButton;
  62. vgui::Menu *m_pContextMenu;
  63. bool m_bNextButtonEnabled;
  64. vgui::DHANDLE< vgui::Panel > m_hPingPanel;
  65. };
  66. #endif //TF_LOBBY_CONTAINER_FRAME_H