Arma Reforger Script API
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
SCR_InventoryStorageManagerComponent Interface Reference
Inheritance diagram for SCR_InventoryStorageManagerComponent:
[legend]

Public Member Functions

int GetAllRootItems (out notnull array< IEntity > rootItems)
 Get an array of all root items in the inventory storage.
 
void PlayItemSound (IEntity entity, string soundEvent)
 
void RpcAsk_PlaySound (RplId targetRplId, string soundAction)
 
void RpcDo_PlaySound (RplId targetRplId, string soundAction)
 
SCR_CharacterInventoryStorageComponent GetCharacterStorage ()
 
bool CanInsertItemInActualStorage (IEntity item, BaseInventoryStorageComponent storage, int slotID=-1)
 
BaseInventoryStorageComponent FindActualStorageForItemResource (ResourceName itemResource, BaseInventoryStorageComponent storage, int slotID=-1, int count=1)
 
void SetReturnCode (EInventoryRetCode ERetCode)
 
void SetReturnCodeDefault ()
 
EInventoryRetCode GetReturnCode ()
 
float GetTotalWeightOfAllStorages ()
 
void SetLootStorage (IEntity pOwner)
 
void InsertItem (IEntity pItem, BaseInventoryStorageComponent pStorageTo=null, BaseInventoryStorageComponent pStorageFrom=null, SCR_InvCallBack cb=null)
 Try to insert the item into the storage (not slot)
 
bool TryRemoveItemFromInventory (IEntity pItem, BaseInventoryStorageComponent storage=null, InventoryOperationCallback cb=null)
 Locks the inventory for the duration of the item removal process.
 
bool CanMoveItem (IEntity item)
 Checks whether it is possible to move the item.
 
bool TrySwapItems (IEntity pOwnerEntity, BaseInventoryStorageComponent pStorageTo, SCR_InvCallBack cb=null)
 
void EquipWeapon (IEntity pOwnerEntity, SCR_InvCallBack cb=null, bool bFromVicinity=true)
 Try to equip the item into the slot (weapon)
 
void EquipWeaponAttachment (IEntity pOwnerEntity, IEntity pUserEntity, SCR_InvCallBack cb=null)
 Try to equip the item into the slot (weapon)
 
void EquipGadget (IEntity pOwnerEntity, SCR_InvCallBack cb=null)
 Try to equip the item into the slot (gadget)
 
void EquipCloth (IEntity pOwnerEntity)
 Try to equip the item into the slot (cloth)
 
bool EquipAny (BaseInventoryStorageComponent storage, IEntity item, int preferred=-1, SCR_InvCallBack cb=null)
 Try to equip the item into the storage at provided slot.
 
bool TryReplaceAndDropItemAtSlot (BaseInventoryStorageComponent storage, IEntity item, int slotID, SCR_InvCallBack cb=null, bool isTakenFromArsenal=false, bool deleteOriginalItemIfEmpty=false)
 Try to drop the original item and replace it by itemToReplace at the slot specified by slotID.
 
bool TryReplaceItem (BaseInventoryStorageComponent storage, IEntity item, int preferred, SCR_InvCallBack cb)
 Try to replace at preferred slot.
 
void EquipItem (EquipedWeaponStorageComponent weaponStorage, IEntity weapon)
 Try to equip the item into the slot (weapon)
 
bool IsResupplyMagazinesAvailable (int resupplyMagazineCount=4, out EResupplyUnavailableReason resupplyUnavailableReason=EResupplyUnavailableReason.NONE, EMuzzleType muzzleType=-1, InventoryStorageManagerComponent mustBeInStorage=null)
 Get if resupply magazines action is available with the given magazine count.
 
void GetValidResupplyItemsAndCount (out notnull map< ResourceName, int > validResupplyItems, int maxMagazineCount=4, EMuzzleType muzzleType=-1, InventoryStorageManagerComponent mustBeInStorage=null)
 Get map of all items (ResourceName) and count to add to inventory on resupply.
 
void ResupplyMagazines (notnull map< ResourceName, int > validResupplyItems)
 Resupply all weapons in map with the given number of magazines.
 
void ResupplyMagazines (int maxMagazineCount=4, EMuzzleType muzzleType=-1, InventoryStorageManagerComponent mustBeInStorage=null)
 Resupply all weapons so they have given number of magazines.
 
void EndResupplyMagazines ()
 
EResupplyUnavailableReason CanResupplyMuzzle (IEntity user, notnull BaseMuzzleComponent muzzle, int maxMagazineCount=-1, InventoryStorageManagerComponent mustBeInStorage=null, out int currentMagazineAmount=-1)
 
EResupplyUnavailableReason CanResupplyItem (IEntity user, ResourceName itemToResupply, int maxItemCount=-1, InventoryStorageManagerComponent mustBeInStorage=null, out int currentItemAmount=-1)
 
void MoveItemToVicinity (IEntity pItem, BaseInventoryStorageComponent pStorageTo=null)
 try to move item from owner's storage to vicinity.
 
void OpenInventory ()
 
void CloseInventory ()
 
IEntity GetStorageToOpen ()
 
void SetStorageToOpen (IEntity storage)
 
void Action_OpenInventory ()
 
void OnInventoryMenuClosed ()
 
override void OnStorageAdded (BaseInventoryStorageComponent storage)
 Will be called when new storage is registered at manager.
 
void DebugListAllItemsInInventory ()
 
void AskServerToDeleteEntity (IEntity ent)
 
void EnablePostFrame (bool enable)
 Enable/disable post frame event.
 
int GetHealthComponentCount ()
 
IEntity GetBandageItem ()
 
void ~SCR_InventoryStorageManagerComponent ()
 
bool IsAnimationReady ()
 
bool IsInventoryLocked ()
 
void SetInventoryLocked (bool isLocked)
 
int GetAllItems (inout array< IEntity > items, BaseInventoryStorageComponent storage)
 
void GetWeaponPrefabsOfType (notnull array< IEntity > weapons, EWeaponType weaponType, notnull out array< EntityPrefabData > prefabs)
 Get available prefabs of weapons of specified types.
 
IEntity FindNextWeaponOfType (EWeaponType weaponType, IEntity currentItem=null, bool allowCurrentPrefab=false)
 Find next weapon of specified types, excluding currentItem, but including it in sorting.
 
void SCR_InventoryStorageManagerComponent (IEntityComponentSource src, IEntity ent, IEntity parent)
 
- Public Member Functions inherited from InventoryStorageManagerComponent
proto external IEntity GetOwner ()
 
proto external void AddStorage (BaseInventoryStorageComponent storage)
 
proto external bool CanInsertItem (IEntity item, EStoragePurpose purpose=EStoragePurpose.PURPOSE_ANY)
 Will iterate over storages and find if item can be inserted in first best match.
 
proto external bool CanInsertItemInStorage (IEntity item, BaseInventoryStorageComponent storage, int slotID=-1)
 
proto external bool CanInsertResource (ResourceName resourceName, EStoragePurpose purpose=EStoragePurpose.PURPOSE_ANY, int count=1)
 Will iterate over storages and find if item can be inserted in first best match.
 
proto external bool CanInsertResourceInStorage (ResourceName resourceName, BaseInventoryStorageComponent storage, int slotID=-1, int count=1)
 
proto external bool TryInsertItem (IEntity item, EStoragePurpose purpose=EStoragePurpose.PURPOSE_ANY, InventoryOperationCallback cb=null)
 Will iterate over storages and try insert the item at first best match.
 
proto external bool TryInsertItemInStorage (IEntity item, BaseInventoryStorageComponent storage, int slotID=-1, InventoryOperationCallback cb=null)
 Will try to insert item at storage. If slotID -1 will try to insert in any free storage.
 
proto external bool CanReplaceItem (IEntity item, BaseInventoryStorageComponent storage, int slotID)
 Same as insert, only should allow replacing item at storage slot, slotID is required.
 
proto external bool TryReplaceItem (IEntity item, BaseInventoryStorageComponent storage, int slotID, InventoryOperationCallback cb=null)
 
proto external bool CanRemoveItemFromStorage (IEntity item, BaseInventoryStorageComponent storage)
 
proto external bool TryRemoveItemFromStorage (IEntity item, BaseInventoryStorageComponent storage, InventoryOperationCallback cb=null)
 Will try to remove item from storage.
 
proto external bool CanMoveItemToStorage (IEntity item, BaseInventoryStorageComponent to, int slotID=-1)
 
proto external bool TryMoveItemToStorage (IEntity item, BaseInventoryStorageComponent to, int slotID=-1, InventoryOperationCallback cb=null)
 Will try to move item from source storage to target storage.
 
proto external bool CanSwapItemStorages (IEntity itemA, IEntity itemB)
 
proto external bool TrySwapItemStorages (IEntity itemA, IEntity itemB, InventoryOperationCallback cb=null)
 Will try to place itemA to itemB storage slot and itemB to itemA storage slot.
 
proto external bool TryDeleteItem (IEntity item, InventoryOperationCallback cb=null)
 
proto external bool TrySpawnPrefabToStorage (ResourceName prefab, BaseInventoryStorageComponent storage=null, int slotID=-1, EStoragePurpose purpose=EStoragePurpose.PURPOSE_ANY, InventoryOperationCallback cb=null, int count=1)
 Spawn and insert into inventory if provided storage is null then most suitable storage would be chosen from owned storages.
 
proto external bool ValidateStorageRequest (IEntity storageOwner)
 Validate that the storage is near the player to eliminate potentual message tampering.
 
proto external int GetStorages (out notnull array< BaseInventoryStorageComponent > outStorages, EStoragePurpose purpose=EStoragePurpose.PURPOSE_ANY)
 Get all managed storages.
 
proto external int GetItems (out notnull array< IEntity > outItems)
 Get all items from all managed storages.
 
proto external bool Contains (IEntity item)
 Returns true if item is in the storage, false otherwise.
 
proto external BaseInventoryStorageComponent FindStorageForItem (IEntity item, EStoragePurpose purpose=EStoragePurpose.PURPOSE_ANY)
 Will try to find suitable storage for item.
 
proto external BaseInventoryStorageComponent FindStorageForResource (ResourceName resourceName, EStoragePurpose purpose=EStoragePurpose.PURPOSE_ANY)
 Will try to find suitable storage for resource.
 
proto external BaseInventoryStorageComponent FindStorageForInsert (IEntity item, BaseInventoryStorageComponent fromStorage, EStoragePurpose purpose=EStoragePurpose.PURPOSE_ANY)
 returns first storage with empty space from provided storage hierarchy for provided item and provided storage purpose
 
proto external BaseInventoryStorageComponent FindStorageForResourceInsert (ResourceName resourceName, BaseInventoryStorageComponent fromStorage, EStoragePurpose purpose=EStoragePurpose.PURPOSE_ANY)
 returns first storage with empty space from provided storage hierarchy for provided resource and provided storage purpose
 
proto external int GetDepositItemCountByEntity (IEntity verifier, IEntity entity)
 Fast access to item count in inventory (returns only items that are stored in DEPOSIT storages)
 
proto external int GetDepositItemCountByResource (IEntity verifier, ResourceName resourceName)
 Fast access to item count in inventory (returns only items that are stored in DEPOSIT storages)
 
proto external IEntity FindItem (InventorySearchPredicate predicate, EStoragePurpose purpose=EStoragePurpose.PURPOSE_DEPOSIT)
 Find Item by providing InventorySearchPredicate object.
 
proto external int FindItems (out notnull array< IEntity > foundItems, InventorySearchPredicate predicate, EStoragePurpose purpose=EStoragePurpose.PURPOSE_DEPOSIT)
 
proto external IEntity FindItemWithComponents (array< TypeName > componentsQuery, EStoragePurpose purpose=EStoragePurpose.PURPOSE_DEPOSIT)
 Find Item by specifying necessary component types (eg returns first Entity that contains all of the provided components) IEntity FindGrenadeInDeposit() { array<typename> components = {}; components.Insert(WeaponComponent); components.Insert(GrenadeMoveComponent); IEntity grenade = inventoryStorageManagerComponent.FindItemWithComponents(components, EStoragePurpose.PURPOSE_DEPOSIT); Print(grenade); return grenade; }.
 
proto external int FindItemsWithComponents (out notnull array< IEntity > foundItems, array< TypeName > componentsQuery, EStoragePurpose purpose=EStoragePurpose.PURPOSE_DEPOSIT)
 Find Items by specifying necessary component types (eg all Entities that contain all of the provided components), returns count of found items.
 
proto external int CountItem (InventorySearchPredicate predicate, EStoragePurpose purpose=EStoragePurpose.PURPOSE_DEPOSIT)
 
proto external int GetMagazineCountByWeapon (BaseWeaponComponent weapon)
 Find Items by specifying necessary component types (eg all Entities that contain all of the provided components), returns count of found items.
 
proto external int GetMagazineCountByMuzzle (IEntity verifier, BaseMuzzleComponent pMuzzle)
 Find Items by specifying necessary component types (eg all Entities that contain all of the provided components), returns count of found items.
 
proto external int GetGrenadesCount ()
 
void OnDelete (IEntity owner)
 
- Public Member Functions inherited from GameComponent
bool OnTicksOnRemoteProxy ()
 

Public Attributes

ref ScriptInvokerBool m_OnInventoryOpenInvoker = new ScriptInvokerBool()
 
ref ScriptInvokerBool m_OnQuickBarOpenInvoker = new ScriptInvokerBool()
 
- Public Attributes inherited from ScriptedInventoryStorageManagerComponent
ref ScriptInvokerBase< ScriptInvokerEntityAndStorageMethod > m_OnItemAddedInvoker = new ScriptInvokerBase<ScriptInvokerEntityAndStorageMethod>()
 
ref ScriptInvokerBase< ScriptInvokerEntityAndStorageMethod > m_OnItemRemovedInvoker = new ScriptInvokerBase<ScriptInvokerEntityAndStorageMethod>()
 

Protected Member Functions

override void OnItemAdded (BaseInventoryStorageComponent storageOwner, IEntity item)
 Callback when item is added (will be performed locally after server completed the Insert/Move operation)
 
override void OnItemRemoved (BaseInventoryStorageComponent storageOwner, IEntity item)
 Callback when item is removed (will be performed locally after server completed the Remove/Move operation)
 
override bool ShouldForbidRemoveByInstigator (InventoryStorageManagerComponent instigatorManager, BaseInventoryStorageComponent fromStorage, IEntity item)
 Virtual method that allows verification of item removal as a result of move operation on inventory level.
 
void RpcAsk_ServerToDeleteEntity (RplId targetRplId)
 
override void OnItemAdded (BaseInventoryStorageComponent storageOwner, IEntity item)
 Callback when item is added (will be performed locally after server completed the Insert/Move operation)
 
override void OnItemRemoved (BaseInventoryStorageComponent storageOwner, IEntity item)
 Callback when item is removed (will be performed locally after server completed the Remove/Move operation)
 
- Protected Member Functions inherited from InventoryStorageManagerComponent
void OnItemAdded (BaseInventoryStorageComponent storageOwner, IEntity item)
 Callback when item is added (will be performed locally after server completed the Insert/Move operation)
 
void OnItemRemoved (BaseInventoryStorageComponent storageOwner, IEntity item)
 Callback when item is removed (will be performed locally after server completed the Remove/Move operation)
 
void OnStorageAdded (BaseInventoryStorageComponent storage)
 Will be called when new storage is registered at manager.
 
void OnStorageRemoved (BaseInventoryStorageComponent storage)
 Will be called when storage is unregistered from manager.
 
void FillInitialStorages (out array< BaseInventoryStorageComponent > storagesToAdd)
 Override this method and fill in storagesToAdd array if you have some storages you'd like to register to manager as owned at initialization time.
 
void FillInitialPrefabsToStore (out array< ResourceName > prefabsToSpawn)
 Override this method and fill in prefabsToSpawn array if you have some items you'd like to store in inventory at initialization time.
 
bool ShouldForbidRemoveByInstigator (InventoryStorageManagerComponent instigatorManager, BaseInventoryStorageComponent fromStorage, IEntity item)
 Virtual method that allows verification of item removal as a result of move operation on inventory level.
 

Protected Attributes

EInventoryRetCode m_ERetCode
 
int m_iHealthEquipment = 0
 
bool m_bIsInventoryLocked = false
 
ref SCR_WeaponSwitchingBaseUI m_pWeaponSwitchingUI
 
ref SCR_ResupplyMagazinesCallback m_ResupplyMagazineCallback
 

Constructor & Destructor Documentation

◆ ~SCR_InventoryStorageManagerComponent()

void SCR_InventoryStorageManagerComponent.~SCR_InventoryStorageManagerComponent ( )

◆ SCR_InventoryStorageManagerComponent()

void SCR_InventoryStorageManagerComponent.SCR_InventoryStorageManagerComponent ( IEntityComponentSource  src,
IEntity  ent,
IEntity  parent 
)
Parameters
[in]src
[in]ent
[in]parent

Member Function Documentation

◆ Action_OpenInventory()

void SCR_InventoryStorageManagerComponent.Action_OpenInventory ( )

◆ AskServerToDeleteEntity()

void SCR_InventoryStorageManagerComponent.AskServerToDeleteEntity ( IEntity  ent)
Parameters
[in]ent

◆ CanInsertItemInActualStorage()

bool SCR_InventoryStorageManagerComponent.CanInsertItemInActualStorage ( IEntity  item,
BaseInventoryStorageComponent  storage,
int  slotID = -1 
)
Parameters
[in]item
[in]storage
[in]slotID
Returns

◆ CanMoveItem()

bool SCR_InventoryStorageManagerComponent.CanMoveItem ( IEntity  item)

Checks whether it is possible to move the item.

Parameters
[in]item
Returns

◆ CanResupplyItem()

EResupplyUnavailableReason SCR_InventoryStorageManagerComponent.CanResupplyItem ( IEntity  user,
ResourceName  itemToResupply,
int  maxItemCount = -1,
InventoryStorageManagerComponent  mustBeInStorage = null,
out int  currentItemAmount = -1 
)
Parameters
[in]itemToResupply
[in]maxItemCount
[in]mustBeInStorage
[out]currentItemAmount
Returns

◆ CanResupplyMuzzle()

EResupplyUnavailableReason SCR_InventoryStorageManagerComponent.CanResupplyMuzzle ( IEntity  user,
notnull BaseMuzzleComponent  muzzle,
int  maxMagazineCount = -1,
InventoryStorageManagerComponent  mustBeInStorage = null,
out int  currentMagazineAmount = -1 
)
Parameters
[in]muzzle
[in]maxMagazineCount
[in]mustBeInStorage
[out]currentMagazineAmount
Returns

◆ CloseInventory()

void SCR_InventoryStorageManagerComponent.CloseInventory ( )

◆ DebugListAllItemsInInventory()

void SCR_InventoryStorageManagerComponent.DebugListAllItemsInInventory ( )

◆ EnablePostFrame()

void SCR_InventoryStorageManagerComponent.EnablePostFrame ( bool  enable)

Enable/disable post frame event.

◆ EndResupplyMagazines()

void SCR_InventoryStorageManagerComponent.EndResupplyMagazines ( )

◆ EquipAny()

bool SCR_InventoryStorageManagerComponent.EquipAny ( BaseInventoryStorageComponent  storage,
IEntity  item,
int  preferred = -1,
SCR_InvCallBack  cb = null 
)

Try to equip the item into the storage at provided slot.

Parameters
[in]storage
[in]item
[in]preferred
[in]cb
Returns

◆ EquipCloth()

void SCR_InventoryStorageManagerComponent.EquipCloth ( IEntity  pOwnerEntity)

Try to equip the item into the slot (cloth)

Parameters
[in]pOwnerEntity

◆ EquipGadget()

void SCR_InventoryStorageManagerComponent.EquipGadget ( IEntity  pOwnerEntity,
SCR_InvCallBack  cb = null 
)

Try to equip the item into the slot (gadget)

Parameters
[in]pOwnerEntity
[in]cb

◆ EquipItem()

void SCR_InventoryStorageManagerComponent.EquipItem ( EquipedWeaponStorageComponent  weaponStorage,
IEntity  weapon 
)

Try to equip the item into the slot (weapon)

Parameters
[in]weaponStorage
[in]weapon

◆ EquipWeapon()

void SCR_InventoryStorageManagerComponent.EquipWeapon ( IEntity  pOwnerEntity,
SCR_InvCallBack  cb = null,
bool  bFromVicinity = true 
)

Try to equip the item into the slot (weapon)

Parameters
[in]pOwnerEntity
[in]cb
[in]bFromVicinity

◆ EquipWeaponAttachment()

void SCR_InventoryStorageManagerComponent.EquipWeaponAttachment ( IEntity  pOwnerEntity,
IEntity  pUserEntity,
SCR_InvCallBack  cb = null 
)

Try to equip the item into the slot (weapon)

Parameters
[in]pOwnerEntity
[in]pUserEntity
[in]cb

◆ FindActualStorageForItemResource()

BaseInventoryStorageComponent SCR_InventoryStorageManagerComponent.FindActualStorageForItemResource ( ResourceName  itemResource,
BaseInventoryStorageComponent  storage,
int  slotID = -1,
int  count = 1 
)

◆ FindNextWeaponOfType()

IEntity SCR_InventoryStorageManagerComponent.FindNextWeaponOfType ( EWeaponType  weaponType,
IEntity  currentItem = null,
bool  allowCurrentPrefab = false 
)

Find next weapon of specified types, excluding currentItem, but including it in sorting.

Parameters
[in]weaponType
[in]currentItem
[in]allowCurrentPrefab
Returns

◆ GetAllItems()

int SCR_InventoryStorageManagerComponent.GetAllItems ( inout array< IEntity >  items,
BaseInventoryStorageComponent  storage 
)
Parameters
[in,out]items
[in]storage
Returns

◆ GetAllRootItems()

int SCR_InventoryStorageManagerComponent.GetAllRootItems ( out notnull array< IEntity >  rootItems)

Get an array of all root items in the inventory storage.

Parameters
[out]rootItemsAll root items without going in the sub inventory of the items or attachments
Returns
Count of root items

◆ GetBandageItem()

IEntity SCR_InventoryStorageManagerComponent.GetBandageItem ( )

◆ GetCharacterStorage()

SCR_CharacterInventoryStorageComponent SCR_InventoryStorageManagerComponent.GetCharacterStorage ( )
Returns

◆ GetHealthComponentCount()

int SCR_InventoryStorageManagerComponent.GetHealthComponentCount ( )
Returns

◆ GetReturnCode()

EInventoryRetCode SCR_InventoryStorageManagerComponent.GetReturnCode ( )
Returns

◆ GetStorageToOpen()

IEntity SCR_InventoryStorageManagerComponent.GetStorageToOpen ( )
Returns

◆ GetTotalWeightOfAllStorages()

float SCR_InventoryStorageManagerComponent.GetTotalWeightOfAllStorages ( )
Returns

◆ GetValidResupplyItemsAndCount()

void SCR_InventoryStorageManagerComponent.GetValidResupplyItemsAndCount ( out notnull map< ResourceName, int >  validResupplyItems,
int  maxMagazineCount = 4,
EMuzzleType  muzzleType = -1,
InventoryStorageManagerComponent  mustBeInStorage = null 
)

Get map of all items (ResourceName) and count to add to inventory on resupply.

Parameters
[out]validResupplyItems
[in]maxMagazineCountDesired number of magazines
[in]muzzleType(optional) If you want to Resupply only check specific muzzle types. -1 to Ignore
[in]mustBeInStorage(Optional) If storage is given than it will check if the item you try to check is in the storage. Used in tadum with Arsenal to give player magazines that are in that arsenal.

◆ GetWeaponPrefabsOfType()

void SCR_InventoryStorageManagerComponent.GetWeaponPrefabsOfType ( notnull array< IEntity >  weapons,
EWeaponType  weaponType,
notnull out array< EntityPrefabData >  prefabs 
)

Get available prefabs of weapons of specified types.

Parameters
[in]weapons
[in]weaponType
[out]prefabs

◆ InsertItem()

void SCR_InventoryStorageManagerComponent.InsertItem ( IEntity  pItem,
BaseInventoryStorageComponent  pStorageTo = null,
BaseInventoryStorageComponent  pStorageFrom = null,
SCR_InvCallBack  cb = null 
)

Try to insert the item into the storage (not slot)

Parameters
[in]pItem
[in]pStorageTo
[in]pStorageFrom
[in]cb

◆ IsAnimationReady()

bool SCR_InventoryStorageManagerComponent.IsAnimationReady ( )
Returns

◆ IsInventoryLocked()

bool SCR_InventoryStorageManagerComponent.IsInventoryLocked ( )
Returns

◆ IsResupplyMagazinesAvailable()

bool SCR_InventoryStorageManagerComponent.IsResupplyMagazinesAvailable ( int  resupplyMagazineCount = 4,
out EResupplyUnavailableReason  resupplyUnavailableReason = EResupplyUnavailableReason::NONE,
EMuzzleType  muzzleType = -1,
InventoryStorageManagerComponent  mustBeInStorage = null 
)

Get if resupply magazines action is available with the given magazine count.

Note it does not check if inventory has free space

Parameters
[in]resupplyMagazineCountHow many magazines will be resupplied
[out]resupplyUnavailableReasonThe reason why the Resupplied failed if it failed
[in]muzzleType(optional) If you want the Resupply to only check specific muzzle types. -1 to Ignore
[in]mustBeInStorage(Optional) If storage is given than it will check if the item you try to resupply is in the storage. Used in tadum with Arsenal to give player magazines that are in that arsenal.
Returns
true if resupply is available.

◆ MoveItemToVicinity()

void SCR_InventoryStorageManagerComponent.MoveItemToVicinity ( IEntity  pItem,
BaseInventoryStorageComponent  pStorageTo = null 
)

try to move item from owner's storage to vicinity.

It might be moved to ground or to a storage in the vicinity

Parameters
[in]pItem
[in]pStorageTo

◆ OnInventoryMenuClosed()

void SCR_InventoryStorageManagerComponent.OnInventoryMenuClosed ( )

◆ OnItemAdded()

override void SCR_InventoryStorageManagerComponent.OnItemAdded ( BaseInventoryStorageComponent  storageOwner,
IEntity  item 
)
protected

Callback when item is added (will be performed locally after server completed the Insert/Move operation)

Implements ScriptedInventoryStorageManagerComponent.

◆ OnItemRemoved()

override void SCR_InventoryStorageManagerComponent.OnItemRemoved ( BaseInventoryStorageComponent  storageOwner,
IEntity  item 
)
protected

Callback when item is removed (will be performed locally after server completed the Remove/Move operation)

Implements ScriptedInventoryStorageManagerComponent.

◆ OnStorageAdded()

override void SCR_InventoryStorageManagerComponent.OnStorageAdded ( BaseInventoryStorageComponent  storage)

Will be called when new storage is registered at manager.

Implements InventoryStorageManagerComponent.

◆ OpenInventory()

void SCR_InventoryStorageManagerComponent.OpenInventory ( )

◆ PlayItemSound()

void SCR_InventoryStorageManagerComponent.PlayItemSound ( IEntity  entity,
string  soundEvent 
)
Parameters
[in]entity
[in]soundEvent

◆ ResupplyMagazines() [1/2]

void SCR_InventoryStorageManagerComponent.ResupplyMagazines ( int  maxMagazineCount = 4,
EMuzzleType  muzzleType = -1,
InventoryStorageManagerComponent  mustBeInStorage = null 
)

Resupply all weapons so they have given number of magazines.

Parameters
[in]maxMagazineCountDesired number of magazines
[in]muzzleType(optional) If you want to Resupply only check specific muzzle types. -1 to Ignore
[in]mustBeInStorage(Optional) If storage is given than it will check if the item you try to check is in the storage. Used in tadum with Arsenal to give player magazines that are in that arsenal.

◆ ResupplyMagazines() [2/2]

void SCR_InventoryStorageManagerComponent.ResupplyMagazines ( notnull map< ResourceName, int >  validResupplyItems)

Resupply all weapons in map with the given number of magazines.

Parameters
[in]validResupplyItemsMap of ResourceNames and amount to add to inventory

◆ RpcAsk_PlaySound()

void SCR_InventoryStorageManagerComponent.RpcAsk_PlaySound ( RplId  targetRplId,
string  soundAction 
)
Parameters
[in]targetRplId
[in]soundAction

◆ RpcAsk_ServerToDeleteEntity()

void SCR_InventoryStorageManagerComponent.RpcAsk_ServerToDeleteEntity ( RplId  targetRplId)
protected

◆ RpcDo_PlaySound()

void SCR_InventoryStorageManagerComponent.RpcDo_PlaySound ( RplId  targetRplId,
string  soundAction 
)
Parameters
[in]targetRplId
[in]soundAction

◆ SetInventoryLocked()

void SCR_InventoryStorageManagerComponent.SetInventoryLocked ( bool  isLocked)
Parameters
[in]isLocked

◆ SetLootStorage()

void SCR_InventoryStorageManagerComponent.SetLootStorage ( IEntity  pOwner)
Parameters
[in]pOwner

◆ SetReturnCode()

void SCR_InventoryStorageManagerComponent.SetReturnCode ( EInventoryRetCode  ERetCode)
Parameters
[in]ERetCode

◆ SetReturnCodeDefault()

void SCR_InventoryStorageManagerComponent.SetReturnCodeDefault ( )

◆ SetStorageToOpen()

void SCR_InventoryStorageManagerComponent.SetStorageToOpen ( IEntity  storage)
Parameters
[in]storage

◆ ShouldForbidRemoveByInstigator()

override bool SCR_InventoryStorageManagerComponent.ShouldForbidRemoveByInstigator ( InventoryStorageManagerComponent  instigatorManager,
BaseInventoryStorageComponent  fromStorage,
IEntity  item 
)
protected

Virtual method that allows verification of item removal as a result of move operation on inventory level.

Implements InventoryStorageManagerComponent.

◆ TryRemoveItemFromInventory()

bool SCR_InventoryStorageManagerComponent.TryRemoveItemFromInventory ( IEntity  pItem,
BaseInventoryStorageComponent  storage = null,
InventoryOperationCallback  cb = null 
)

Locks the inventory for the duration of the item removal process.

Parameters
[in]pItem
[in]storage
[in]cb
Returns

◆ TryReplaceAndDropItemAtSlot()

bool SCR_InventoryStorageManagerComponent.TryReplaceAndDropItemAtSlot ( BaseInventoryStorageComponent  storage,
IEntity  item,
int  slotID,
SCR_InvCallBack  cb = null,
bool  isTakenFromArsenal = false,
bool  deleteOriginalItemIfEmpty = false 
)

Try to drop the original item and replace it by itemToReplace at the slot specified by slotID.

Parameters
[in]storage
[in]item
[in]slotID
[in]cb
[in]isTakenFromArsenal
[in]deleteOriginalItemIfEmpty
Returns

◆ TryReplaceItem()

bool SCR_InventoryStorageManagerComponent.TryReplaceItem ( BaseInventoryStorageComponent  storage,
IEntity  item,
int  preferred,
SCR_InvCallBack  cb 
)

Try to replace at preferred slot.

Parameters
[in]storage
[in]item
[in]preferred
[in]cb
Returns

◆ TrySwapItems()

bool SCR_InventoryStorageManagerComponent.TrySwapItems ( IEntity  pOwnerEntity,
BaseInventoryStorageComponent  pStorageTo,
SCR_InvCallBack  cb = null 
)
Parameters
[in]pOwnerEntity
[in]pStorageTo
[in]cb
Returns

Member Data Documentation

◆ m_bIsInventoryLocked

bool SCR_InventoryStorageManagerComponent.m_bIsInventoryLocked = false
protected

◆ m_ERetCode

EInventoryRetCode SCR_InventoryStorageManagerComponent.m_ERetCode
protected

◆ m_iHealthEquipment

int SCR_InventoryStorageManagerComponent.m_iHealthEquipment = 0
protected

◆ m_OnInventoryOpenInvoker

ref ScriptInvokerBool SCR_InventoryStorageManagerComponent.m_OnInventoryOpenInvoker = new ScriptInvokerBool()

◆ m_OnQuickBarOpenInvoker

ref ScriptInvokerBool SCR_InventoryStorageManagerComponent.m_OnQuickBarOpenInvoker = new ScriptInvokerBool()

◆ m_pWeaponSwitchingUI

ref SCR_WeaponSwitchingBaseUI SCR_InventoryStorageManagerComponent.m_pWeaponSwitchingUI
protected

◆ m_ResupplyMagazineCallback

ref SCR_ResupplyMagazinesCallback SCR_InventoryStorageManagerComponent.m_ResupplyMagazineCallback
protected

The documentation for this interface was generated from the following file: