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.

101 lines
2.9 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #include "cbase.h"
  8. #include "c_csrootpanel.h"
  9. #include <vgui_controls/Controls.h>
  10. #include <vgui/IVGui.h>
  11. #include "clientmode_csnormal.h"
  12. // NOTE: This has to be the last file included!
  13. #include "tier0/memdbgon.h"
  14. //-----------------------------------------------------------------------------
  15. // Purpose:
  16. // Input : *parent -
  17. //-----------------------------------------------------------------------------
  18. C_CSRootPanel::C_CSRootPanel( vgui::VPANEL parent, int slot, const char *panelName /*= "CounterStrike Root Panel"*/ )
  19. : BaseClass( NULL, panelName ), m_nSplitSlot( slot )
  20. {
  21. SetParent( parent );
  22. SetPaintEnabled( false );
  23. SetPaintBorderEnabled( false );
  24. SetPaintBackgroundEnabled( false );
  25. // This panel does post child painting
  26. SetPostChildPaintEnabled( true );
  27. int w, h;
  28. surface()->GetScreenSize( w, h );
  29. // Make it screen sized
  30. SetBounds( 0, 0, w, h );
  31. SetZPos( 0 );
  32. // Ask for OnTick messages
  33. vgui::ivgui()->AddTickSignal( GetVPanel() );
  34. }
  35. //-----------------------------------------------------------------------------
  36. // Purpose:
  37. //-----------------------------------------------------------------------------
  38. C_CSRootPanel::~C_CSRootPanel( void )
  39. {
  40. }
  41. //-----------------------------------------------------------------------------
  42. // Purpose:
  43. //-----------------------------------------------------------------------------
  44. void C_CSRootPanel::PostChildPaint()
  45. {
  46. BaseClass::PostChildPaint();
  47. // Draw all panel effects
  48. RenderPanelEffects();
  49. }
  50. //-----------------------------------------------------------------------------
  51. // Purpose: For each panel effect, check if it wants to draw and draw it on
  52. // this panel/surface if so
  53. //-----------------------------------------------------------------------------
  54. void C_CSRootPanel::RenderPanelEffects( void )
  55. {
  56. }
  57. //-----------------------------------------------------------------------------
  58. // Purpose:
  59. //-----------------------------------------------------------------------------
  60. void C_CSRootPanel::OnTick( void )
  61. {
  62. }
  63. //-----------------------------------------------------------------------------
  64. // Purpose: Reset effects on level load/shutdown
  65. //-----------------------------------------------------------------------------
  66. void C_CSRootPanel::LevelInit( void )
  67. {
  68. }
  69. //-----------------------------------------------------------------------------
  70. // Purpose:
  71. //-----------------------------------------------------------------------------
  72. void C_CSRootPanel::LevelShutdown( void )
  73. {
  74. }
  75. void C_CSRootPanel::PaintTraverse( bool Repaint, bool allowForce /*= true*/ )
  76. {
  77. ACTIVE_SPLITSCREEN_PLAYER_GUARD_VGUI( m_nSplitSlot);
  78. BaseClass::PaintTraverse( Repaint, allowForce );
  79. }
  80. void C_CSRootPanel::OnThink()
  81. {
  82. ACTIVE_SPLITSCREEN_PLAYER_GUARD_VGUI( m_nSplitSlot );
  83. BaseClass::OnThink();
  84. }