Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
MotorExhaustSystem.c
Go to the documentation of this file.
2{
3 //------------------------------------------------------------------------------------------------
4 override static void InitInfo(WorldSystemInfo outInfo)
5 {
6 outInfo
7 .SetAbstract(false)
8 .AddPoint(ESystemPoint.Frame);
9 }
10 //------------------------------------------------------------------------------------------------
11 protected ref array<SCR_MotorExhaustEffectGeneralComponent> m_MotorsComponents = {};
12 //------------------------------------------------------------------------------------------------
13 override bool ShouldBePaused() { return true; };
14 //------------------------------------------------------------------------------------------------
15 override protected void OnUpdatePoint(WorldUpdatePointArgs args)
16 {
17 float timeSlice = args.GetTimeSliceSeconds();
18
19 foreach (SCR_MotorExhaustEffectGeneralComponent comp: m_MotorsComponents)
20 {
21 comp.Update(timeSlice);
22 }
23 }
24 //------------------------------------------------------------------------------------------------
25 override void OnStopped()
26 {
27 foreach (SCR_MotorExhaustEffectGeneralComponent comp: m_MotorsComponents)
28 {
29 comp.OnGamePauseChanged(true);
30 }
31 }
32 //------------------------------------------------------------------------------------------------
33 override void OnStarted()
34 {
35 foreach (SCR_MotorExhaustEffectGeneralComponent comp: m_MotorsComponents)
36 {
37 comp.OnGamePauseChanged(false);
38 }
39 }
40 //------------------------------------------------------------------------------------------------
41 override void OnDiag(float timeSlice)
42 {
43 DbgUI.Begin("MotorExhaustSystem");
44
45 DbgUI.Text("Motors: " + m_MotorsComponents.Count());
46
47 if (DbgUI.Button("Dump active motors components"))
48 {
49 foreach (SCR_MotorExhaustEffectGeneralComponent comp: m_MotorsComponents)
50 {
51 Print(comp.GetOwner(), LogLevel.ERROR);
52 }
53 }
54
55 DbgUI.End();
56 }
57 //------------------------------------------------------------------------------------------------
58 void Register(SCR_MotorExhaustEffectGeneralComponent component)
59 {
60 //About to be deleted
61 if (component.GetOwner().IsDeleted() || (component.GetOwner().GetFlags() & EntityFlags.USER5))
62 return;
63
64 if (m_MotorsComponents.Find(component) != -1)
65 return;
66
67 m_MotorsComponents.Insert(component);
68 }
69 //------------------------------------------------------------------------------------------------
70 void Unregister(SCR_MotorExhaustEffectGeneralComponent component)
71 {
72 int idx = m_MotorsComponents.Find(component);
73 if (idx == -1)
74 return;
75
76 m_MotorsComponents.Remove(idx);
77 }
78}
Definition DbgUI.c:66
override void OnStarted()
ref array< SCR_MotorExhaustEffectGeneralComponent > m_MotorsComponents
void OnUpdatePoint(WorldUpdatePointArgs args)
void Register(SCR_MotorExhaustEffectGeneralComponent component)
override bool ShouldBePaused()
override void OnStopped()
override void OnDiag(float timeSlice)
void Unregister(SCR_MotorExhaustEffectGeneralComponent component)
Structure holding world system meta-information required by the engine.
Structure holding extra data of WorldSystem update point.
WorldSystemPoint ESystemPoint
Definition gameLib.c:7
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
EntityFlags
Various entity flags.
Definition EntityFlags.c:14