Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_CampaignRadioRegisteringComponent.c
Go to the documentation of this file.
4
5class SCR_CampaignRadioRegisteringComponent : SCR_MilitaryBaseLogicComponent
6{
7 protected static const string RADIO_CHATTER_SIGNAL_NAME = "RadioChatter";
8 protected static const string ESTABLISH_ACTION_SIGNAL_NAME = "EstablishAction";
9
10 //------------------------------------------------------------------------------------------------
12 {
13 super.OnCapturingFactionChanged(faction);
14
15 // SFX not needed for headless
16 if (System.IsConsoleApp())
17 return;
18
19 // Play or stop radio tuning SFX
21
22 if (!comp)
23 return;
24
25 if (faction.IsEmpty())
26 comp.SetSignalValue(comp.AddOrFindSignal(ESTABLISH_ACTION_SIGNAL_NAME), 0);
27 else
28 comp.SetSignalValue(comp.AddOrFindSignal(ESTABLISH_ACTION_SIGNAL_NAME), 1);
29 }
30
31 //------------------------------------------------------------------------------------------------
33 override void OnBaseFactionChanged(Faction faction)
34 {
35 super.OnBaseFactionChanged(faction);
36
37 SetRadioChatterSignal(faction);
38 }
39
40 //------------------------------------------------------------------------------------------------
42 override void OnBaseRegistered(notnull SCR_MilitaryBaseComponent base)
43 {
44 super.OnBaseRegistered(base);
45
47
48 if (!campaignBase)
49 return;
50
51 SetRadioChatterSignal(base.GetFaction());
52 }
53
54 //------------------------------------------------------------------------------------------------
57 {
58 // SFX not needed for headless
59 if (System.IsConsoleApp())
60 return;
61
62 SCR_GameModeCampaign campaign = SCR_GameModeCampaign.GetInstance();
63
64 if (!campaign)
65 return;
66
68
69 if (!comp)
70 return;
71
72 if (!faction || faction.GetFactionKey() == campaign.GetFactionKeyByEnum(SCR_ECampaignFaction.INDFOR))
73 {
74 comp.SetSignalValue(comp.AddOrFindSignal(RADIO_CHATTER_SIGNAL_NAME), 0);
75 }
76 else
77 {
78 if (faction.GetFactionKey() == campaign.GetFactionKeyByEnum(SCR_ECampaignFaction.BLUFOR))
79 comp.SetSignalValue(comp.AddOrFindSignal(RADIO_CHATTER_SIGNAL_NAME), 1);
80 else
81 comp.SetSignalValue(comp.AddOrFindSignal(RADIO_CHATTER_SIGNAL_NAME), 2);
82 }
83 }
84}
void OnBaseFactionChanged(notnull SCR_MilitaryBaseComponent base, Faction faction)
override void OnCapturingFactionChanged()
Event which is triggered when the capturing faction changes.
SCR_CampaignRadioRegisteringComponentClass RADIO_CHATTER_SIGNAL_NAME
void SetRadioChatterSignal(Faction faction)
override void OnBaseRegistered(notnull SCR_MilitaryBaseComponent base)
void SCR_GameModeCampaign(IEntitySource src, IEntity parent)
IEntity GetOwner()
Owner entity of the fuel tank.