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.

61 lines
1.2 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #include "cbase.h"
  8. #include "tfcclassmenu.h"
  9. #include <KeyValues.h>
  10. #include <filesystem.h>
  11. #include <vgui_controls/Button.h>
  12. #include <vgui/IVGui.h>
  13. #include "hud.h" // for gEngfuncs
  14. #include "tfc_gamerules.h"
  15. #include "viewport_panel_names.h"
  16. #include "c_tfc_player.h"
  17. using namespace vgui;
  18. // ----------------------------------------------------------------------------- //
  19. // CTFCClassMenu
  20. // ----------------------------------------------------------------------------- //
  21. CTFCClassMenu::CTFCClassMenu(IViewPort *pViewPort) : CClassMenu(pViewPort)
  22. {
  23. }
  24. const char *CTFCClassMenu::GetName( void )
  25. {
  26. return PANEL_CLASS;
  27. }
  28. void CTFCClassMenu::ShowPanel(bool bShow)
  29. {
  30. if ( bShow)
  31. {
  32. engine->CheckPoint( "ClassMenu" );
  33. }
  34. BaseClass::ShowPanel( bShow );
  35. }
  36. void CTFCClassMenu::Update()
  37. {
  38. // Force them to pick a class if they haven't picked one yet.
  39. if ( C_TFCPlayer::GetLocalTFCPlayer()->m_Shared.GetPlayerClass() == PC_UNDEFINED )
  40. {
  41. SetVisibleButton( "CancelButton", false );
  42. }
  43. else
  44. {
  45. SetVisibleButton( "CancelButton", true );
  46. }
  47. }