Arma Reforger Explorer
1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Toggle main menu visibility
Loading...
Searching...
No Matches
SCR_VoNComponent.c
Go to the documentation of this file.
1
//------------------------------------------------------------------------------------------------
2
class
SCR_VoNComponentClass
:
VoNComponentClass
3
{}
4
5
//------------------------------------------------------------------------------------------------
6
class
SCR_VoNComponent : VoNComponent
7
{
8
private
const
float
TRANSMISSION_TIMEOUT_MS
= 500;
9
private
float
m_fTransmitingTimeout;
10
private
float
m_fTransmitRadioTimeout;
11
private
SCR_VonDisplay
m_VONDisplay
;
12
13
ref
ScriptInvoker
m_OnReceivedVON =
new
ScriptInvoker
();
14
ref
ScriptInvoker
m_OnCaptureVON =
new
ScriptInvoker
();
15
protected
static
ref
ScriptInvokerInt
m_OnVoNUsed;
16
17
//------------------------------------------------------------------------------------------------
18
static
ScriptInvokerInt
GetOnVoNUsed()
19
{
20
if
(!m_OnVoNUsed)
21
m_OnVoNUsed =
new
ScriptInvokerInt
();
22
23
return
m_OnVoNUsed;
24
}
25
26
//------------------------------------------------------------------------------------------------
29
SCR_VonDisplay
GetDisplay
()
30
{
31
if
(
m_VONDisplay
)
32
return
m_VONDisplay
;
33
34
SCR_VONController vonContr = SCR_VONController.Cast(
GetGame
().
GetPlayerController
().FindComponent(SCR_VONController));
35
if
(vonContr)
36
{
37
m_VONDisplay
= vonContr.GetDisplay();
38
return
m_VONDisplay
;
39
}
40
41
return
null;
42
}
43
44
//------------------------------------------------------------------------------------------------
48
bool
IsTransmiting
()
49
{
50
return
m_fTransmitingTimeout >
GetGame
().GetWorld().GetWorldTime();
51
}
52
53
//------------------------------------------------------------------------------------------------
56
bool
IsTransmitingRadio
()
57
{
58
return
m_fTransmitRadioTimeout >
GetGame
().GetWorld().GetWorldTime();
59
}
60
61
//------------------------------------------------------------------------------------------------
62
override
protected
event
void
OnCapture
(
BaseTransceiver
transmitter)
63
{
64
SCR_VonDisplay display =
GetDisplay
();
65
66
if
(display)
67
display.OnCapture(transmitter);
68
69
m_OnCaptureVON.Invoke(transmitter);
70
71
m_fTransmitingTimeout =
GetGame
().GetWorld().GetWorldTime() +
TRANSMISSION_TIMEOUT_MS
;
72
73
if
(transmitter)
74
m_fTransmitRadioTimeout =
GetGame
().GetWorld().GetWorldTime() +
TRANSMISSION_TIMEOUT_MS
;
75
}
76
77
//------------------------------------------------------------------------------------------------
78
override
protected
event
void
OnReceive
(
int
playerId,
bool
isSenderEditor,
BaseTransceiver
receiver,
int
frequency,
float
quality)
79
{
80
SCR_VonDisplay display =
GetDisplay
();
81
82
if
(display)
83
display.OnReceive(playerId, isSenderEditor, receiver, frequency, quality);
84
85
m_OnReceivedVON.Invoke(playerId, receiver, frequency, quality);
86
}
87
88
//------------------------------------------------------------------------------------------------
89
override
protected
event
void
OnVoNUsed
(
int
senderId)
90
{
91
if
(m_OnVoNUsed)
92
m_OnVoNUsed.Invoke(senderId);
93
}
94
95
//------------------------------------------------------------------------------------------------
96
override
protected
event
IEntity
GetEditorEntity
(
int
playerId)
97
{
98
SCR_EditorManagerCore
core =
SCR_EditorManagerCore
.Cast(
SCR_EditorManagerCore
.GetInstance(
SCR_EditorManagerCore
));
99
if
(!core)
100
return
null;
101
102
return
core.
GetEditorManager
(playerId);
103
}
104
105
//------------------------------------------------------------------------------------------------
106
override
protected
event
vector
GetEditorWorldLocation
(
int
playerId)
107
{
108
SCR_EditorManagerCore
core =
SCR_EditorManagerCore
.Cast(
SCR_EditorManagerCore
.GetInstance(
SCR_EditorManagerCore
));
109
if
(!core)
110
return
vector
.Zero;
111
112
SCR_EditorManagerEntity
editorManager = core.
GetEditorManager
(playerId);
113
if
(!editorManager)
114
return
vector
.Zero;
115
116
vector
mat[4];
117
editorManager.GetWorldTransform(mat);
118
return
mat[3];
119
}
120
121
//------------------------------------------------------------------------------------------------
122
override
bool
IsEntityActiveEditor
(
IEntity
entity)
123
{
124
if
(!entity)
125
return
false
;
126
127
SCR_EditorManagerEntity
editorManager =
SCR_EditorManagerEntity
.Cast(entity);
128
if
(!editorManager)
129
return
false
;
130
131
return
editorManager.IsOpened();
132
}
133
134
//------------------------------------------------------------------------------------------------
135
bool
IsLocalActiveEditor
()
136
{
137
SCR_EditorManagerCore
core =
SCR_EditorManagerCore
.Cast(
SCR_EditorManagerCore
.GetInstance(
SCR_EditorManagerCore
));
138
if
(!core)
139
return
false
;
140
141
SCR_EditorManagerEntity
editorManager = core.
GetEditorManager
();
142
if
(!editorManager)
143
return
false
;
144
145
return
editorManager.IsOpened();
146
}
147
};
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
SCR_EditorManagerEntity
void SCR_EditorManagerEntity(IEntitySource src, IEntity parent)
Definition
SCR_EditorManagerEntity.c:2211
ScriptInvokerInt
ScriptInvokerBase< ScriptInvokerIntMethod > ScriptInvokerInt
Definition
SCR_ScriptInvokerHelper.c:24
m_VONDisplay
SCR_VonDisplay m_VONDisplay
Definition
SCR_VONController.c:62
GetDisplay
SCR_VonDisplay GetDisplay()
Definition
SCR_VONController.c:99
TRANSMISSION_TIMEOUT_MS
SCR_VoNComponentClass TRANSMISSION_TIMEOUT_MS
IsLocalActiveEditor
bool IsLocalActiveEditor()
Definition
SCR_VoNComponent.c:135
IsTransmitingRadio
bool IsTransmitingRadio()
Definition
SCR_VoNComponent.c:56
IsTransmiting
bool IsTransmiting()
Definition
SCR_VoNComponent.c:48
BaseTransceiver
Definition
BaseTransceiver.c:13
IEntity
Definition
IEntity.c:13
SCR_EditorManagerCore
Core component to manage SCR_EditorManagerEntity.
Definition
SCR_EditorManagerCore.c:6
SCR_EditorManagerCore::GetEditorManager
SCR_EditorManagerEntity GetEditorManager()
Definition
SCR_EditorManagerCore.c:229
SCR_VoNComponentClass
Definition
SCR_VoNComponent.c:3
VoNComponentClass
Definition
VoNComponent.c:13
vector
Definition
vector.c:13
OnReceive
void OnReceive(int playerId, bool isSenderEditor, BaseTransceiver receiver, int frequency, float quality)
VONComponent event.
Definition
SCR_VonDisplay.c:181
GetEditorWorldLocation
vector GetEditorWorldLocation(int playerId)
Definition
SCR_VoNComponent.c:106
OnCapture
void OnCapture(BaseTransceiver transmitter)
VONComponent event.
Definition
SCR_VonDisplay.c:138
OnVoNUsed
void OnVoNUsed(int senderId)
Definition
SCR_VoNComponent.c:89
GetEditorEntity
IEntity GetEditorEntity(int playerId)
Definition
SCR_VoNComponent.c:96
IsEntityActiveEditor
bool IsEntityActiveEditor(IEntity entity)
Definition
SCR_VoNComponent.c:122
GetPlayerController
proto external PlayerController GetPlayerController()
Definition
SCR_PlayerDeployMenuHandlerComponent.c:307
ScriptInvoker
ScriptInvokerBase< func > ScriptInvoker
Definition
tools.c:134
scripts
GameCode
Network
SCR_VoNComponent.c
Generated by
1.17.0