13class SCR_ResourceEncapsulatorActionBase
35 if (!representedContainer)
42 if (containerQueueCount == 0)
51 for (
int i = containerQueueCount - 1; i >= 0; --i)
83class SCR_ResourceEncapsulatorActionDisableUserActions : SCR_ResourceEncapsulatorActionBase
85 override void PerformAction(SCR_ResourceContainer representativeContainer, SCR_ResourceContainer representedContainer)
87 if (!representedContainer)
90 IEntity owner = representedContainer.GetOwner();
95 ActionsManagerComponent actionManagerComponent = ActionsManagerComponent.Cast(owner.
FindComponent(ActionsManagerComponent));
97 if (!actionManagerComponent)
100 actionManagerComponent.Deactivate(owner);
105class SCR_ResourceEncapsulatorActionDisableInventoryStorage : SCR_ResourceEncapsulatorActionBase
107 override void PerformAction(SCR_ResourceContainer representativeContainer, SCR_ResourceContainer representedContainer)
109 if (!representedContainer)
112 IEntity owner = representedContainer.GetOwner();
117 InventoryItemComponent inventoryComponent = InventoryItemComponent.Cast(owner.
FindComponent(InventoryItemComponent));
119 if (!inventoryComponent)
122 inventoryComponent.DisablePhysics();
123 inventoryComponent.ActivateOwner(
false);
128class SCR_ResourceEncapsulatorActionChangeRights : SCR_ResourceEncapsulatorActionBase
133 override void PerformAction(SCR_ResourceContainer representativeContainer, SCR_ResourceContainer representedContainer)
135 if (!representedContainer)
138 representedContainer.SetResourceRights(m_eResourceRights);
143class SCR_ResourceEncapsulatorActionChangeDecay : SCR_ResourceEncapsulatorActionBase
145 [
Attribute(uiwidget: UIWidgets.CheckBox)]
146 protected bool m_bEnableResourceDecay;
149 protected float m_fResourceDecay;
151 [
Attribute(uiwidget: UIWidgets.SpinBox,
params:
string.Format(
"0.0 %1 1.0",
float.MAX))]
152 protected float m_fResourceDecayTickrate;
154 [
Attribute(uiwidget: UIWidgets.SpinBox,
params:
string.Format(
"0.0 %1 1.0",
float.MAX))]
155 protected float m_fResourceDecayTimeout;
157 override void PerformAction(SCR_ResourceContainer representativeContainer, SCR_ResourceContainer representedContainer)
159 if (!representedContainer)
162 representedContainer.
EnableDecay(m_bEnableResourceDecay,
false);
170class SCR_ResourceEncapsulatorActionChangeOnEmptyBehavior : SCR_ResourceEncapsulatorActionBase
175 override void PerformAction(SCR_ResourceContainer representativeContainer, SCR_ResourceContainer representedContainer)
177 if (!representedContainer)
185class SCR_ResourceEncapsulatorActionChangeGain : SCR_ResourceEncapsulatorActionBase
187 [
Attribute(uiwidget: UIWidgets.CheckBox)]
188 protected bool m_bEnableResourceGain;
191 protected float m_fResourceGain;
193 [
Attribute(uiwidget: UIWidgets.SpinBox,
params:
string.Format(
"0.0 %1 1.0",
float.MAX))]
194 protected float m_fResourceGainTickrate;
196 [
Attribute(uiwidget: UIWidgets.SpinBox,
params:
string.Format(
"0.0 %1 1.0",
float.MAX))]
197 protected float m_fResourceGainTimeout;
199 override void PerformAction(SCR_ResourceContainer representativeContainer, SCR_ResourceContainer representedContainer)
201 if (!representedContainer)
204 representedContainer.
EnableGain(m_bEnableResourceGain,
false);