5 #ifndef DISABLE_INVENTORY
7 protected const string SREASON_TOO_BIG =
"#AR-Inventory_InfoTooBig";
8 protected const string SREASON_TOO_HEAVY =
"#AR-Inventory_InfoTooHeavy";
11 protected string GetReason( SCR_InventoryStorageManagerComponent
pInventoryManager )
20 if ( ( ERetCode & EInventoryRetCode.RETCODE_ITEM_TOO_BIG ) == EInventoryRetCode.RETCODE_ITEM_TOO_BIG )
21 sReason +=
" " + SREASON_TOO_BIG;
23 if ( ( ERetCode & EInventoryRetCode.RETCODE_ITEM_TOO_HEAVY ) == EInventoryRetCode.RETCODE_ITEM_TOO_HEAVY )
24 sReason +=
" " + SREASON_TOO_HEAVY;
30 override bool CanBeShownScript(IEntity user)
35 IEntity itemEntity =
m_Item.GetOwner();
36 BaseMagazineComponent baseMagComponent = BaseMagazineComponent.Cast(itemEntity.FindComponent(BaseMagazineComponent));
39 if (baseMagComponent.IsUsed())
44 IEntity itemParent = itemEntity.GetParent();
45 if (ChimeraCharacter.Cast(itemParent))
52 override bool CanBePerformedScript(IEntity user)
56 Managed genericInventoryManager = user.FindComponent( SCR_InventoryStorageManagerComponent );
57 if (!genericInventoryManager)
59 RplComponent genericRpl = RplComponent.Cast(user.FindComponent( RplComponent ));
63 return genericRpl.IsOwner();
66 override void PerformAction(IEntity pOwnerEntity, IEntity pUserEntity)
68 if (!CanBePerformedScript(pUserEntity))
70 SCR_InventoryStorageManagerComponent genericInventoryManager = SCR_InventoryStorageManagerComponent.Cast(pUserEntity.FindComponent( SCR_InventoryStorageManagerComponent ));
71 if ( !genericInventoryManager )
73 PerformActionInternal( genericInventoryManager, pOwnerEntity, pUserEntity);
78 override bool GetActionNameScript(out
string outName)
83 override bool HasLocalEffectOnlyScript()
88 protected void PerformActionInternal(SCR_InventoryStorageManagerComponent manager, IEntity pOwnerEntity, IEntity pUserEntity)
94 override void Init(IEntity pOwnerEntity, GenericComponent pManagerComponent)
100 override bool GetActionNameScript(out
string outName)
102 outName =
"#AR-Inventory_Disabled";