3 [
Attribute(defvalue:
EResourceType.SUPPLIES.ToString(), uiwidget: UIWidgets.ComboBox,
desc:
"Sets the type of Resource to be used.\nOnly a transaction matching Resource types can be successfully concluded.", enums: ParamEnumArray.FromEnum(
EResourceType))]
5 protected IEntity m_TopMostOwner;
8 override event bool CanBePerformedScript(IEntity user)
11 IEntity topOwner = m_TopMostOwner.GetParent();
15 SCR_ResourceComponent component = SCR_ResourceComponent.Cast(topOwner.FindComponent(SCR_ResourceComponent));
17 if (component && component.GetEncapsulator(m_eResourceType))
18 m_TopMostOwner = topOwner;
20 topOwner = topOwner.GetParent();
23 return super.CanBePerformedScript(user);
26 #ifndef DISABLE_INVENTORY
28 override protected void PerformActionInternal(SCR_InventoryStorageManagerComponent manager, IEntity pOwnerEntity, IEntity pUserEntity)
30 m_TopMostOwner = pOwnerEntity;
31 IEntity topOwner = m_TopMostOwner.GetParent();
35 SCR_ResourceComponent component = SCR_ResourceComponent.Cast(topOwner.FindComponent(SCR_ResourceComponent));
37 if (component && component.GetEncapsulator(m_eResourceType))
38 m_TopMostOwner = topOwner;
40 topOwner = topOwner.GetParent();
43 SCR_InventoryStorageManagerComponent manager2 = SCR_InventoryStorageManagerComponent.Cast(m_TopMostOwner.FindComponent( SCR_InventoryStorageManagerComponent ));
48 super.PerformActionInternal(manager2, m_TopMostOwner, pUserEntity);
53 override event void Init(IEntity pOwnerEntity, GenericComponent pManagerComponent)
55 m_TopMostOwner = pOwnerEntity;
56 IEntity topOwner = pOwnerEntity.GetParent();
60 SCR_ResourceComponent component = SCR_ResourceComponent.Cast(topOwner.FindComponent(SCR_ResourceComponent));
62 if (component && component.GetEncapsulator(m_eResourceType))
63 m_TopMostOwner = topOwner;
65 topOwner = topOwner.GetParent();