Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_InventorySlotWeaponUI.c
Go to the documentation of this file.
1 
2 
3 //------------------------------------------------------------------------------------------------
7 {
8 
9  protected SCR_UniversalInventoryStorageComponent m_pStorageComponent;
10 
11  //------------------------------------------------------------------------ USER METHODS ------------------------------------------------------------------------
12 
13  //------------------------------------------------------------------------------------------------
15  override UniversalInventoryStorageComponent GetStorageComponent() { return m_pStorageComponent; }
16 
17 
18  //------------------------------------------------------------------------------------------------
19  override bool RemoveItem()
20  {
21  //try to delete the UI slot
22  //if( !super.RemoveItem() )
23  // return false;
24  SCR_InventoryStorageManagerComponent invMan = GetInventoryManager();
25  EquipedWeaponStorageComponent weaponStorage = m_pStorageUI.GetWeaponStorage();
26  IEntity item = m_pItem.GetOwner();
27  if(!(invMan && invMan.CanMoveItem(item) && weaponStorage))
28  return false;
29  bool success = invMan.CanRemoveItemFromStorage(m_pItem.GetOwner(), weaponStorage);
30  if( !success )
31  return false;
32 
33  //TODO: return the check back once the true/false issue is solved
34  invMan.TryRemoveItemFromInventory(item, weaponStorage);
35 
36  //TODO: and refresh the container on the right side if its storage was removed
37  if( !m_pStorageUI )
38  return false;
39  m_pStorageUI.GetInventoryMenuHandler().ShowStorage(weaponStorage);
40 
41  // Sound
42  GenericEntity itemEntity = GenericEntity.Cast(item);
43  SoundComponent soundComponent = SoundComponent.Cast(itemEntity.FindComponent(SoundComponent));
44  if (soundComponent)
45  {
46  soundComponent.SoundEvent(SCR_SoundEvent.SOUND_DROP);
47  }
48 
49  return true;
50  }
51 
52  //------------------------------------------------------------------------------------------------
53 
54  //------------------------------------------------------------------------------------------------
55 
56  //------------------------------------------------------------------------ COMMON METHODS ----------------------------------------------------------------------
57 
58  //------------------------------------------------------------------------------------------------
59 
60  //------------------------------------------------------------------------------------------------
61 
62  //------------------------------------------------------------------------------------------------
63  void SCR_InventorySlotWeaponUI( InventoryItemComponent pComponent = null, SCR_InventoryStorageBaseUI pStorageUI = null, bool bVisible = true, int iSlotIndex = -1, SCR_ItemAttributeCollection pAttributes = null )
64  {
65  }
66 
67 
68  //------------------------------------------------------------------------------------------------
70  {
71  }
72 };
SCR_SoundEvent
Definition: SCR_SoundEvent.c:1
SCR_UniversalInventoryStorageComponent
void SCR_UniversalInventoryStorageComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
Definition: SCR_UniversalInventoryStorageComponent.c:259
SCR_InventorySlotWeaponUI
Definition: SCR_InventorySlotWeaponUI.c:6
GenericEntity
SCR_GenericBoxEntityClass GenericEntity
SCR_InventoryStorageBaseUI
Definition: SCR_InventoryStorageBaseUI.c:6
InventoryItemComponent
Definition: InventoryItemComponent.c:12
SCR_ItemAttributeCollection
Definition: SCR_ItemAttributeCollection.c:2
SCR_InventorySlotUI
Definition: SCR_InventorySlotUI.c:27