5 class SCR_CampaignMilitaryBaseMapDescriptorComponent : SCR_MilitaryBaseMapDescriptorComponent
28 if (
m_Base.IsHQ() && faction != baseFaction)
30 item.SetVisible(
false);
35 item.SetVisible(
true);
36 item.SetDisplayName(
m_Base.GetBaseName());
44 rangeColor = Color.FromInt(baseFaction.GetFactionColor().PackToInt());
46 rangeColor = Color.FromInt(Color.WHITE);
48 props.SetOutlineColor(rangeColor);
50 props.SetBackgroundColor(rangeColor);
86 bool FindMapLink(MapDescriptorComponent owner, MapDescriptorComponent target)
117 props.SetLineWidth(
m_Base.GetLineWidth());
119 Color c = Color.FromInt(props.GetLineColor().PackToInt());
132 MapItem otherEnd = link.Target();
134 if (otherEnd ==
Item())
135 otherEnd = link.Owner();
137 IEntity otherEndOwner = otherEnd.Entity();
143 SCR_CampaignMobileAssemblyStandaloneComponent mobileHQ;
152 SCR_CampaignMobileAssemblyStandaloneComponent factionMHQ = faction.GetMobileAssembly();
154 if (factionMHQ && factionMHQ.GetOwner() == spawnpoint)
155 mobileHQ = factionMHQ;
162 if ((mobileHQ &&
m_Base.CanReachByRadio(mobileHQ)) || (otherBase &&
m_Base.CanReachByRadio(otherBase)))
163 c.SetA(linesData.GetHighlightedAlpha());
169 c.SetA(linesData.GetDefaultAlpha());
172 props.SetLineColor(c);
192 IEntity otherBaseOwner;
194 if (link.Owner().Entity() ==
m_Base.GetOwner())
195 otherBaseOwner = link.Target().Entity();
197 otherBaseOwner = link.Owner().Entity();
199 if (!otherBaseOwner || (unlinkHQ &&
SCR_SpawnPoint.Cast(otherBaseOwner) !=
null))
201 link.Target().UnLink(
Item());
202 Item().UnLink(link.Target());
209 if (otherBase && (!otherBase.CanReachByRadio(
m_Base) ||
m_Base.GetHQRadioCoverage(playerFaction) == SCR_ECampaignHQRadioComms.NONE))
211 otherBase.GetMapDescriptor().UnregisterMapLink(link);
213 Item().UnLink(otherBase.GetMapDescriptor().Item());
214 otherBase.GetMapDescriptor().Item().UnLink(
Item());
235 if (!localPlayerFaction)
238 SCR_CampaignMobileAssemblyStandaloneComponent mobileHQ = localPlayerFaction.GetMobileAssembly();
247 SCR_MapDescriptorComponent
desc = SCR_MapDescriptorComponent.Cast(spawnpoint.FindComponent(SCR_MapDescriptorComponent));
249 if (
desc && mobileHQ.IsInRadioRange())
251 array<SCR_CampaignMilitaryBaseComponent> basesInRangeOfMobileHQ = {};
252 mobileHQ.GetBasesInRange(basesInRangeOfMobileHQ);
254 if (basesInRangeOfMobileHQ.Contains(
m_Base))
255 mobilehqMapItem =
desc.Item();
262 if (!mobilehqMapItem)
264 if (!
m_Base.IsHQRadioTrafficPossible(localPlayerFaction) || localPlayerFaction != faction)
268 CreateLinks(faction, localPlayerFaction, mobilehqMapItem);
283 SCR_CampaignMobileAssemblyStandaloneComponent comp =
SCR_CampaignFaction.Cast(localPlayerFaction).GetMobileAssembly();
286 comp.AddMapLink(link);
289 array<SCR_CampaignMilitaryBaseComponent> bases = {};
292 for (
int i = bases.Count() - 1; i >= 0; i--)
294 if (bases[i].
IsHQ() && bases[i].
GetFaction() != localPlayerFaction)
300 if (myFaction != localPlayerFaction)
303 MapItem otherMapItem = bases[i].GetMapDescriptor().Item();
311 bases[i].GetMapDescriptor().RegisterMapLink(link);
322 if (!campaignGameMode)
325 if (!playerFactionCampaign)
328 if (!playerFactionCampaign)
329 playerFactionCampaign = campaignGameMode.GetBaseManager().GetLocalPlayerFaction();
331 if (!playerFactionCampaign)
334 if (
m_Base.IsHQ() &&
m_Base.GetFaction() != playerFactionCampaign)
339 m_Base.SetCallsign(playerFactionCampaign);
344 mapUI.SetIconInfoText();
347 EFactionMapID factionMapID = EFactionMapID.UNKNOWN;
348 bool isInRange =
m_Base.IsHQRadioTrafficPossible(playerFactionCampaign);
351 if (
m_Base.GetFaction() && (
m_Base.IsHQ() || isInRange))
353 switch (
m_Base.GetFaction().GetFactionKey())
355 case campaignGameMode.GetFactionKeyByEnum(
SCR_ECampaignFaction.OPFOR): {factionMapID = EFactionMapID.EAST;
break;};
356 case campaignGameMode.GetFactionKeyByEnum(
SCR_ECampaignFaction.BLUFOR): {factionMapID = EFactionMapID.WEST;
break;};
357 case campaignGameMode.GetFactionKeyByEnum(
SCR_ECampaignFaction.INDFOR): {factionMapID = EFactionMapID.FIA;
break;};
361 Item().SetFactionIndex(factionMapID);
363 array<SCR_ServicePointDelegateComponent> delegates = {};
364 m_Base.GetServiceDelegates(delegates);
366 foreach (SCR_ServicePointDelegateComponent delegate: delegates)
368 IEntity owner = delegate.GetOwner();
378 comp.SetServiceMarker(
m_Base.GetCampaignFaction());
380 comp.SetServiceMarker(visible:
false);
385 mapUI.UpdateBaseIcon(factionMapID);