4 [
Attribute(
"{14E86B20D0ED993F}UI/layouts/Campaign/ServiceContainer.layout")]
7 [
Attribute(
"{94F1E2223D7E0588}UI/layouts/Campaign/ServiceHint.layout")]
10 [
Attribute(
"{CA8B528037B6831A}UI/Textures/InventoryIcons/Supplies_icon_UI.edds")]
16 [
Attribute(
"60",
params:
"0 inf 1",
desc:
"How many seconds between updates of next shipment text. If set to 0, the text will not be updated at all.")]
195 if (!changeToDefault)
222 SCR_DeployMenuMain deployMenu = SCR_DeployMenuMain.GetDeployMenu();
223 if (tm && deployMenu && !tm.
IsTaskListOpen() && deployMenu.GetAllowMapContext())
225 GetGame().GetWorkspace().SetFocusedWidget(w);
231 super.OnMouseEnter(w, x, y);
240 m_Base.GetMapDescriptor().OnIconHovered(
true);
244 if (
m_wServices && isSupportedBaseType && isInRadioRange)
252 SetNextShipmentTextVisible(isSupportedBaseType && isInRadioRange && isLocalPlayerFactionOwned && shouldDisplayShipmentInterval);
256 SCR_RadioCoverageMapDescriptorComponent mapDesc = SCR_RadioCoverageMapDescriptorComponent.Cast(
m_MobileAssembly.GetOwner().FindComponent(SCR_RadioCoverageMapDescriptorComponent));
259 mapDesc.OnIconHovered(
true);
289 super.OnMouseLeave(w, enterW, x, y);
303 m_Base.GetMapDescriptor().OnIconHovered(
false);
307 SCR_RadioCoverageMapDescriptorComponent mapDesc = SCR_RadioCoverageMapDescriptorComponent.Cast(
m_MobileAssembly.GetOwner().FindComponent(SCR_RadioCoverageMapDescriptorComponent));
310 mapDesc.OnIconHovered(
false);
427 void ShowServiceHint(
string name,
string text,
bool show,
int suppliesAmount = -1,
int suppliesMax = -1)
434 mx =
GetGame().GetWorkspace().DPIUnscale(mx);
435 my =
GetGame().GetWorkspace().DPIUnscale(my);
449 resupplyText.SetVisible(
false);
451 if (suppliesAmount > -1 && suppliesMax > -1)
455 serviceText.SetTextFormat(text, suppliesAmount, suppliesMax);
458 resupplyText.SetVisible(suppliesAmount < suppliesMax);
464 serviceText.SetTextFormat(text);
474 super.HandlerAttached(w);
514 SCR_CampaignMobileAssemblyStandaloneComponent.s_OnUpdateRespawnCooldown.Insert(
SetIconInfoText);
515 SCR_CampaignMobileAssemblyStandaloneComponent.s_OnSpawnPointOwnerChanged.Insert(
UpdateAssemblyIcon);
556 SCR_CampaignMobileAssemblyStandaloneComponent.s_OnUpdateRespawnCooldown.Remove(
SetIconInfoText);
557 SCR_CampaignMobileAssemblyStandaloneComponent.s_OnSpawnPointOwnerChanged.Remove(
UpdateAssemblyIcon);
621 IEntity parent = sp.GetParent();
703 float respawnCooldown =
Math.Ceil(
m_Base.GetRespawnTimestamp().DiffMilliseconds(world.GetServerTimestamp()) * 0.001);
704 string shownRespawnCooldown;
716 if (respawnCooldown > 0 && baseFaction && baseFaction == playerFaction &&
m_Base.GetHQRadioCoverage(baseFaction) == SCR_ERadioCoverageStatus.BOTH_WAYS)
718 shownRespawnCooldown =
"#AR-Campaign_MobileAssemblyCooldown";
720 sStr =
string.ToString(s);
727 respawnImg.SetVisible(
false);
736 if (isSupportedBaseType)
738 supplies.SetVisible(
true);
739 suppliesImg.SetVisible(
true);
741 if (baseFaction && baseFaction == playerFaction)
743 suppliesString =
"#AR-Campaign_BaseSuppliesAmount";
744 suppliesInfo =
m_Base.GetSupplies().ToString();
745 income =
m_Base.GetSuppliesIncome();
747 if (!
m_Base.IsHQ() && !shownRespawnCooldown.IsEmpty())
749 respawn.SetVisible(
true);
750 respawnImg.SetVisible(
true);
755 suppliesString =
"#AR-Campaign_BaseSuppliesUnknown";
761 if (!imageset.IsEmpty())
763 respawnImg.LoadImageFromSet(0, imageset,
"RespawnBig");
764 suppliesImg.LoadImageFromSet(0, imageset,
"SuppliesBig");
768 supplies.SetTextFormat(suppliesString +
" (+%3)", suppliesInfo,
m_Base.GetSuppliesMax(), income);
770 supplies.SetTextFormat(suppliesString, suppliesInfo,
m_Base.GetSuppliesMax());
772 respawn.SetTextFormat(shownRespawnCooldown, m, sStr);
790 for (
int serviceId = 0; serviceId < 8; ++serviceId)
792 string btnName =
"Service" + serviceId.ToString();
793 Widget serviceBtn = w.FindAnyWidget(btnName);
795 if (serviceId >= cnt)
797 serviceBtn.SetVisible(
false);
819 f =
m_Base.GetCampaignFaction();
904 else if (
m_Base.IsControlPoint())
910 else if (SCR_CampaignSourceBaseComponent.Cast(
m_Base))
921 if (img !=
string.Empty)
944 SCR_CampaignMilitaryBaseMapDescriptorComponent descr =
m_Base.GetMapDescriptor();
951 props.SetIconVisible(
false);
952 props.SetTextVisible(
false);
953 props.Activate(
true);
956 if (!m_wSuppliesText)
985 void InitMobile(SCR_CampaignMobileAssemblyStandaloneComponent assembly)
1003 SCR_MapDescriptorComponent descr = SCR_MapDescriptorComponent.Cast(spawnpoint.FindComponent(SCR_MapDescriptorComponent));
1008 props.SetIconVisible(
false);
1009 props.SetTextVisible(
false);
1010 props.Activate(
true);
1043 m_Base.GetMapDescriptor().OnIconHovered(
false);
1059 callsign =
m_Base.GetCallsignDisplayNameOnlyUC();
1078 spawnPoint =
m_Base.GetSpawnPoint();
1085 bool enoughSupplies =
true;
1092 PlayerController pc =
GetGame().GetPlayerController();
1106 float loadoutCost = SCR_ArsenalManagerComponent.GetLoadoutCalculatedSupplyCost(
loadout,
true, -1,
m_PlayerFaction, spawnPoint);
1107 enoughSupplies = (
m_Base.GetSupplies() >= loadoutCost);
1120 curLayer = mapEnt.GetLayerIndex();
1138 array<SCR_ServicePointComponent> available = {};
1139 array<SCR_ServicePointDelegateComponent> built = {};
1140 array<int> allServices = {};
1145 base.GetServiceDelegates(built);
1152 foreach (SCR_ServicePointDelegateComponent delegate : built)
1162 const int m_iServicesLimit = 8;
1163 int m_iServicesCount = 1;
1165 array<SCR_EServicePointType> checkedTypes =
1183 if (m_iServicesCount > m_iServicesLimit)
1223 return m_Base.GetOwner().GetOrigin();
1301 color = faction.GetFactionColor();
1329 image.Split(
"_", strs,
true);
1342 switch (strs.Get(0))
1347 selection =
"Neutral_Select";
1348 highlight =
"Neutral_Installation_Focus_Land";
1357 selection =
"Hostile_Select";
1358 highlight =
"Hostile_Installation_Focus_Land";
1366 selection =
"Friend_Select";
1367 highlight =
"Friend_Installation_Focus_Land";
1368 image.Replace(
"US",
"USSR");
1376 selection =
"Unknown_Select";
1377 highlight =
"Unknown_Installation_Focus_Land";
1385 switch (strs.Get(1))
1407 spawnPoint =
m_Base.GetSpawnPoint();
1408 highlight.Split(
"_", highlightSplit,
true);
1409 if (highlightSplit.Count() >= 2)
1410 highlight =
string.Format(
"%1_%2", highlightSplit.Get(0), highlightSplit.Get(1));
1418 spawnPoint =
m_Base.GetSpawnPoint();
1419 if (strs.Get(0) !=
"Unknown")
1430 if (strs.Get(2) ==
"Small")
1452 if (strs.Get(1) ==
"Mobile")
1466 return RplId.Invalid();
1519 SCR_AIGroup playerGroup = groupsManager.GetPlayerGroup(playerId);
1520 if (!playerGroup || playerGroup != group)
1562 playerGroup = groupsManager.GetPlayerGroup(playerId);
ArmaReforgerScripted GetGame()
void SCR_EditorManagerEntity(IEntitySource src, IEntity parent)
void SCR_FactionManager(IEntitySource src, IEntity parent)
void SCR_GameModeCampaign(IEntitySource src, IEntity parent)
bool GetSuppliesAutoRegenerationEnabled()
SCR_MilitarySymbolUIComponent m_SymbolUI
void SCR_GroupsManagerComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
EMapEntityMode
Mode of the map.
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
proto external Managed FindComponent(typename typeName)
Replication item identifier.
static ScriptInvoker GetOnPlayerAdded()
static ScriptInvokerBase< ScriptInvokerAIGroup > GetOnGroupRallyPointChanged()
Widget m_wRallyPointIconTop
ResourceName m_sServiceHint
void SetRallyPointVisible(bool visible)
ref map< EEditableEntityLabel, SCR_ServicePointDelegateComponent > m_mServices
ref ScriptInvoker m_OnMapIconEnter
bool m_bIsAnyElementHovered
SCR_SpawnPoint m_SpawnPoint
Widget m_wRallyPointIconBottom
override bool OnMouseLeave(Widget w, Widget enterW, int x, int y)
override void ShowName(bool visible)
void InitMobile(SCR_CampaignMobileAssemblyStandaloneComponent assembly)
override void HandlerAttached(Widget w)
LocalizedString m_sAssembly
Widget m_wNextSupplyShipmentWrapper
void OnSelected(SCR_SpawnPoint sp)
void InitBase(SCR_CampaignMilitaryBaseComponent base)
TextWidget m_wNextSupplyShipmentLabel
static ref ScriptInvoker Event_OnIconUpdated
TextWidget m_w_NameDialog
RplId m_ResourceInventoryPlayerComponentRplId
Widget m_wRallyPointIconBalancer
TextWidget m_wCallsignName
TextWidget m_wRallyPointText
void FlashBaseIcon(Faction faction=null, bool changeToDefault=false)
ScriptInvoker GetOnMapIconEnter()
Widget m_w_ServicesOverlay
void SetBaseServices(SCR_CampaignMilitaryBaseComponent base)
override void HandlerDeattached(Widget w)
void SetNextShipmentText()
SCR_InputButtonComponent m_OpenInputButtonComponent
void OnMapCloseInvoker(MapConfiguration config)
void ~SCR_CampaignMapUIBase()
void ChangeNameSize(bool visible)
SCR_CampaignMilitaryBaseComponent GetBase()
override bool OnClick(Widget w, int x, int y, int button)
ref SCR_ResourceSystemSubscriptionHandleBase m_ResourceSubscriptionHandleConsumer
SCR_CampaignMobileAssemblyStandaloneComponent m_MobileAssembly
SCR_ResourceComponent m_ResourceComponent
ResourceName m_sServiceElement
static const LocalizedString NEXT_SHIPMENT_ETA
void OnPlayerAddedToGroup(SCR_AIGroup group, int playerId)
void SetCaptureWarning(bool isEnabled)
override RplId GetSpawnPointId()
SizeLayoutWidget m_wImageOverlay
void ChangeBaseIconSize()
LocalizedString m_sRallyPointText
void ShowServiceHint(string name, string text, bool show, int suppliesAmount=-1, int suppliesMax=-1)
override void AnimCollapse()
TextWidget m_wNextSupplyShipmentText
void OnMapClose(MapConfiguration config)
void SetBaseType(SCR_ECampaignBaseType type)
void ChangeNameSizeOnLayerChange(int layer)
bool m_bIsAnyElementClicked
static Widget m_wServiceHint
void SetNextShipmentTextVisible(bool visible)
void FocusOnBase(SCR_SpawnPoint sp)
void OnOpenButtonActivated(SCR_InputButtonComponent button, string action)
static const float OPACITY_DISABLED
ScriptInvoker GetOnMapIconClick()
void InitOpenButton(Widget w)
override bool OnMouseEnter(Widget w, int x, int y)
SCR_CampaignFaction m_PlayerFaction
override void SelectIcon(bool invoke=true)
float m_fNextShipmentTextUpdatePeriod
void SetIconName(string name)
SCR_CampaignMilitaryBaseComponent m_Base
override void SetImage(string image)
void ShowServices(bool show)
void SetBaseIconFactionColor(Faction faction)
string m_sNextShipmentLabelName
ref ScriptInvoker m_OnBaseSelected
TextWidget m_wBaseNameDialog
void UpdateAssemblyIcon()
static const float OPACITY_UNSELECTED
void SetRallyPointVisibility(SCR_AIGroup playerGroup=null)
ref ScriptInvoker m_OnMapIconClick
void SetAntennaIconVisible(bool visible)
string m_sNextShipmentTextName
void UpdateBaseIcon(int id)
TextWidget m_wCallsignNameDialog
string m_sNextShipmentWrapperName
OverlayWidget m_wCaptureWarning
void SetIconFaction(Faction faction)
void OnGroupRallyPointChanged(SCR_AIGroup group)
void DeinitOpenButton(Widget w)
SCR_ResourceConsumer m_ResourceConsumer
override void AnimExpand()
ResourceName m_sSupplyIcon
void SetService(EEditableEntityLabel type, SCR_ServicePointDelegateComponent service)
void SetParent(SCR_CampaignMapUIBase parent)
void SetHoveredBase(SCR_CampaignMilitaryBaseComponent base)
static ScriptInvokerBase< MapConfigurationInvoker > GetOnMapClose()
Get on map close invoker.
Widget GetMapMenuRoot()
Get map menu root widget.
MapConfiguration GetMapConfig()
Get map config.
static ScriptInvokerInt GetOnLayerChanged()
Get on layer changed invoker.
static SCR_MapEntity GetMapInstance()
Get map entity instance.
Color GetColorForFaction(string factionKey)
SCR_EIconType m_eIconType
ResourceName m_sImageSetARO
static SCR_MapUIElement s_SelectedElement
void PlayHoverSound(string sound)
SCR_MapUIElementContainer m_Parent
ImageWidget m_wHighlightImg
void Select(bool select=true)
void SetDimension(EMilitarySymbolDimension dimension)
void SetIcons(EMilitarySymbolIcon icons)
void SetIdentity(EMilitarySymbolIdentity identity)
static int GetLocalPlayerId()
Returns either a valid ID of local player or 0.
SCR_BasePlayerLoadout GetLoadout()
Spawn point entity defines positions on which players can possibly spawn.
static SCR_TaskManagerUIComponent GetInstance()
SCR_FieldOfViewSettings Attribute
proto external PlayerController GetPlayerController()
array< string > TStringArray
proto external string ToString()
Plain C++ pointer, no weak pointers, no memory management.