Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_ResourceStorageOpenAction.c
Go to the documentation of this file.
2{
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))]
6
7 //------------------------------------------------------------------------------------------------
8 override event bool CanBePerformedScript(IEntity user)
9 {
11 IEntity topOwner = m_TopMostOwner.GetParent();
12
13 while (topOwner)
14 {
15 SCR_ResourceComponent component = SCR_ResourceComponent.Cast(topOwner.FindComponent(SCR_ResourceComponent));
16
17 if (component && component.GetEncapsulator(m_eResourceType))
18 m_TopMostOwner = topOwner;
19
20 topOwner = topOwner.GetParent();
21 }
22
23 return super.CanBePerformedScript(user);
24 }
25
26 #ifndef DISABLE_INVENTORY
27 //------------------------------------------------------------------------------------------------
28 override protected void PerformActionInternal(SCR_InventoryStorageManagerComponent manager, IEntity pOwnerEntity, IEntity pUserEntity)
29 {
30 m_TopMostOwner = pOwnerEntity;
31 IEntity topOwner = m_TopMostOwner.GetParent();
32
33 while (topOwner)
34 {
35 SCR_ResourceComponent component = SCR_ResourceComponent.Cast(topOwner.FindComponent(SCR_ResourceComponent));
36
37 if (component && component.GetEncapsulator(m_eResourceType))
38 m_TopMostOwner = topOwner;
39
40 topOwner = topOwner.GetParent();
41 }
42
43 SCR_InventoryStorageManagerComponent manager2 = SCR_InventoryStorageManagerComponent.Cast(m_TopMostOwner.FindComponent( SCR_InventoryStorageManagerComponent ));
44
45 if ( !manager2 )
46 return;
47
48 super.PerformActionInternal(manager2, m_TopMostOwner, pUserEntity);
49 }
50 #endif
51
52 //------------------------------------------------------------------------------------------------
53 override event void Init(IEntity pOwnerEntity, GenericComponent pManagerComponent)
54 {
55 m_TopMostOwner = pOwnerEntity;
56 IEntity topOwner = pOwnerEntity.GetParent();
57
58 while (topOwner)
59 {
60 SCR_ResourceComponent component = SCR_ResourceComponent.Cast(topOwner.FindComponent(SCR_ResourceComponent));
61
62 if (component && component.GetEncapsulator(m_eResourceType))
63 m_TopMostOwner = topOwner;
64
65 topOwner = topOwner.GetParent();
66 }
67 }
68}
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
proto external Managed FindComponent(typename typeName)
proto external IEntity GetParent()
modded version for to be used with the inventory 2.0
override event void Init(IEntity pOwnerEntity, GenericComponent pManagerComponent)
override event bool CanBePerformedScript(IEntity user)
void PerformActionInternal(SCR_InventoryStorageManagerComponent manager, IEntity pOwnerEntity, IEntity pUserEntity)
IEntity GetOwner()
Owner entity of the fuel tank.
SCR_FieldOfViewSettings Attribute