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.

102 lines
2.4 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================
  7. #include "cbase.h"
  8. #ifdef SERVER_USES_VGUI
  9. #include "vgui_gamedll_int.h"
  10. #include "ienginevgui.h"
  11. #include <vgui/ISurface.h>
  12. #include <vgui/IVGui.h>
  13. #include <vgui/IInput.h>
  14. #include "tier0/vprof.h"
  15. #include <vgui_controls/Panel.h>
  16. #include <keyvalues.h>
  17. using namespace vgui;
  18. #include <vgui_controls/Controls.h>
  19. // memdbgon must be the last include file in a .cpp file!!!
  20. #include "tier0/memdbgon.h"
  21. //-----------------------------------------------------------------------------
  22. // Purpose:
  23. //-----------------------------------------------------------------------------
  24. void VGUI_CreateGameDLLRootPanel( void )
  25. {
  26. // Just using PANEL_ROOT in HL2 right now
  27. }
  28. //-----------------------------------------------------------------------------
  29. // Purpose:
  30. //-----------------------------------------------------------------------------
  31. void VGUI_DestroyGameDLLRootPanel( void )
  32. {
  33. }
  34. //-----------------------------------------------------------------------------
  35. // Purpose: Game specific root panel
  36. // Output : vgui::Panel
  37. //-----------------------------------------------------------------------------
  38. vgui::VPANEL VGui_GetGameDLLRootPanel( void )
  39. {
  40. vgui::VPANEL root = enginevgui->GetPanel( PANEL_GAMEDLL );
  41. return root;
  42. }
  43. bool VGui_Startup( CreateInterfaceFn appSystemFactory )
  44. {
  45. if ( !vgui::VGui_InitInterfacesList( "GAMEDLL", &appSystemFactory, 1 ) )
  46. return false;
  47. return true;
  48. }
  49. bool VGui_PostInit()
  50. {
  51. // Create any root panels for .dll
  52. VGUI_CreateGameDLLRootPanel();
  53. // Make sure we have a panel
  54. VPANEL root = VGui_GetGameDLLRootPanel();
  55. if ( !root )
  56. {
  57. return false;
  58. }
  59. return true;
  60. }
  61. //-----------------------------------------------------------------------------
  62. // Purpose:
  63. //-----------------------------------------------------------------------------
  64. void VGui_CreateGlobalPanels( void )
  65. {
  66. }
  67. void ShowGameDLLPanel( vgui::Panel *panel )
  68. {
  69. panel->SetParent( VGui_GetGameDLLRootPanel() );
  70. panel->SetVisible( true );
  71. panel->SetEnabled( true );
  72. panel->MoveToFront();
  73. panel->InvalidateLayout();
  74. }
  75. void VGui_Shutdown( void )
  76. {
  77. VGUI_DestroyGameDLLRootPanel();
  78. // Make sure anything "marked for deletion"
  79. // actually gets deleted before this dll goes away
  80. vgui::ivgui()->RunFrame();
  81. }
  82. #endif // SERVER_USES_VGUI