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_CampaignMilitaryBaseMapDescriptorComponent.c
Go to the documentation of this file.
1
class
SCR_CampaignMilitaryBaseMapDescriptorComponentClass
:
SCR_MilitaryBaseMapDescriptorComponentClass
2
{
3
}
4
5
class
SCR_CampaignMilitaryBaseMapDescriptorComponent : SCR_MilitaryBaseMapDescriptorComponent
6
{
7
SCR_CampaignMilitaryBaseComponent
m_CampaignBase
;
8
9
//------------------------------------------------------------------------------------------------
11
void
SetParentBase
(notnull
SCR_CampaignMilitaryBaseComponent
base
)
12
{
13
m_CampaignBase
=
base
;
14
}
15
16
//------------------------------------------------------------------------------------------------
19
void
MapSetup
(notnull
Faction
faction)
20
{
21
MapItem
item = Item();
22
Faction
baseFaction =
m_CampaignBase
.GetFaction();
23
24
if
(faction != baseFaction && (
m_CampaignBase
.IsHQ() || (
m_CampaignBase
.GetBuiltByPlayers() && !
m_CampaignBase
.IsHQRadioTrafficPossible(
SCR_CampaignFaction
.Cast(faction)))))
25
{
26
item.SetVisible(
false
);
27
return
;
28
}
29
else
30
{
31
item.SetVisible(
true
);
32
item.SetDisplayName(
m_CampaignBase
.GetBaseName());
33
34
MapDescriptorProps
props = item.GetProps();
35
props.SetDetail(96);
36
37
Color
rangeColor;
38
39
if
(baseFaction)
40
rangeColor =
Color
.FromInt(baseFaction.GetFactionColor().PackToInt());
41
else
42
rangeColor =
Color
.FromInt(
Color
.WHITE);
43
44
props.SetOutlineColor(rangeColor);
45
rangeColor.SetA(0.1);
46
props.SetBackgroundColor(rangeColor);
47
48
item.SetProps(props);
49
item.SetRange(0);
50
}
51
}
52
53
//------------------------------------------------------------------------------------------------
56
void
HandleMapInfo
(
SCR_CampaignFaction
playerFactionCampaign = null)
57
{
58
SCR_GameModeCampaign
campaignGameMode =
SCR_GameModeCampaign
.GetInstance();
59
if
(!campaignGameMode)
60
return
;
61
62
if
(!playerFactionCampaign)
63
playerFactionCampaign =
SCR_CampaignFaction
.Cast(
SCR_FactionManager
.SGetLocalPlayerFaction());
64
65
if
(!playerFactionCampaign)
66
playerFactionCampaign = campaignGameMode.GetBaseManager().GetLocalPlayerFaction();
67
68
if
(!playerFactionCampaign)
69
return
;
70
71
// Don't display enemy HQs and undiscovered bases
72
if
(
m_CampaignBase
.GetFaction() != playerFactionCampaign && (
m_CampaignBase
.IsHQ() || (
m_CampaignBase
.GetBuiltByPlayers() && !
m_CampaignBase
.IsHQRadioTrafficPossible(playerFactionCampaign))))
73
{
74
if
(
m_CampaignBase
.GetBuiltByPlayers())
75
UpdateServices
(
false
);
76
77
return
;
78
}
79
80
// Set callsign based on player's faction
81
if
(
m_CampaignBase
.GetCallsignDisplayName().IsEmpty())
82
m_CampaignBase
.SetCallsign(playerFactionCampaign);
83
84
SCR_CampaignMapUIBase
mapUI =
m_CampaignBase
.GetMapUI();
85
if
(mapUI)
86
mapUI.
SetIconInfoText
();
87
88
// Update base icon color
89
// Show proper faction color only for HQs or bases within radio signal
90
EFactionMapID factionMapID = EFactionMapID.UNKNOWN;
91
const
bool
isInRange =
m_CampaignBase
.IsHQRadioTrafficPossible(playerFactionCampaign);
92
if
(
m_CampaignBase
.GetFaction() && (
m_CampaignBase
.IsHQ() || isInRange))
93
{
94
switch
(
m_CampaignBase
.GetFaction().GetFactionKey())
95
{
96
case
campaignGameMode.GetFactionKeyByEnum(
SCR_ECampaignFaction
.OPFOR): {factionMapID = EFactionMapID.EAST;
break
;};
97
case
campaignGameMode.GetFactionKeyByEnum(
SCR_ECampaignFaction
.BLUFOR): {factionMapID = EFactionMapID.WEST;
break
;};
98
case
campaignGameMode.GetFactionKeyByEnum(
SCR_ECampaignFaction
.INDFOR): {factionMapID = EFactionMapID.FIA;
break
;};
99
}
100
}
101
102
Item().SetFactionIndex(factionMapID);
103
104
UpdateServices
(isInRange);
105
106
if
(mapUI)
107
mapUI.
UpdateBaseIcon
(factionMapID);
108
}
109
110
//------------------------------------------------------------------------------------------------
113
protected
void
UpdateServices
(
bool
isInRange)
114
{
115
array<SCR_ServicePointDelegateComponent> delegates = {};
116
m_CampaignBase
.GetServiceDelegates(delegates);
117
118
SCR_ServicePointMapDescriptorComponent
comp;
119
IEntity
owner;
120
121
foreach
(SCR_ServicePointDelegateComponent delegate: delegates)
122
{
123
owner = delegate.GetOwner();
124
if
(!owner)
125
continue
;
126
127
comp =
SCR_ServicePointMapDescriptorComponent
.Cast(owner.
FindComponent
(
SCR_ServicePointMapDescriptorComponent
));
128
if
(!comp)
129
continue
;
130
131
if
(isInRange)
132
comp.SetServiceMarker(
m_CampaignBase
.GetCampaignFaction());
133
else
134
comp.SetServiceMarker(visible:
false
);
135
}
136
}
137
}
SCR_ECampaignFaction
SCR_ECampaignFaction
Definition
SCR_CampaignFactionManager.c:134
UpdateServices
void UpdateServices(bool isInRange)
Definition
SCR_CampaignMilitaryBaseMapDescriptorComponent.c:113
MapSetup
void MapSetup(notnull Faction faction)
Definition
SCR_CampaignMilitaryBaseMapDescriptorComponent.c:19
m_CampaignBase
SCR_CampaignMilitaryBaseMapDescriptorComponentClass m_CampaignBase
HandleMapInfo
void HandleMapInfo(SCR_CampaignFaction playerFactionCampaign=null)
Definition
SCR_CampaignMilitaryBaseMapDescriptorComponent.c:56
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
SCR_ServicePointMapDescriptorComponent
void SCR_ServicePointMapDescriptorComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
Definition
SCR_ServicePointMapDescriptorComponent.c:198
SetParentBase
void SetParentBase(SCR_MilitaryBaseComponent base, bool duringInit=false)
Definition
SCR_ServicePointMapDescriptorComponent.c:31
Color
Definition
Color.c:13
Faction
Definition
Faction.c:13
IEntity
Definition
IEntity.c:13
IEntity::FindComponent
proto external Managed FindComponent(typename typeName)
MapDescriptorProps
Definition
MapDescriptorProps.c:13
MapItem
Definition
MapItem.c:13
SCR_CampaignFaction
Definition
SCR_CampaignFaction.c:2
SCR_CampaignMapUIBase
Definition
SCR_CampaignMapUIBase.c:3
SCR_CampaignMapUIBase::SetIconInfoText
void SetIconInfoText()
Definition
SCR_CampaignMapUIBase.c:680
SCR_CampaignMapUIBase::UpdateBaseIcon
void UpdateBaseIcon(int id)
Definition
SCR_CampaignMapUIBase.c:845
SCR_CampaignMilitaryBaseComponent
Definition
SCR_CampaignMilitaryBaseComponent.c:38
SCR_CampaignMilitaryBaseMapDescriptorComponentClass
Definition
SCR_CampaignMilitaryBaseMapDescriptorComponent.c:2
SCR_MilitaryBaseMapDescriptorComponentClass
Definition
SCR_MilitaryBaseMapDescriptorComponent.c:2
scripts
Game
Components
Locations
SCR_CampaignMilitaryBaseMapDescriptorComponent.c
Generated by
1.17.0