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.

46 lines
1.0 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: Multiplayer pause menu
  4. //
  5. //=============================================================================//
  6. #include "pausedialog.h"
  7. #include "GameUI_Interface.h"
  8. // memdbgon must be the last include file in a .cpp file!!!
  9. #include "tier0/memdbgon.h"
  10. //--------------------------------
  11. // CPauseDialog
  12. //--------------------------------
  13. CPauseDialog::CPauseDialog( vgui::Panel *pParent ) : BaseClass( pParent, "PauseDialog" )
  14. {
  15. // do nothing
  16. }
  17. void CPauseDialog::Activate( void )
  18. {
  19. BaseClass::Activate();
  20. SetDeleteSelfOnClose( false );
  21. m_Menu.SetFocus( 0 );
  22. }
  23. //-------------------------------------------------------
  24. // Keyboard input
  25. //-------------------------------------------------------
  26. void CPauseDialog::OnKeyCodePressed( vgui::KeyCode code )
  27. {
  28. switch( code )
  29. {
  30. case KEY_XBUTTON_B:
  31. if ( GameUI().IsInLevel() )
  32. {
  33. m_pParent->OnCommand( "ResumeGame" );
  34. }
  35. break;
  36. default:
  37. BaseClass::OnKeyCodePressed( code );
  38. break;
  39. }
  40. }