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.

54 lines
1.7 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef ITEM_SLOT_PANEL_H
  8. #define ITEM_SLOT_PANEL_H
  9. #include "base_loadout_panel.h"
  10. class CItemCriteriaSelectionPanel;
  11. //-----------------------------------------------------------------------------
  12. // A loadout screen that handles modifying the loadout of a specific item
  13. //-----------------------------------------------------------------------------
  14. class CItemSlotPanel : public CBaseLoadoutPanel
  15. {
  16. DECLARE_CLASS_SIMPLE( CItemSlotPanel, CBaseLoadoutPanel );
  17. public:
  18. CItemSlotPanel( vgui::Panel *parent );
  19. ~CItemSlotPanel();
  20. virtual void ApplySchemeSettings( vgui::IScheme *pScheme );
  21. virtual void PerformLayout( void );
  22. virtual void AddNewItemPanel( int iPanelIndex ) OVERRIDE;
  23. virtual void UpdateModelPanels( void ) OVERRIDE;
  24. virtual int GetNumItemPanels( void ) OVERRIDE;
  25. virtual void OnShowPanel( bool bVisible, bool bReturningFromArmory ) OVERRIDE;
  26. MESSAGE_FUNC_PTR( OnItemPanelMouseReleased, "ItemPanelMouseReleased", panel );
  27. MESSAGE_FUNC_PARAMS( OnSelectionReturned, "SelectionReturned", data );
  28. MESSAGE_FUNC( OnCancelSelection, "CancelSelection" );
  29. virtual void OnCommand( const char *command );
  30. void SetItem( CEconItem* pItem );
  31. private:
  32. CEconItem *m_pItem;
  33. struct ItemSlot_t
  34. {
  35. CAttribute_ItemSlotCriteria m_slotCriteriaAttribute;
  36. itemid_t m_ulOriginalID;
  37. bool m_bHasSlot;
  38. };
  39. CUtlVector< ItemSlot_t > m_itemSlots;
  40. int m_iCurrentSlotIndex;
  41. CItemSelectionCriteria m_selectionCriteria;
  42. CItemCriteriaSelectionPanel *m_pSelectionPanel;
  43. };
  44. #endif // ITEM_SLOT_PANEL_H