8 [
Attribute(
"{E48F14D6D3C54BE5}UI/layouts/Campaign/BaseElement.layout",
params:
"layout")]
11 [
Attribute(
"{94F1E2223D7E0588}UI/layouts/Campaign/ServiceHint.layout",
params:
"layout")]
14 [
Attribute(
"{FD71287E68006A26}UI/layouts/Campaign/CampaignPlayerMapIndicator.layout",
params:
"layout")]
33 FactionManager fm =
GetGame().GetFactionManager();
42 if (faction != playerFaction)
45 SCR_CampaignMobileAssemblyStandaloneComponent assembly = faction.
GetMobileAssembly();
59 handler.SetParent(
this);
71 array<SCR_MilitaryBaseComponent> bases = {};
80 for (
int i = 0, count = bases.Count(); i < count; ++i)
88 if (
base.GetFaction() != faction && (
base.IsHQ() || (
base.GetBuiltByPlayers() && !
base.IsHQRadioTrafficPossible(faction))))
97 handler.SetParent(
this);
100 base.SetBaseUI(handler);
101 base.UpdateCaptureUI();
109 string factionKey = faction.GetFactionKey();
127 SCR_CampaignMilitaryBaseTaskEntity
task = SCR_CampaignMilitaryBaseTaskEntity.Cast(taskComponent.
GetTask());
146 super.UpdateIconPosition(widget, icon, x, y);
165 SCR_CampaignMobileAssemblyStandaloneComponent westMHQ = gameMode.GetFactionByEnum(
SCR_ECampaignFaction.BLUFOR).GetMobileAssembly();
166 SCR_CampaignMobileAssemblyStandaloneComponent eastMHQ = gameMode.GetFactionByEnum(
SCR_ECampaignFaction.OPFOR).GetMobileAssembly();
168 if ((westMHQ && westMHQ.GetOwner() == spawnPoint) || (eastMHQ && eastMHQ.GetOwner() == spawnPoint))
171 super.ShowSpawnPoint(spawnPoint);
185 handler.
Init(spawnPoint);
186 handler.SetParent(
this);
196 SCR_CampaignFeedbackComponent comp = SCR_CampaignFeedbackComponent.GetInstance();
201 if (!comp.CanShowPlayerSpawn())
204 comp.SetMapCampaignUI(
this);
206 vector playerLocation = comp.GetPlayerSpawnPos();
212 if (!highlightHandler)
215 m_mIcons.Insert(indicator, highlightHandler);
217 highlightHandler.SetParent(
this);
218 highlightHandler.
SetPos(playerLocation);
220 FrameSlot.SetPosX(indicator, playerLocation[0]);
221 FrameSlot.SetPosY(indicator, playerLocation[1]);
222 FrameSlot.SetSizeToContent(indicator,
true);
223 FrameSlot.SetAlignment(indicator, 0.5, 0.5);
226 if (!comp.WasMapOpened())
228 m_MapEntity.ZoomPanSmooth(1.5,playerLocation[0],playerLocation[2]);
229 comp.SetMapOpened(
true);
234 const ResourceName imageSet =
"{5E8F77F38C2B9B9F}UI/Imagesets/MilitarySymbol/ICO.imageset";
238 image.LoadImageFromSet(0, imageSet,
"PlayerSpawnHint");
247 string hours = timeContainer.m_iHours.ToString();
248 string minutes = timeContainer.m_iMinutes.ToString();
250 if (timeContainer.m_iHours < 10)
253 if (timeContainer.m_iMinutes < 10)
254 minutes =
"0" + minutes;
256 timeWidget.SetTextFormat(
"%1:%2",hours, minutes);
273 w.RemoveFromHierarchy();
301 int GetBases(out notnull array<SCR_CampaignMapUIBase> bases)
374 super.OnMapOpen(config);
380 FrameSlot.SetSizeToContent(serviceHint,
true);
381 serviceHint.SetName(
"ServiceHintRoot");
382 serviceHint.SetVisible(
false);
385 SCR_CampaignFeedbackComponent comp = SCR_CampaignFeedbackComponent.GetInstance();
388 comp.SetMapCampaignUI(
this);
400 super.OnMapClose(config);
409 w.RemoveFromHierarchy();
ArmaReforgerScripted GetGame()
void SCR_FactionManager(IEntitySource src, IEntity parent)
void SCR_GameModeCampaign(IEntitySource src, IEntity parent)
ScriptInvokerBase< BaseHovered > BaseHoveredInvoker
ScriptInvokerBase< ScriptInvokerVoidMethod > ScriptInvokerVoid
void TimeContainer(int hours=0, int minutes=0, int seconds=0)
proto external IEntity GetParent()
SCR_CampaignMobileAssemblyStandaloneComponent GetMobileAssembly()
void InitMobile(SCR_CampaignMobileAssemblyStandaloneComponent assembly)
void InitBase(SCR_CampaignMilitaryBaseComponent base)
override void OnMapClose(MapConfiguration config)
ref ScriptInvokerVoid m_OnBasesInited
void ~SCR_MapCampaignUI()
ref BaseHoveredInvoker m_OnBaseHovered
void CreatePlayerSpawnPositionHint()
override void UpdateIconPosition(Widget widget, SCR_MapUIElement icon, float x, float y)
Offset task icon so it doesn't overlap with base icon.
BaseHoveredInvoker GetOnBaseHovered()
void SetHoveredBase(SCR_CampaignMilitaryBaseComponent base)
int GetBases(out notnull array< SCR_CampaignMapUIBase > bases)
Get all bases elements.
ScriptInvokerVoid GetOnBasesInited()
ResourceName m_sServiceHint
override void OnSpawnPointFactionChange(SCR_SpawnPoint spawnPoint)
ResourceName m_sSpawnPositionHint
void InitMobileAssembly(string factionKey, bool deployed)
void HideSpawnPositionHint(int layer)
override void ShowSpawnPoint(notnull SCR_SpawnPoint spawnPoint)
static const int TASK_ICON_Y_OFFSET
void OnMapZoom(float pixelPerUnit)
override void OnMapOpen(MapConfiguration config)
ResourceName m_sBaseElement
void RemoveSpawnPositionHint()
Called to hide Spawn Position hint if player is killed (or his entity disappear for some reason).
SCR_CampaignMilitaryBaseComponent m_HoveredBase
Widget GetMapMenuRoot()
Get map menu root widget.
static ScriptInvokerBase< ScriptInvokerFloat2Bool > GetOnMapPan()
Get on map pan invoker.
static ScriptInvokerFloat GetOnMapZoom()
Get on map zoom invoker.
static SCR_MapEntity GetMapInstance()
Get map entity instance.
SCR_MapEntity m_MapEntity
SCR_PlayerFactionAffiliationComponent m_PlyFactionAffilComp
void OnMapPan(float panX, float panY, bool adjustedPan)
ref map< Widget, SCR_MapUIElement > m_mIcons
ResourceName m_sSpawnPointElement
void RemoveSpawnPoint(SCR_SpawnPoint spawnPoint)
void AddSpawnPoint(SCR_SpawnPoint spawnPoint)
void Init(notnull SCR_SpawnPoint spawnPoint)
int GetBases(notnull out array< SCR_MilitaryBaseComponent > bases)
static SCR_MilitaryBaseSystem GetInstance()
Spawn point entity defines positions on which players can possibly spawn.
SCR_FieldOfViewSettings Attribute