Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_ScenarioFrameworkActionOnAllChildrenSpawned.c
Go to the documentation of this file.
3{
4 [Attribute(desc: "Getter for scenarioFramework layerBase (or inherited class), which will be checked")];
5 ref SCR_ScenarioFrameworkGet m_Getter;
6
7 [Attribute(desc: "Actions to be called")]
8 ref array<ref SCR_ScenarioFrameworkActionBase> m_aActions;
9
10 //------------------------------------------------------------------------------------------------
11 override void OnActivate(IEntity object)
12 {
13 if (!CanActivate())
14 return;
15
16 //Process Array
17 SCR_ScenarioFrameworkParam<array<IEntity>> entityArrayWrapper = SCR_ScenarioFrameworkParam<array<IEntity>>.Cast(m_Getter.Get());
18 if (entityArrayWrapper)
19 {
20 array<IEntity> entities = {};
21 entities = entityArrayWrapper.GetValue();
22
23 if (entities.IsEmpty())
24 {
25 Print(string.Format("ScenarioFramework Action: Array Getter for %1 has no elements to work with.", this), LogLevel.ERROR);
26 return;
27 }
28
29 foreach (IEntity entity : entities)
30 {
31 ProcessEntity(entity);
32 }
33
34 return;
35 }
36
37 //Process single entity
38 SCR_ScenarioFrameworkParam<IEntity> entityWrapper = SCR_ScenarioFrameworkParam<IEntity>.Cast(m_Getter.Get());
39 IEntity entity = entityWrapper.GetValue();
40 if (!entity)
41 {
42 Print(string.Format("ScenarioFramework Action: Entity not found for Action %1.", this), LogLevel.ERROR);
43 return;
44 }
45
46 ProcessEntity(entity);
47 }
48
49 //------------------------------------------------------------------------------------------------
50 void ProcessEntity(IEntity ent)
51 {
53 if (!layerBase)
54 {
55 //Pass entities directly to Actions
56 foreach (SCR_ScenarioFrameworkActionBase action : m_aActions)
57 {
58 action.OnActivate(ent);
59 }
60
61 return;
62 }
63
64 if (layerBase.GetIsInitiated())
65 ActivateActions(layerBase);
66
67 layerBase.GetOnAllChildrenSpawned().Insert(ActivateActions);
68
69 }
70
71 //------------------------------------------------------------------------------------------------
73 {
74 foreach (SCR_ScenarioFrameworkActionBase action : m_aActions)
75 {
76 action.OnActivate(layerBase.GetOwner());
77 }
78 }
79}
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
override void OnActivate()
void ActivateActions()
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
void SCR_ScenarioFrameworkLayerBase(IEntityComponentSource src, IEntity ent, IEntity parent)
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