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_AntennaServicePointComponent.c
Go to the documentation of this file.
1
class
SCR_AntennaServicePointComponentClass
:
SCR_ServicePointComponentClass
2
{
3
}
4
5
class
SCR_AntennaServicePointComponent : SCR_ServicePointComponent
6
{
7
protected
BaseRadioComponent
m_RadioControl
;
8
9
//------------------------------------------------------------------------------------------------
10
override
void
OnFactionChanged
(FactionAffiliationComponent owner,
Faction
previousFaction,
Faction
faction)
11
{
12
super.OnFactionChanged(faction);
13
14
SCR_Faction
newFaction =
SCR_Faction
.Cast(faction);
15
16
if
(!newFaction)
17
return
;
18
19
ChangeRadioSettings
(newFaction);
20
}
21
22
//------------------------------------------------------------------------------------------------
25
void
ChangeRadioSettings
(notnull
SCR_Faction
faction)
26
{
27
if
(!
m_RadioControl
||
m_RadioControl
.TransceiversCount() == 0)
28
return
;
29
30
BaseTransceiver
tsv =
m_RadioControl
.GetTransceiver(0);
31
if
(!tsv)
32
return
;
33
34
m_RadioControl
.SetEncryptionKey(faction.GetFactionRadioEncryptionKey());
35
36
int
factionFrequency = faction.GetFactionRadioFrequency();
37
38
// Setting frequency outside of limits causes a VME
39
if
(factionFrequency < tsv.GetMinFrequency() || factionFrequency > tsv.GetMaxFrequency())
40
return
;
41
42
tsv.SetFrequency(factionFrequency);
43
}
44
45
//------------------------------------------------------------------------------------------------
46
override
void
OnPostInit
(
IEntity
owner)
47
{
48
super.OnPostInit(owner);
49
50
m_RadioControl
= BaseRadioComponent.Cast(owner.
FindComponent
(BaseRadioComponent));
51
m_RadioControl
.SetPower(
true
);
52
53
if
(!
m_RadioControl
)
54
Print
(
"SCR_AntennaServicePointComponent: Owner is missing BaseRadioComponent!"
,
LogLevel
.ERROR);
55
}
56
}
m_RadioControl
SCR_AntennaServicePointComponentClass m_RadioControl
ChangeRadioSettings
void ChangeRadioSettings(notnull SCR_Faction faction)
Definition
SCR_CampaignMilitaryBaseComponent.c:1631
OnFactionChanged
void OnFactionChanged()
Definition
SCR_CampaignMobileAssemblyStandaloneComponent.c:225
BaseTransceiver
Definition
BaseTransceiver.c:13
Faction
Definition
Faction.c:13
IEntity
Definition
IEntity.c:13
IEntity::FindComponent
proto external Managed FindComponent(typename typeName)
SCR_AntennaServicePointComponentClass
Definition
SCR_AntennaServicePointComponent.c:2
SCR_Faction
Definition
SCR_Faction.c:6
SCR_ServicePointComponentClass
Definition
SCR_ServicePointComponent.c:2
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
OnPostInit
@ OnPostInit
Definition
SndComponentCallbacks.c:15
scripts
Game
GameMode
Components
SCR_AntennaServicePointComponent.c
Generated by
1.17.0