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_RadioBaseUserAction.c
Go to the documentation of this file.
1
class
SCR_RadioBaseUserAction
:
SCR_ScriptedUserAction
2
{
3
[
Attribute
(
desc
:
"Frequency that should be tuned at the radio to allow communication. For an exampel with HQ. If wrong one is tuned at the radio, the user action will not be visible."
)]
4
int
m_iTargetFrequency;
5
6
protected
BaseRadioComponent
m_BaseRadioComponent
;
7
protected
ref array<BaseTransceiver>
m_aTsvList
= {};
8
9
//------------------------------------------------------------------------------------------------
10
protected
override
void
Init
(
IEntity
pOwnerEntity,
GenericComponent
pManagerComponent)
11
{
12
m_BaseRadioComponent
= BaseRadioComponent.Cast(pOwnerEntity.
FindComponent
(BaseRadioComponent));
13
if
(!
m_BaseRadioComponent
)
14
return
;
15
16
int
count =
m_BaseRadioComponent
.TransceiversCount();
17
18
for
(
int
i = 0; i < count; i++)
19
{
20
m_aTsvList
.Insert(
m_BaseRadioComponent
.GetTransceiver(i));
21
}
22
}
23
24
//------------------------------------------------------------------------------------------------
25
// The user action is shown when radio is turned on, the correct frequency is set and custom condition is true.
26
override
bool
CanBeShownScript
(
IEntity
user)
27
{
28
if
(!
m_BaseRadioComponent
||
m_aTsvList
.IsEmpty())
29
return
false
;
30
31
if
(!
m_BaseRadioComponent
.IsPowered())
32
return
false
;
33
34
bool
frequencyMatch;
35
foreach
(
BaseTransceiver
tsv :
m_aTsvList
)
36
{
37
if
(tsv.GetFrequency() == m_iTargetFrequency)
38
{
39
frequencyMatch =
true
;
40
break
;
41
}
42
}
43
44
if
(!frequencyMatch)
45
return
false
;
46
47
return
CustomRadioCondition
();
48
}
49
50
//------------------------------------------------------------------------------------------------
51
// To be overridden in inherited classes. Allow set a custom condition when the action could be shown.
52
protected
bool
CustomRadioCondition
()
53
{
54
return
true
;
55
}
56
}
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition
SCR_RespawnBriefingComponent.c:17
BaseTransceiver
Definition
BaseTransceiver.c:13
GenericComponent
Definition
GenericComponent.c:13
IEntity
Definition
IEntity.c:13
IEntity::FindComponent
proto external Managed FindComponent(typename typeName)
SCR_RadioBaseUserAction
Definition
SCR_RadioBaseUserAction.c:2
SCR_RadioBaseUserAction::Init
override void Init(IEntity pOwnerEntity, GenericComponent pManagerComponent)
Definition
SCR_RadioBaseUserAction.c:10
SCR_RadioBaseUserAction::CustomRadioCondition
bool CustomRadioCondition()
Definition
SCR_RadioBaseUserAction.c:52
SCR_RadioBaseUserAction::m_BaseRadioComponent
BaseRadioComponent m_BaseRadioComponent
Definition
SCR_RadioBaseUserAction.c:6
SCR_RadioBaseUserAction::m_aTsvList
ref array< BaseTransceiver > m_aTsvList
Definition
SCR_RadioBaseUserAction.c:7
SCR_RadioBaseUserAction::CanBeShownScript
override bool CanBeShownScript(IEntity user)
Definition
SCR_RadioBaseUserAction.c:26
SCR_ScriptedUserAction
A scripted action class having optional logic to check if vehicle is valid.
Definition
SCR_ScriptedUserAction.c:6
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
scripts
Game
UserActions
SCR_RadioBaseUserAction.c
Generated by
1.17.0