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.

111 lines
3.6 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #include "cbase.h"
  8. #include "cstrikebuyequipmenu.h"
  9. #include "cs_shareddefs.h"
  10. #include "cstrikebuysubmenu.h"
  11. #include "backgroundpanel.h"
  12. using namespace vgui;
  13. //-----------------------------------------------------------------------------
  14. // Purpose: Constructor for CT Equipment menu
  15. //-----------------------------------------------------------------------------
  16. CCSBuyEquipMenu_CT::CCSBuyEquipMenu_CT(IViewPort *pViewPort) : CBuyMenu( pViewPort )
  17. {
  18. SetTitle( "#Cstrike_Buy_Menu", true);
  19. SetProportional( true );
  20. m_pMainMenu = new CCSBuySubMenu( this, "BuySubMenu" );
  21. m_pMainMenu->LoadControlSettings( "Resource/UI/BuyEquipment_CT.res" );
  22. m_pMainMenu->SetVisible( false );
  23. m_iTeam = TEAM_CT;
  24. CreateBackground( this );
  25. m_backgroundLayoutFinished = false;
  26. }
  27. //-----------------------------------------------------------------------------
  28. // Purpose: Constructor for Terrorist Equipment menu
  29. //-----------------------------------------------------------------------------
  30. CCSBuyEquipMenu_TER::CCSBuyEquipMenu_TER(IViewPort *pViewPort) : CBuyMenu( pViewPort )
  31. {
  32. SetTitle( "#Cstrike_Buy_Menu", true);
  33. SetProportional( true );
  34. m_pMainMenu = new CCSBuySubMenu( this, "BuySubMenu" );
  35. m_pMainMenu->LoadControlSettings( "Resource/UI/BuyEquipment_TER.res" );
  36. m_pMainMenu->SetVisible( false );
  37. m_iTeam = TEAM_TERRORIST;
  38. CreateBackground( this );
  39. m_backgroundLayoutFinished = false;
  40. }
  41. //-----------------------------------------------------------------------------
  42. // Purpose: The CS background is painted by image panels, so we should do nothing
  43. //-----------------------------------------------------------------------------
  44. void CCSBuyEquipMenu_CT::PaintBackground()
  45. {
  46. }
  47. //-----------------------------------------------------------------------------
  48. // Purpose: Scale / center the window
  49. //-----------------------------------------------------------------------------
  50. void CCSBuyEquipMenu_CT::PerformLayout()
  51. {
  52. BaseClass::PerformLayout();
  53. // stretch the window to fullscreen
  54. if ( !m_backgroundLayoutFinished )
  55. LayoutBackgroundPanel( this );
  56. m_backgroundLayoutFinished = true;
  57. }
  58. //-----------------------------------------------------------------------------
  59. // Purpose:
  60. //-----------------------------------------------------------------------------
  61. void CCSBuyEquipMenu_CT::ApplySchemeSettings( vgui::IScheme *pScheme )
  62. {
  63. BaseClass::ApplySchemeSettings( pScheme );
  64. ApplyBackgroundSchemeSettings( this, pScheme );
  65. }
  66. //-----------------------------------------------------------------------------
  67. // Purpose: The CS background is painted by image panels, so we should do nothing
  68. //-----------------------------------------------------------------------------
  69. void CCSBuyEquipMenu_TER::PaintBackground()
  70. {
  71. }
  72. //-----------------------------------------------------------------------------
  73. // Purpose: Scale / center the window
  74. //-----------------------------------------------------------------------------
  75. void CCSBuyEquipMenu_TER::PerformLayout()
  76. {
  77. BaseClass::PerformLayout();
  78. // stretch the window to fullscreen
  79. if ( !m_backgroundLayoutFinished )
  80. LayoutBackgroundPanel( this );
  81. m_backgroundLayoutFinished = true;
  82. }
  83. //-----------------------------------------------------------------------------
  84. // Purpose:
  85. //-----------------------------------------------------------------------------
  86. void CCSBuyEquipMenu_TER::ApplySchemeSettings( vgui::IScheme *pScheme )
  87. {
  88. BaseClass::ApplySchemeSettings( pScheme );
  89. ApplyBackgroundSchemeSettings( this, pScheme );
  90. }