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.

85 lines
2.2 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #ifndef SESSIONLOBBYDIALOG_H
  7. #define SESSIONLOBBYDIALOG_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "basedialog.h"
  12. //-----------------------------------------------------------------------------
  13. // Purpose: Simple menu to choose a matchmaking session type
  14. //-----------------------------------------------------------------------------
  15. class CSessionLobbyDialog : public CBaseDialog
  16. {
  17. DECLARE_CLASS_SIMPLE( CSessionLobbyDialog, CBaseDialog );
  18. public:
  19. CSessionLobbyDialog( vgui::Panel *parent );
  20. ~CSessionLobbyDialog();
  21. virtual void OnCommand( const char *pCommand );
  22. virtual void OnKeyCodePressed( vgui::KeyCode code );
  23. virtual void PerformLayout();
  24. virtual void ApplySettings( KeyValues *inResourceData );
  25. virtual void ApplySchemeSettings( vgui::IScheme *pScheme );
  26. void SetDialogKeys( KeyValues *pKeys );
  27. void UpdatePlayerInfo( uint64 nPlayerId, const char *pName, int nTeam, byte cVoiceState, int nPlayersNeeded, bool bHost );
  28. void UpdateCountdown( int seconds );
  29. private:
  30. void ActivateNextMenu();
  31. void ActivatePreviousMenu();
  32. void UpdatePlayerCountDisplay( int iTeam );
  33. void SetLobbyReadyState( int nPlayersNeeded );
  34. void PositionTeamInfos();
  35. void SetTextFromKeyvalues( CPropertyLabel *pLabel );
  36. void SetStartGame( bool bStartGame );
  37. enum
  38. {
  39. BLUE_TEAM_LOBBY,
  40. RED_TEAM_LOBBY,
  41. TOTAL_LOBBY_TEAMS,
  42. };
  43. CDialogMenu m_Menus[TOTAL_LOBBY_TEAMS];
  44. vgui::Panel *m_pLobbyStateBg;
  45. CPropertyLabel *m_pLobbyStateLabel;
  46. CPropertyLabel *m_pLobbyStateIcon;
  47. CPropertyLabel *m_pHostLabel;
  48. vgui::EditablePanel *m_pHostOptionsPanel;
  49. KeyValues *m_pDialogKeys;
  50. CScenarioInfoPanel *m_pScenarioInfo;
  51. CScenarioInfoPanel *m_pTeamInfos[TOTAL_LOBBY_TEAMS];
  52. int m_nMinInfoHeight[TOTAL_LOBBY_TEAMS];
  53. uint64 m_nHostId;
  54. bool m_bReady;
  55. bool m_bHostLobby;
  56. bool m_bCenterOnScreen;
  57. int m_iLocalTeam;
  58. int m_iActiveMenu;
  59. int m_nImageBorderWidth;
  60. int m_nTeamspacing;
  61. char m_szCommand[MAX_COMMAND_LEN];
  62. bool m_bStartingGame;
  63. int m_nLastPlayersNeeded;
  64. };
  65. #endif // SESSIONLOBBYDIALOG_H