Arma Reforger Explorer
1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Toggle main menu visibility
Loading...
Searching...
No Matches
NotificationsSystem.c
Go to the documentation of this file.
1
2
class
NotificationsSystem
:
GameSystem
3
{
4
override
static
void
InitInfo(
WorldSystemInfo
outInfo)
5
{
6
outInfo
7
.SetAbstract(
false
)
8
.AddPoint(
ESystemPoint
.Frame);
9
}
10
11
protected
bool
m_bUpdating
=
false
;
12
protected
ref array<SCR_NotificationsComponent>
m_Components
= {};
13
protected
ref array<SCR_NotificationsComponent>
m_DeletedComponents
= {};
14
15
override
protected
void
OnUpdatePoint
(
WorldUpdatePointArgs
args)
16
{
17
float
timeSlice = args.GetTimeSliceSeconds();
18
19
m_bUpdating
=
true
;
20
21
foreach
(SCR_NotificationsComponent comp:
m_Components
)
22
{
23
comp.Update(timeSlice);
24
}
25
26
m_bUpdating
=
false
;
27
28
foreach
(SCR_NotificationsComponent comp:
m_DeletedComponents
)
29
{
30
Unregister
(comp);
31
}
32
m_DeletedComponents
.Clear();
33
}
34
35
override
protected
void
OnDiag
(
float
timeSlice)
36
{
37
DbgUI
.Begin(
"NotificationsSystem"
);
38
39
DbgUI
.Text(
"Items: "
+
m_Components
.Count());
40
41
if
(
DbgUI
.Button(
"Dump active components"
))
42
{
43
foreach
(SCR_NotificationsComponent comp:
m_Components
)
44
{
45
Print
(comp.GetOwner(),
LogLevel
.ERROR);
46
}
47
}
48
49
DbgUI
.End();
50
}
51
52
void
Register
(SCR_NotificationsComponent component)
53
{
54
//About to be deleted
55
if
(component.GetOwner().IsDeleted() || (component.GetOwner().GetFlags() &
EntityFlags
.USER5))
56
return
;
57
58
if
(
m_Components
.Find(component) != -1)
59
return
;
60
61
m_Components
.Insert(component);
62
}
63
64
void
Unregister
(SCR_NotificationsComponent component)
65
{
66
int
idx
=
m_Components
.Find(component);
67
if
(
idx
== -1)
68
return
;
69
70
if
(
m_bUpdating
)
71
m_DeletedComponents
.Insert(component);
72
else
73
m_Components
.Remove(
idx
);
74
}
75
}
idx
int idx
Definition
AIControlComponentSerializer.c:13
DbgUI
Definition
DbgUI.c:66
GameSystem
Definition
GameSystem.c:16
NotificationsSystem
TODO: When systems can be replicated, just move overything from SCR_NotificationsComponent.
Definition
NotificationsSystem.c:3
NotificationsSystem::Register
void Register(SCR_NotificationsComponent component)
Definition
NotificationsSystem.c:52
NotificationsSystem::OnDiag
void OnDiag(float timeSlice)
Definition
NotificationsSystem.c:35
NotificationsSystem::m_bUpdating
bool m_bUpdating
Definition
NotificationsSystem.c:11
NotificationsSystem::m_Components
ref array< SCR_NotificationsComponent > m_Components
Definition
NotificationsSystem.c:12
NotificationsSystem::Unregister
void Unregister(SCR_NotificationsComponent component)
Definition
NotificationsSystem.c:64
NotificationsSystem::OnUpdatePoint
void OnUpdatePoint(WorldUpdatePointArgs args)
Definition
NotificationsSystem.c:15
NotificationsSystem::m_DeletedComponents
ref array< SCR_NotificationsComponent > m_DeletedComponents
Definition
NotificationsSystem.c:13
WorldSystemInfo
Structure holding world system meta-information required by the engine.
Definition
WorldSystemInfo.c:14
WorldUpdatePointArgs
Structure holding extra data of WorldSystem update point.
Definition
WorldUpdatePointArgs.c:14
ESystemPoint
WorldSystemPoint ESystemPoint
Definition
gameLib.c:7
Print
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
LogLevel
LogLevel
Enum with severity of the logging message.
Definition
LogLevel.c:14
EntityFlags
EntityFlags
Various entity flags.
Definition
EntityFlags.c:14
scripts
Game
Systems
NotificationsSystem.c
Generated by
1.17.0