Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_ResourceEncapsulatorActionBase.c
Go to the documentation of this file.
3 {
4  void PerformAction(SCR_ResourceContainer representativeContainer, SCR_ResourceContainer representedContainer)
5  {
6 
7  }
8 }
9 
11 class SCR_ResourceEncapsulatorActionChangeResourceValue : SCR_ResourceEncapsulatorActionBase
12 {
13  [Attribute(uiwidget: UIWidgets.SpinBox, params: string.Format("0.0 %1 1.0", float.MAX))]
14  protected float m_fResourceValueCurrent;
15 
16  override void PerformAction(SCR_ResourceContainer representativeContainer, SCR_ResourceContainer representedContainer)
17  {
18  if (!representedContainer)
19  return;
20 
21  float resourcesResult = Math.Min(m_fResourceValueCurrent, representedContainer.GetMaxResourceValue());
22  m_fResourceValueCurrent -= resourcesResult;
23 
24  representedContainer.SetResourceValue(resourcesResult, false);
25  }
26 }
27 
29 class SCR_ResourceEncapsulatorActionDisableUserActions : SCR_ResourceEncapsulatorActionBase
30 {
31  override void PerformAction(SCR_ResourceContainer representativeContainer, SCR_ResourceContainer representedContainer)
32  {
33  if (!representedContainer)
34  return;
35 
36  IEntity owner = representedContainer.GetOwner();
37 
38  if (!owner)
39  return;
40 
41  ActionsManagerComponent actionManagerComponent = ActionsManagerComponent.Cast(owner.FindComponent(ActionsManagerComponent));
42 
43  if (!actionManagerComponent)
44  return;
45 
46  actionManagerComponent.Deactivate(owner);
47  }
48 }
49 
51 class SCR_ResourceEncapsulatorActionDisableInventoryStorage : SCR_ResourceEncapsulatorActionBase
52 {
53  override void PerformAction(SCR_ResourceContainer representativeContainer, SCR_ResourceContainer representedContainer)
54  {
55  if (!representedContainer)
56  return;
57 
58  IEntity owner = representedContainer.GetOwner();
59 
60  if (!owner)
61  return;
62 
63  InventoryItemComponent inventoryComponent = InventoryItemComponent.Cast(owner.FindComponent(InventoryItemComponent));
64 
65  if (!inventoryComponent)
66  return;
67 
68  inventoryComponent.DisablePhysics();
69  inventoryComponent.ActivateOwner(false);
70  }
71 }
72 
74 class SCR_ResourceEncapsulatorActionChangeRights : SCR_ResourceEncapsulatorActionBase
75 {
76  [Attribute(defvalue: EResourceRights.NONE.ToString(), uiwidget: UIWidgets.ComboBox, desc: "Limits the taking of resources to a specific group", enums: ParamEnumArray.FromEnum(EResourceRights))]
77  protected EResourceRights m_eResourceRights;
78 
79  override void PerformAction(SCR_ResourceContainer representativeContainer, SCR_ResourceContainer representedContainer)
80  {
81  if (!representedContainer)
82  return;
83 
84  representedContainer.SetResourceRights(m_eResourceRights);
85  }
86 }
87 
89 class SCR_ResourceEncapsulatorActionChangeDecay : SCR_ResourceEncapsulatorActionBase
90 {
91  [Attribute(uiwidget: UIWidgets.CheckBox)]
92  protected bool m_bEnableResourceDecay;
93 
94  [Attribute(uiwidget: UIWidgets.SpinBox, params: "0.0 inf 1.0")]
95  protected float m_fResourceDecay;
96 
97  [Attribute(uiwidget: UIWidgets.SpinBox, params: string.Format("0.0 %1 1.0", float.MAX))]
98  protected float m_fResourceDecayTickrate;
99 
100  [Attribute(uiwidget: UIWidgets.SpinBox, params: string.Format("0.0 %1 1.0", float.MAX))]
101  protected float m_fResourceDecayTimeout;
102 
103  override void PerformAction(SCR_ResourceContainer representativeContainer, SCR_ResourceContainer representedContainer)
104  {
105  if (!representedContainer)
106  return;
107 
108  representedContainer.EnableDecay(m_bEnableResourceDecay, false);
109  representedContainer.SetResourceDecay(m_fResourceDecay, false);
110  representedContainer.SetResourceDecayTickrate(m_fResourceDecayTickrate);
111  representedContainer.SetResourceDecayTimeout(m_fResourceDecayTimeout);
112  }
113 }
114 
116 class SCR_ResourceEncapsulatorActionChangeOnEmptyBehavior : SCR_ResourceEncapsulatorActionBase
117 {
118  [Attribute(defvalue: EResourceContainerOnEmptyBehavior.NONE.ToString(), uiwidget: UIWidgets.ComboBox, desc: "Sets the behavior of when the container resource value reaches 0.", enums: ParamEnumArray.FromEnum(EResourceContainerOnEmptyBehavior))]
119  protected EResourceContainerOnEmptyBehavior m_eOnEmptyBehavior;
120 
121  override void PerformAction(SCR_ResourceContainer representativeContainer, SCR_ResourceContainer representedContainer)
122  {
123  if (!representedContainer)
124  return;
125 
126  representedContainer.SetOnEmptyBehavior(m_eOnEmptyBehavior);
127  }
128 }
129 
131 class SCR_ResourceEncapsulatorActionChangeGain : SCR_ResourceEncapsulatorActionBase
132 {
133  [Attribute(uiwidget: UIWidgets.CheckBox)]
134  protected bool m_bEnableResourceGain;
135 
136  [Attribute(uiwidget: UIWidgets.SpinBox, params: "0.0 inf 1.0")]
137  protected float m_fResourceGain;
138 
139  [Attribute(uiwidget: UIWidgets.SpinBox, params: string.Format("0.0 %1 1.0", float.MAX))]
140  protected float m_fResourceGainTickrate;
141 
142  [Attribute(uiwidget: UIWidgets.SpinBox, params: string.Format("0.0 %1 1.0", float.MAX))]
143  protected float m_fResourceGainTimeout;
144 
145  override void PerformAction(SCR_ResourceContainer representativeContainer, SCR_ResourceContainer representedContainer)
146  {
147  if (!representedContainer)
148  return;
149 
150  representedContainer.EnableGain(m_bEnableResourceGain, false);
151  representedContainer.SetResourceGain(m_fResourceGain, false);
152  representedContainer.SetResourceGainTickrate(m_fResourceGainTickrate);
153  representedContainer.SetResourceGainTimeout(m_fResourceGainTimeout);
154  }
155 }
156 
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition: SCR_RespawnBriefingComponent.c:17
Attribute
typedef Attribute
Post-process effect of scripted camera.
EResourceRights
EResourceRights
Definition: SCR_ResourceContainer.c:8
InventoryItemComponent
Definition: InventoryItemComponent.c:12
SCR_ResourceContainer
Definition: SCR_ResourceContainer.c:34
params
Configs ServerBrowser KickDialogs params
Definition: SCR_NotificationSenderComponent.c:24
PerformAction
proto external void PerformAction(BaseUserAction action)
SCR_ResourceEncapsulatorActionBase
Definition: SCR_ResourceEncapsulatorActionBase.c:2
EResourceContainerOnEmptyBehavior
EResourceContainerOnEmptyBehavior
Definition: SCR_ResourceContainer.c:26
BaseContainerProps
SCR_AIGoalReaction_Follow BaseContainerProps
Handles insects that are supposed to be spawned around selected prefabs defined in prefab names array...
Definition: SCR_AIGoalReaction.c:468