Counter Strike : Global Offensive Source Code
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.

92 lines
2.7 KiB

  1. //====== Copyright � 1996-2005, Valve Corporation, All rights reserved. =======
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================
  6. #include "CustomTabExplanationDialog.h"
  7. #include "BasePanel.h"
  8. #include "convar.h"
  9. #include "EngineInterface.h"
  10. #include "GameUI_Interface.h"
  11. #include "vgui/ISurface.h"
  12. #include "vgui/IInput.h"
  13. #include "ModInfo.h"
  14. #include <stdio.h>
  15. using namespace vgui;
  16. // memdbgon must be the last include file in a .cpp file!!!
  17. #include "tier0/memdbgon.h"
  18. //-----------------------------------------------------------------------------
  19. // Purpose:
  20. //-----------------------------------------------------------------------------
  21. CCustomTabExplanationDialog::CCustomTabExplanationDialog(vgui::Panel *parent) : BaseClass(parent, "CustomTabExplanationDialog")
  22. {
  23. SetDeleteSelfOnClose(true);
  24. SetSizeable( false );
  25. input()->SetAppModalSurface(GetVPanel());
  26. LoadControlSettings("Resource/CustomTabExplanationDialog.res");
  27. MoveToCenterOfScreen();
  28. GameUI().PreventEngineHideGameUI();
  29. }
  30. //-----------------------------------------------------------------------------
  31. // Purpose:
  32. //-----------------------------------------------------------------------------
  33. CCustomTabExplanationDialog::~CCustomTabExplanationDialog()
  34. {
  35. }
  36. //-----------------------------------------------------------------------------
  37. // Purpose:
  38. //-----------------------------------------------------------------------------
  39. void CCustomTabExplanationDialog::ApplySchemeSettings( vgui::IScheme *pScheme )
  40. {
  41. BaseClass::ApplySchemeSettings( pScheme );
  42. SetDialogVariable( "game", ModInfo().GetGameName() );
  43. }
  44. //-----------------------------------------------------------------------------
  45. // Purpose:
  46. //-----------------------------------------------------------------------------
  47. void CCustomTabExplanationDialog::OnKeyCodePressed(KeyCode code)
  48. {
  49. if (code == KEY_ESCAPE)
  50. {
  51. Close();
  52. }
  53. else
  54. {
  55. BaseClass::OnKeyCodePressed(code);
  56. }
  57. }
  58. //-----------------------------------------------------------------------------
  59. // Purpose: handles button commands
  60. //-----------------------------------------------------------------------------
  61. void CCustomTabExplanationDialog::OnCommand( const char *command )
  62. {
  63. if ( !stricmp( command, "ok" ) || !stricmp( command, "cancel" ) || !stricmp( command, "close" ) )
  64. {
  65. Close();
  66. }
  67. else
  68. {
  69. BaseClass::OnCommand( command );
  70. }
  71. }
  72. //-----------------------------------------------------------------------------
  73. // Purpose:
  74. //-----------------------------------------------------------------------------
  75. void CCustomTabExplanationDialog::OnClose( void )
  76. {
  77. BaseClass::OnClose();
  78. }