Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_CampaignArmoryStorageComponent.c
Go to the documentation of this file.
1 class SCR_CampaignArmoryStorageComponentClass : UniversalInventoryStorageComponentClass
2 {
3 }
4 
5 class SCR_CampaignArmoryStorageComponent : UniversalInventoryStorageComponent
6 {
7  [Attribute("0", UIWidgets.Flags, "", enums: ParamEnumArray.FromEnum(SCR_EArsenalItemType))]
8  protected SCR_EArsenalItemType m_eSupportedItemTypes;
9 
10  [Attribute("0", UIWidgets.ComboBox, "", enums: ParamEnumArray.FromEnum(SCR_EArsenalItemMode))]
12 
13  protected bool m_bCanStoreItems = false;
14 
15  //------------------------------------------------------------------------------------------------
17  void AllowStoringItems(bool enable)
18  {
19  m_bCanStoreItems = enable;
20  }
21 
22  //------------------------------------------------------------------------------------------------
25  {
26  return m_eSupportedItemTypes;
27  }
28 
29  //------------------------------------------------------------------------------------------------
32  {
34  }
35 
36  //------------------------------------------------------------------------------------------------
37  protected override bool CanStoreItem(IEntity item, int slotID)
38  {
39  if (!super.CanStoreItem(item, slotID))
40  return false;
41 
42  if (!m_bCanStoreItems)
43  return false;
44 
45  InventoryItemComponent inventoryComponent = InventoryItemComponent.Cast(item.FindComponent(InventoryItemComponent));
46  if (inventoryComponent)
47  {
48 
49  if (inventoryComponent.GetParentSlot())
50  return false;
51  else
52  return true;
53  }
54 
55  return false;
56  }
57 }
GetSupportedItems
SCR_EArsenalItemType GetSupportedItems()
Definition: SCR_CampaignArmoryStorageComponent.c:24
CanStoreItem
protected override bool CanStoreItem(IEntity item, int slotID)
Definition: SCR_CampaignArmoryStorageComponent.c:37
SCR_EArsenalItemMode
SCR_EArsenalItemMode
Definition: SCR_EArsenalItemMode.c:1
SCR_EArsenalItemType
SCR_EArsenalItemType
Definition: SCR_EArsenalItemType.c:2
InventoryItemComponent
Definition: InventoryItemComponent.c:12
m_bCanStoreItems
protected bool m_bCanStoreItems
Definition: SCR_CampaignArmoryStorageComponent.c:13
SCR_CampaignArmoryStorageComponentClass
Definition: SCR_CampaignArmoryStorageComponent.c:1
Attribute
SCR_CampaignArmoryStorageComponentClass UniversalInventoryStorageComponentClass Attribute("0", UIWidgets.Flags, "", enums:ParamEnumArray.FromEnum(SCR_EArsenalItemType))] protected SCR_EArsenalItemType m_eSupportedItemTypes
m_eArsenalAmmunitionMode
protected SCR_EArsenalItemMode m_eArsenalAmmunitionMode
Definition: SCR_CampaignArmoryStorageComponent.c:11
AllowStoringItems
void AllowStoringItems(bool enable)
Definition: SCR_CampaignArmoryStorageComponent.c:17
GetAmmunitionMode
SCR_EArsenalItemMode GetAmmunitionMode()
Definition: SCR_CampaignArmoryStorageComponent.c:31