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_LocationMusic.c
Go to the documentation of this file.
1
class
SCR_LocationMusic
:
LocationMusic
2
{
3
protected
bool
m_bPlayerIsInHQ
=
false
;
4
5
6
override
void
Init
()
7
{
8
SCR_GameModeCampaign
campaign =
SCR_GameModeCampaign
.GetInstance();
9
10
if
(!campaign)
11
return
;
12
13
SCR_CampaignMilitaryBaseManager
baseManager = campaign.GetBaseManager();
14
15
if
(!baseManager)
16
return
;
17
18
baseManager.
GetOnLocalPlayerEnteredBase
().Insert(
PlayerEnteredHQ
);
19
baseManager.
GetOnLocalPlayerLeftBase
().Insert(
PlayerLeftHQ
);
20
}
21
22
override
void
OnDelete
()
23
{
24
SCR_GameModeCampaign
campaign =
SCR_GameModeCampaign
.GetInstance();
25
26
if
(!campaign)
27
return
;
28
29
SCR_CampaignMilitaryBaseManager
baseManager = campaign.GetBaseManager();
30
31
if
(!baseManager)
32
return
;
33
34
baseManager.
GetOnLocalPlayerEnteredBase
().Remove(
PlayerEnteredHQ
);
35
baseManager.
GetOnLocalPlayerLeftBase
().Remove(
PlayerLeftHQ
);
36
}
37
38
//~ Player entered their faction HQ
39
protected
void
PlayerEnteredHQ
(
SCR_CampaignMilitaryBaseComponent
base
)
40
{
41
if
(
m_bPlayerIsInHQ
)
42
return
;
43
44
SCR_GameModeCampaign
campaign =
SCR_GameModeCampaign
.GetInstance();
45
46
if
(!campaign)
47
return
;
48
49
SCR_FactionManager
factionManager =
SCR_FactionManager
.Cast(
GetGame
().GetFactionManager());
50
if
(!factionManager)
51
return
;
52
53
SCR_CampaignFaction
pFaction =
SCR_CampaignFaction
.Cast(factionManager.GetLocalPlayerFaction());
54
55
if
(!pFaction)
56
return
;
57
58
SCR_CampaignMilitaryBaseComponent
HQ = pFaction.
GetMainBase
();
59
60
//~ No HQ or the given base is not HQ then ignore
61
if
(!HQ ||
base
!= HQ)
62
return
;
63
64
m_bPlayerIsInHQ
=
true
;
65
}
66
67
//~ Player left their faction HQ
68
protected
void
PlayerLeftHQ
(
SCR_CampaignMilitaryBaseComponent
base
)
69
{
70
if
(!
m_bPlayerIsInHQ
)
71
return
;
72
73
SCR_GameModeCampaign
campaign =
SCR_GameModeCampaign
.GetInstance();
74
75
if
(!campaign)
76
return
;
77
78
SCR_FactionManager
factionManager =
SCR_FactionManager
.Cast(
GetGame
().GetFactionManager());
79
if
(!factionManager)
80
return
;
81
82
SCR_CampaignFaction
pFaction =
SCR_CampaignFaction
.Cast(factionManager.GetLocalPlayerFaction());
83
84
if
(!pFaction)
85
return
;
86
87
SCR_CampaignMilitaryBaseComponent
HQ = pFaction.
GetMainBase
();
88
89
//~ No HQ or the given base is not HQ then ignore
90
if
(!HQ ||
base
!= HQ)
91
return
;
92
93
m_bPlayerIsInHQ
=
false
;
94
}
95
96
override
bool
ShouldPlay
()
97
{
98
return
!
m_bPlayerIsInHQ
;
99
}
100
}
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
SCR_FactionManager
void SCR_FactionManager(IEntitySource src, IEntity parent)
Definition
SCR_FactionManager.c:498
SCR_GameModeCampaign
void SCR_GameModeCampaign(IEntitySource src, IEntity parent)
Definition
SCR_GameModeCampaign.c:1812
base
around base
Definition
SCR_HoldCampaignMilitaryBaseTaskEntity.c:9
LocationMusic
Definition
LocationMusic.c:13
SCR_CampaignFaction
Definition
SCR_CampaignFaction.c:2
SCR_CampaignFaction::GetMainBase
SCR_CampaignMilitaryBaseComponent GetMainBase()
Definition
SCR_CampaignFaction.c:215
SCR_CampaignMilitaryBaseComponent
Definition
SCR_CampaignMilitaryBaseComponent.c:38
SCR_CampaignMilitaryBaseManager
Created in SCR_GameModeCampaign.
Definition
SCR_CampaignMilitaryBaseManager.c:25
SCR_CampaignMilitaryBaseManager::GetOnLocalPlayerLeftBase
OnLocalPlayerLeftBaseInvoker GetOnLocalPlayerLeftBase()
Definition
SCR_CampaignMilitaryBaseManager.c:238
SCR_CampaignMilitaryBaseManager::GetOnLocalPlayerEnteredBase
OnLocalPlayerEnteredBaseInvoker GetOnLocalPlayerEnteredBase()
Definition
SCR_CampaignMilitaryBaseManager.c:229
SCR_LocationMusic
Definition
SCR_LocationMusic.c:2
SCR_LocationMusic::OnDelete
override void OnDelete()
Definition
SCR_LocationMusic.c:22
SCR_LocationMusic::Init
override void Init()
Definition
SCR_LocationMusic.c:6
SCR_LocationMusic::PlayerEnteredHQ
void PlayerEnteredHQ(SCR_CampaignMilitaryBaseComponent base)
Definition
SCR_LocationMusic.c:39
SCR_LocationMusic::PlayerLeftHQ
void PlayerLeftHQ(SCR_CampaignMilitaryBaseComponent base)
Definition
SCR_LocationMusic.c:68
SCR_LocationMusic::ShouldPlay
override bool ShouldPlay()
Definition
SCR_LocationMusic.c:96
SCR_LocationMusic::m_bPlayerIsInHQ
bool m_bPlayerIsInHQ
Definition
SCR_LocationMusic.c:3
scripts
Game
Music
SCR_LocationMusic.c
Generated by
1.17.0