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.

150 lines
5.2 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #ifndef TF_LOBBYPANEL_MVM_H
  7. #define TF_LOBBYPANEL_MVM_H
  8. #include "cbase.h"
  9. #include "game/client/iviewport.h"
  10. #include "vgui_bitmapimage.h"
  11. #include "tf_lobbypanel.h"
  12. // memdbgon must be the last include file in a .cpp file!!!
  13. #include <tier0/memdbgon.h>
  14. class CLobbyPanel_MvM : public CBaseLobbyPanel
  15. {
  16. DECLARE_CLASS_SIMPLE( CLobbyPanel_MvM, CBaseLobbyPanel );
  17. public:
  18. CLobbyPanel_MvM( vgui::Panel *pParent, CBaseLobbyContainerFrame* pLobbyContainer );
  19. virtual ~CLobbyPanel_MvM();
  20. //
  21. // Panel overrides
  22. //
  23. virtual void ApplySchemeSettings( vgui::IScheme *pScheme ) OVERRIDE;
  24. virtual void PerformLayout() OVERRIDE;
  25. //
  26. // CGameEventListener overrides
  27. //
  28. virtual void FireGameEvent( IGameEvent *event ) OVERRIDE;
  29. virtual void OnCommand( const char *command ) OVERRIDE;
  30. void SetMannUpTicketCount( int nCount );
  31. void SetSquadSurplusCount( int nCount );
  32. virtual EMatchGroup GetMatchGroup( void ) const OVERRIDE;
  33. void ToggleSquadSurplusCheckButton( void )
  34. {
  35. if ( !GTFGCClientSystem()->BLocalPlayerInventoryHasSquadSurplusVoucher() )
  36. return;
  37. m_pSquadSurplusCheckButton->SetSelected( !m_pSquadSurplusCheckButton->IsSelected() );
  38. }
  39. private:
  40. virtual const char* GetResFile() const OVERRIDE { return "Resource/UI/LobbyPanel_MvM.res"; } ;
  41. CPanelAnimationVarAliasType( int, m_iChallengeSpacer, "challenge_spacer", "4", "proportional_int" );
  42. CPanelAnimationVarAliasType( int, m_iChallengeNameWidth, "challenge_name_width", "190", "proportional_int" );
  43. CPanelAnimationVarAliasType( int, m_iChallengeSkillWidth, "challenge_skill_width", "110", "proportional_int" );
  44. CPanelAnimationVarAliasType( int, m_iChallengeCompletedSize, "challenge_completed_size", "15", "proportional_int" );
  45. CPanelAnimationVarAliasType( int, m_iMapImageWidth, "challenge_map_width", "60", "proportional_int" );
  46. CPanelAnimationVarAliasType( int, m_iMapImageHeight, "challenge_map_height", "40", "proportional_int" );
  47. CPanelAnimationVarAliasType( int, m_iHasTicketWidth, "has_ticket_width", "12", "proportional_int" );
  48. CPanelAnimationVarAliasType( int, m_iSquadSurplusWidth, "squad_surplus_width", "12", "proportional_int" );
  49. CPanelAnimationVarAliasType( int, m_iTourMapWidth, "squad_surplus_width", "20", "proportional_int" );
  50. CPanelAnimationVarAliasType( int, m_iBadgeLevelWidth, "badge_level_width", "20", "proportional_int" );
  51. CPanelAnimationVarAliasType( int, m_iTourNameWidth, "tour_name_width", "160", "proportional_int" );
  52. CPanelAnimationVarAliasType( int, m_iTourSkillWidth, "tour_skill_width", "90", "proportional_int" );
  53. CPanelAnimationVarAliasType( int, m_iTourProgressWidth, "tour_progress_width", "70", "proportional_int" );
  54. CPanelAnimationVarAliasType( int, m_iTourNumberWidth, "tour_number_width", "40", "proportional_int" );
  55. MESSAGE_FUNC_PTR( OnCheckButtonChecked, "CheckButtonChecked", panel );
  56. MESSAGE_FUNC_PTR( OnItemLeftClick, "ItemLeftClick", panel );
  57. virtual void ApplyChatUserSettings( const LobbyPlayerInfo& player, KeyValues* pSettings ) const OVERRIDE;
  58. #ifdef USE_MVM_TOUR
  59. void OnClickedOnTour();
  60. #endif // USE_MVM_TOUR
  61. void OnClickedOnChallenge();
  62. class ChallengeList : public vgui::SectionedListPanel
  63. {
  64. public:
  65. ChallengeList( CLobbyPanel_MvM *pLobbyPanel, vgui::Panel *parent, const char *name )
  66. : vgui::SectionedListPanel( parent, name )
  67. , m_pLobbyPanel( pLobbyPanel )
  68. {
  69. m_imageChallengeCompleted.SetImageFile( "vgui/pve/mvm_challenge_completed" );
  70. }
  71. virtual void OnMouseDoublePressed(vgui::MouseCode code) OVERRIDE { /* Just eat it */ }
  72. virtual void Paint() OVERRIDE;
  73. CLobbyPanel_MvM *m_pLobbyPanel;
  74. BitmapImage m_imageChallengeCompleted;
  75. CUtlVector<BitmapImage> m_vecMapImages;
  76. };
  77. CUtlVector<vgui::Label *> m_vecSearchCriteriaLabels;
  78. vgui::EditablePanel *m_pMvMMannVsMachineGroupPanel;
  79. vgui::EditablePanel *m_pMvMMannUpGroupPanel;
  80. vgui::EditablePanel *m_pMvMPracticeGroupPanel;
  81. vgui::EditablePanel *m_pMvMTourOfDutyGroupPanel;
  82. vgui::EditablePanel *m_pMvMTourOfDutyListGroupBox;
  83. vgui::SectionedListPanel *m_pTourList;
  84. vgui::EditablePanel *m_MvMEconItemsGroupBox;
  85. vgui::CheckButton *m_pSquadSurplusCheckButton;
  86. vgui::Button *m_pOpenStoreButton;
  87. vgui::Button *m_pOpenStoreButton2;
  88. vgui::Button *m_pOpenHelpButton;
  89. vgui::ImagePanel *m_pMannUpTicketImage;
  90. vgui::ImagePanel *m_pSquadSurplusImage;
  91. vgui::Button *m_pMannUpNowButton;
  92. vgui::EditablePanel *m_pMannUpTourLootDescriptionBox;
  93. vgui::ImagePanel *m_pMannUpTourLootImage;
  94. vgui::Label *m_pTourDifficultyWarning;
  95. //vgui::Label *m_pMannUpTourLootDetailLabel;
  96. vgui::EditablePanel *m_MvMPracticeGroupPanel;
  97. vgui::EditablePanel *m_pMvMSelectChallengeGroupPanel;
  98. vgui::EditablePanel *m_pMVMChallengeListGroupBox;
  99. ChallengeList *m_pChallengeList;
  100. vgui::HFont m_fontChallengeListHeader;
  101. vgui::HFont m_fontChallengeListItem;
  102. int m_iImageNoTicket;
  103. int m_iImageHasTicket;
  104. int m_iImageNoSquadSurplus;
  105. int m_iImageSquadSurplus;
  106. void WriteGameSettingsControls() OVERRIDE;
  107. virtual bool ShouldShowLateJoin() const OVERRIDE;
  108. #ifdef USE_MVM_TOUR
  109. void WriteTourList();
  110. #endif // USE_MVM_TOUR
  111. void WriteChallengeList();
  112. };
  113. #endif // TF_LOBBYPANEL_MVM_H