Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_InventorySlotWeaponUI.c
Go to the documentation of this file.
1
2
3//------------------------------------------------------------------------------------------------
7{
8
10
11 //------------------------------------------------------------------------ USER METHODS ------------------------------------------------------------------------
12
13 //------------------------------------------------------------------------------------------------
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 //------------------------------------------------------------------------------------------------
72};
void SCR_UniversalInventoryStorageComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
proto external Managed FindComponent(typename typeName)
void SCR_InventorySlotUI(InventoryItemComponent pComponent=null, SCR_InventoryStorageBaseUI pStorageUI=null, bool bVisible=true, int iSlotIndex=-1, SCR_ItemAttributeCollection pAttributes=null)
InventoryItemComponent m_pItem
SCR_InventoryStorageManagerComponent GetInventoryManager()
SCR_InventoryStorageBaseUI m_pStorageUI
override UniversalInventoryStorageComponent GetStorageComponent()
returns the storage component associated with this UI component
SCR_UniversalInventoryStorageComponent m_pStorageComponent
void SCR_InventorySlotWeaponUI(InventoryItemComponent pComponent=null, SCR_InventoryStorageBaseUI pStorageUI=null, bool bVisible=true, int iSlotIndex=-1, SCR_ItemAttributeCollection pAttributes=null)