Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_EquipGadgetAction.c
Go to the documentation of this file.
1 //------------------------------------------------------------------------------------------------
4 {
5  #ifndef DISABLE_INVENTORY
6  //------------------------------------------------------------------------------------------------
7  override bool CanBePerformedScript(IEntity user)
8  {
9  SCR_InventoryStorageManagerComponent pInventoryManager = SCR_InventoryStorageManagerComponent.Cast( user.FindComponent( SCR_InventoryStorageManagerComponent ) );
10  if ( !pInventoryManager )
11  return false;
12 
13  SCR_EquipmentStorageComponent storageComp = SCR_EquipmentStorageComponent.Cast(pInventoryManager.FindStorageForItem(m_Item.GetOwner(), EStoragePurpose.PURPOSE_EQUIPMENT_ATTACHMENT));
14  if (!storageComp)
15  {
16  SetCannotPerformReason("#AR-Inventory_NoSlot");
17  return false;
18  }
19 
20  return true;
21  }
22 
23  //------------------------------------------------------------------------------------------------
24  override protected void PerformActionInternal(SCR_InventoryStorageManagerComponent manager, IEntity pOwnerEntity, IEntity pUserEntity)
25  {
26  if (CanBePerformedScript(pUserEntity))
27  manager.EquipGadget( pOwnerEntity );
28  }
29  #endif
30 };
pInventoryManager
protected SCR_InventoryStorageManagerComponent pInventoryManager
Definition: SCR_UniversalInventoryStorageComponent.c:25
SCR_InventoryAction
modded version for to be used with the inventory 2.0
Definition: SCR_InventoryAction.c:3
m_Item
NewsFeedItem m_Item
Definition: SCR_NewsSubMenu.c:2
SCR_EquipGadgetAction
modded version for to be used with the inventory 2.0
Definition: SCR_EquipGadgetAction.c:3
EStoragePurpose
EStoragePurpose
Definition: EStoragePurpose.c:12