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.

57 lines
1.5 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: Matchmaking's "main menu"
  4. //
  5. //=============================================================================//
  6. #include "welcomedialog.h"
  7. #include "GameUI_Interface.h"
  8. #include "vgui_controls/MessageDialog.h"
  9. #include "ixboxsystem.h"
  10. #include "EngineInterface.h"
  11. // memdbgon must be the last include file in a .cpp file!!!
  12. #include "tier0/memdbgon.h"
  13. //--------------------------------
  14. // CPlayerMatchDialog
  15. //--------------------------------
  16. CWelcomeDialog::CWelcomeDialog( vgui::Panel *pParent ) : BaseClass( pParent, "WelcomeDialog" )
  17. {
  18. // do nothing
  19. }
  20. //---------------------------------------------------------
  21. // Purpose: Set the title and menu positions
  22. //---------------------------------------------------------
  23. void CWelcomeDialog::PerformLayout( void )
  24. {
  25. BaseClass::PerformLayout();
  26. }
  27. //-----------------------------------------------------------------
  28. // Purpose: Forward commands to the matchmaking base panel
  29. //-----------------------------------------------------------------
  30. void CWelcomeDialog::OnCommand( const char *pCommand )
  31. {
  32. BaseClass::OnCommand( pCommand );
  33. }
  34. //-------------------------------------------------------
  35. // Keyboard input
  36. //-------------------------------------------------------
  37. void CWelcomeDialog::OnKeyCodePressed( vgui::KeyCode code )
  38. {
  39. switch( code )
  40. {
  41. case KEY_XBUTTON_B:
  42. if ( GameUI().IsInLevel() )
  43. {
  44. m_pParent->OnCommand( "ResumeGame" );
  45. }
  46. break;
  47. default:
  48. BaseClass::OnKeyCodePressed( code );
  49. break;
  50. }
  51. }