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.

114 lines
3.9 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: Serves as the base panel for the entire matchmaking UI
  4. //
  5. //=============================================================================//
  6. #ifndef MATCHMAKINGBASEPANEL_H
  7. #define MATCHMAKINGBASEPANEL_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "basedialog.h"
  12. #include "utlstack.h"
  13. #include "const.h"
  14. enum EGameType
  15. {
  16. GAMETYPE_RANKED_MATCH,
  17. GAMETYPE_STANDARD_MATCH,
  18. GAMETYPE_SYSTEMLINK_MATCH,
  19. };
  20. //----------------------------
  21. // CMatchmakingBasePanel
  22. //----------------------------
  23. class CMatchmakingBasePanel : public CBaseDialog
  24. {
  25. DECLARE_CLASS_SIMPLE( CMatchmakingBasePanel, CBaseDialog );
  26. public:
  27. CMatchmakingBasePanel(vgui::Panel *parent);
  28. ~CMatchmakingBasePanel();
  29. virtual void OnCommand( const char *pCommand );
  30. virtual void OnKeyCodePressed( vgui::KeyCode code );
  31. virtual void Activate();
  32. void SessionNotification( const int notification, const int param = 0 );
  33. void SystemNotification( const int notification );
  34. void UpdatePlayerInfo( uint64 nPlayerId, const char *pName, int nTeam, byte cVoiceState, int nPlayersNeeded, bool bHost );
  35. void SessionSearchResult( int searchIdx, void *pHostData, XSESSION_SEARCHRESULT *pResult, int ping );
  36. void OnLevelLoadingStarted();
  37. void OnLevelLoadingFinished();
  38. void CloseGameDialogs( bool bActivateNext = true );
  39. void CloseAllDialogs( bool bActivateNext = true );
  40. void CloseBaseDialogs( void );
  41. void SetFooterButtons( CBaseDialog *pOwner, KeyValues *pData, int nButtonGap = -1 );
  42. void ShowFooter( bool bShown );
  43. void SetFooterButtonVisible( const char *pszText, bool bVisible );
  44. uint GetGameType( void ) { return m_nGameType; }
  45. MESSAGE_FUNC_CHARPTR( LoadMap, "LoadMap", mapname );
  46. private:
  47. void OnOpenWelcomeDialog();
  48. void OnOpenPauseDialog();
  49. void OnOpenRankingsDialog();
  50. void OnOpenSystemLinkDialog();
  51. void OnOpenPlayerMatchDialog();
  52. void OnOpenRankedMatchDialog();
  53. void OnOpenAchievementsDialog();
  54. //=============================================================================
  55. // HPE_BEGIN:
  56. // [dwenger] Specific code for CS Achievements Display
  57. //=============================================================================
  58. // $TODO(HPE): Move this to a game-specific location
  59. void OnOpenCSAchievementsDialog();
  60. //=============================================================================
  61. // HPE_END
  62. //=============================================================================
  63. void OnOpenLeaderboardDialog( const char *pResourceName );
  64. void OnOpenSessionOptionsDialog( const char *pResourceName );
  65. void OnOpenSessionLobbyDialog( const char *pResourceName );
  66. void OnOpenSessionBrowserDialog( const char *pResourceName );
  67. void LoadSessionProperties();
  68. bool ValidateSigninAndStorage( bool bOnlineRequired, const char *pIssuingCommand );
  69. void CenterDialog( vgui::PHandle dlg );
  70. void PushDialog( vgui::DHANDLE< CBaseDialog > &hDialog );
  71. void PopDialog( bool bActivateNext = true );
  72. vgui::DHANDLE< CBaseDialog > m_hWelcomeDialog;
  73. vgui::DHANDLE< CBaseDialog > m_hPauseDialog;
  74. vgui::DHANDLE< CBaseDialog > m_hStatsDialog;
  75. vgui::DHANDLE< CBaseDialog > m_hRankingsDialog;
  76. vgui::DHANDLE< CBaseDialog > m_hLeaderboardDialog;
  77. vgui::DHANDLE< CBaseDialog > m_hSystemLinkDialog;
  78. vgui::DHANDLE< CBaseDialog > m_hPlayerMatchDialog;
  79. vgui::DHANDLE< CBaseDialog > m_hRankedMatchDialog;
  80. vgui::DHANDLE< CBaseDialog > m_hAchievementsDialog;
  81. vgui::DHANDLE< CBaseDialog > m_hSessionOptionsDialog;
  82. vgui::DHANDLE< CBaseDialog > m_hSessionLobbyDialog;
  83. vgui::DHANDLE< CBaseDialog > m_hSessionBrowserDialog;
  84. CUtlStack< vgui::DHANDLE< CBaseDialog > > m_DialogStack;
  85. uint m_nSessionType;
  86. uint m_nGameType;
  87. bool m_bPlayingOnline;
  88. char m_szMapLoadName[MAX_MAP_NAME];
  89. KeyValues *m_pSessionKeys;
  90. CFooterPanel *m_pFooter;
  91. };
  92. #endif // MATCHMAKINGBASEPANEL_H