Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_ScenarioFrameworkResourceComponentActionTransfer.c
Go to the documentation of this file.
3{
4 [Attribute(desc: "Target entity for Resource Action")];
5 ref SCR_ScenarioFrameworkGet m_TargetGetter;
6
7 [Attribute(defvalue: "0", desc: "Transfer Amount", params: "0 inf 0.01")]
8 float m_fTransferAmount;
9
10 [Attribute(defvalue: "1", desc: "Allow Partial Transfer")]
11 bool m_bAllowPartialTransfer;
12
13 SCR_ResourceComponent m_TargetResourceComponent;
14
15 //------------------------------------------------------------------------------------------------
18 override void Init(SCR_ResourceComponent resourceComp, EResourceType resourceType)
19 {
20 IEntity entity = GetInputEntity(m_TargetGetter);
21 if (!entity)
22 {
23 Print(string.Format("ScenarioFramework Action: Target Entity not found for Action %1.", this), LogLevel.ERROR);
24 return;
25 }
26
27 m_TargetResourceComponent = SCR_ResourceComponent.Cast(entity.FindComponent(SCR_ResourceComponent));
28 if (!m_TargetResourceComponent)
29 {
30 Print(string.Format("ScenarioFramework Action: Target Entity SCR_ResourceComponent not found for Action %1.", this), LogLevel.ERROR);
31 return;
32 }
33
34 super.Init(resourceComp, resourceType);
35 }
36
37 //------------------------------------------------------------------------------------------------
38 override void OnActivate()
39 {
40 super.OnActivate();
41
42 SCR_ResourceSystemHelper.SimpleResourceTransfer(m_ResourceComponent, m_TargetResourceComponent, m_fTransferAmount, m_bAllowPartialTransfer, m_eResourceType);
43 }
44}
override void Init()
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
proto external Managed FindComponent(typename typeName)
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
LogLevel
Enum with severity of the logging message.
Definition LogLevel.c:14
SCR_FieldOfViewSettings Attribute