3 protected SCR_InventoryStorageManagerComponent m_InventoryManager;
5 override bool CanBeShownScript(IEntity user)
7 if (!super.CanBeShownScript(user))
12 ChimeraCharacter character = ChimeraCharacter.Cast(
SCR_PlayerController.GetLocalControlledEntity());
16 m_InventoryManager = SCR_InventoryStorageManagerComponent.Cast(character.FindComponent(SCR_InventoryStorageManagerComponent));
23 if (
GetOwner() != muzzleComp.GetOwner())
26 IEntity currentMag = m_WeaponComponent.GetCurrentMagazine().GetOwner();
28 BaseInventoryStorageComponent magStorage = magInventory.GetParentSlot().GetStorage();
29 WeaponAttachmentsStorageComponent wasc = WeaponAttachmentsStorageComponent.Cast(magStorage);
36 override protected void PerformActionInternal(SCR_InventoryStorageManagerComponent manager, IEntity pOwnerEntity, IEntity pUserEntity)
38 IEntity currentMag = m_WeaponComponent.GetCurrentMagazine().GetOwner();
40 BaseInventoryStorageComponent magStorage = magInventory.GetParentSlot().GetStorage();
42 WeaponAttachmentsStorageComponent wasc = WeaponAttachmentsStorageComponent.Cast(magStorage);
45 Print(
"ERROR: Magazine is no longer in the weapon", LogLevel.ERROR);
49 BaseInventoryStorageComponent suitableStorage =
m_InventoryManager.FindStorageForItem(currentMag);
59 override bool GetActionNameScript(out
string outName)
61 if (!m_WeaponComponent)
64 IEntity currentMag = m_WeaponComponent.GetCurrentMagazine().GetOwner();
73 UIInfo itemInfo = magItem.GetUIInfo();
74 if (actionInfo && itemInfo)
76 outName =
string.Format(
"%1%2", actionInfo.GetName(), itemInfo.GetName());