10 [
Attribute(
"{720E8E61D7692172}Configs/Map/MapMarkerConfig.conf",
UIWidgets.ResourceNamePicker )]
13 protected static SCR_MapMarkerManagerComponent s_Instance;
34 static SCR_MapMarkerManagerComponent GetInstance()
50 array<SCR_MapMarkerBase> output = {};
53 output.Insert(marker);
63 array<SCR_MapMarkerBase> output = {};
66 output.Insert(marker);
86 if (w == marker.GetRootWidget())
100 if (markerID == marker.GetMarkerID())
114 if (markerID == marker.GetMarkerID())
129 if (
type == marker.GetType() && target == marker.GetTarget())
158 if (factionFlags != 0)
218 if (factionID == -1 || dimensionID == -1)
297 RplComponent.DeleteRplEntity(ent,
false);
321 RplComponent rplComponent = RplComponent.Cast(marker.FindComponent(RplComponent));
322 if (!rplComponent || !pController)
325 RplIdentity identity = pController.GetRplIdentity();
326 if (!identity.IsValid())
329 rplComponent.EnableStreamingConNode(identity, state);
341 array<int> players = {};
342 GetGame().GetPlayerManager().GetPlayers(players);
344 foreach (
int player : players)
346 Faction markerFaction = marker.GetFaction();
363 Faction markerFaction = dynamicMarker.GetFaction();
365 if (!markerFaction || markerFaction ==
SCR_FactionManager.SGetPlayerFaction(playerID))
386 PlayerController playerContr =
GetGame().GetPlayerController();
390 m_MarkerSyncComp = SCR_MapMarkerSyncComponent.Cast(playerContr.FindComponent(SCR_MapMarkerSyncComponent));
403 if (state || marker.GetBlocked())
411 marker.SetUpdateDisabled(
true);
421 marker.SetUpdateDisabled(
false);
423 if (!marker.GetRootWidget())
424 marker.OnCreateMarker();
484 markerEnt.OnUpdate();
496 DbgUI.Begin(
"Markers debug");
497 string dbg =
"disabled: %1 | static: %2 | dynamic: %3 ";
521 FactionManager factionManager =
GetGame().GetFactionManager();
523 if (
System.IsConsoleApp())
535 bool isMyFaction = marker.
IsFaction(factionManager.GetFactionIndex(localFaction));
539 if (localFaction && !isMyFaction)
634 if (!sc ||
System.IsConsoleApp())
668 PlayerController pc =
GetGame().GetPlayerController();
672 return SocialComponent.Cast(pc.FindComponent(SocialComponent));
693 if (textsToFilter.IsEmpty())
698 if (!
GetGame().GetPlatformService().FilterProfanityAsync(textsToFilter, profanityFilter))
703 return profanityFilter;
709 bool isPlatformXbox =
GetGame().GetPlatformService().GetLocalPlatformKind() ==
PlatformKind.XBOX;
714 if (marker.GetMarkerOwnerID() == -1)
717 if (!texts.IsIndexValid(i))
724 marker.SetCustomText(resultText);
728 marker.SetCustomText(texts[i]);
745 PlayerController playerController =
GetGame().GetPlayerManager().GetPlayerController(playerId);
746 SCR_MapMarkerSyncComponent markerSyncComp = SCR_MapMarkerSyncComponent.Cast(playerController.FindComponent(SCR_MapMarkerSyncComponent));
748 markerSyncComp.ClearOwnedMarkers();
752 override event protected bool RplSave(ScriptBitWriter writer)
760 markersSimple.Insert(markerDis);
763 if (markersSimple.IsEmpty())
765 writer.WriteInt(count);
771 if (marker.GetMarkerID() == -1)
777 writer.WriteInt(count);
783 if (marker.GetMarkerID() == -1)
787 marker.GetWorldPos(pos);
789 writer.WriteInt(pos[0]);
790 writer.WriteInt(pos[1]);
791 writer.WriteInt(marker.GetMarkerID());
792 writer.WriteInt(marker.GetMarkerOwnerID());
793 writer.WriteInt(marker.GetFlags());
794 writer.WriteInt(marker.GetMarkerConfigID());
795 writer.WriteInt(marker.GetMarkerFactionFlags());
796 writer.Write(marker.GetRotation(), 16);
797 writer.Write(marker.GetType(), 8);
798 writer.Write(marker.GetColorEntry(), 8);
799 writer.Write(marker.GetIconEntry(), 16);
800 writer.WriteString(marker.GetCustomText());
801 writer.WriteBool(marker.IsTimestampVisible());
802 if (marker.IsTimestampVisible())
804 timestamp = marker.GetTimestamp();
805 writer.Write(timestamp, 64);
816 reader.ReadInt(count);
820 int posX, posY, markerID, markerOwnerID,
flags, markerConfigID, factionFlags, markerType, colorID, iconID,
rotation;
822 bool isTimestampVisible;
825 array<string> textsToFilter = {};
827 for (
int i; i < count; i++)
829 reader.ReadInt(posX);
830 reader.ReadInt(posY);
831 reader.ReadInt(markerID);
832 reader.ReadInt(markerOwnerID);
833 reader.ReadInt(
flags);
834 reader.ReadInt(markerConfigID);
835 reader.ReadInt(factionFlags);
837 reader.Read(markerType, 8);
838 reader.Read(colorID, 8);
839 reader.Read(iconID, 16);
840 reader.ReadString(customText);
841 reader.ReadBool(isTimestampVisible);
842 if (isTimestampVisible)
843 reader.Read(timestamp, 64);
859 if (isTimestampVisible)
867 if (!textsToFilter.IsEmpty())
883 if (playerFactionAffiliation)
894 marker = markers[
index];
898 if (!marker.
IsFaction(factionIndexOfPlayer))
899 markers.Remove(
index);
908 FactionManager factionManager =
GetGame().GetFactionManager();
912 int newFactionIndex = factionManager.GetFactionIndex(newFaction);
923 array<ref SCR_MapMarkerEntryConfig> entryCfgs =
m_MarkerCfg.GetMarkerEntryConfigs();
932 entryDynamic.InitClientLogic();
SCR_EAIThreatSectorFlags flags
ArmaReforgerScripted GetGame()
override bool RplLoad(ScriptBitReader reader)
enum EAIGroupCombatMode ComponentEditorProps(category:"GameScripted/AI", description:"Component for utility AI system for groups")
SCR_BaseGameModeComponentClass m_pGameMode
The game mode entity this component is attached to.
void SCR_BaseGameModeComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
override bool RplSave(ScriptBitWriter writer)
void OnMapOpen(MapConfiguration config)
SCR_DestructionSynchronizationComponentClass ScriptComponentClass int index
void SCR_FactionManager(IEntitySource src, IEntity parent)
void OnMapPanEnd(float x, float y)
SCR_MapEntity m_MapEntity
SCR_MapMarkerSyncComponent m_MarkerSyncComp
SocialComponent GetSocialComponent()
SCR_MapMarkerBase GetStaticMarkerByID(int markerID)
void OnPlayerFactionChanged_S(int playerID, SCR_PlayerFactionAffiliationComponent playerComponent, Faction faction)
void RemoveMarkersOfOtherFactions(int factionIndexOfPlayer, notnull inout array< ref SCR_MapMarkerBase > markers)
ref array< ref SCR_MapMarkerBase > m_aDisabledMarkers
void DisconnectFromMarkerManagerSystem()
SCR_MapMarkerConfig GetMarkerConfig()
void ConnectToMarkerManagerSystem()
void RegisterLocalController(notnull PlayerController playerController)
array< SCR_MapMarkerBase > GetDisabledMarkers()
void InsertStaticMarker(SCR_MapMarkerBase marker, bool isLocal, bool isServerMarker=false)
void CheckMarkersUserRestrictions()
SCR_MapMarkerEntity InsertDynamicMarker(SCR_EMapMarkerType type, IEntity entity, int configId=-1)
void HandleStreamOut(SCR_MapMarkerEntity marker, PlayerController pController, bool state)
void SetStreamRulesForPlayer(int playerID)
array< SCR_MapMarkerEntity > GetDynamicMarkers()
array< SCR_MapMarkerBase > GetStaticMarkers()
ref array< ref SCR_MapMarkerBase > m_aStaticMarkers
bool FindMarkerSyncComponent()
SCR_MapMarkerEntity GetDynamicMarkerByTarget(SCR_EMapMarkerType type, IEntity target)
void SetMarkerStreamRules(notnull SCR_MapMarkerEntity marker)
void OnRemoveSynchedMarker(int markerID)
void RegisterDynamicMarker(SCR_MapMarkerEntity markerEnt)
void ~SCR_MapMarkerManagerComponent()
ref SCR_MapMarkerConfig m_MarkerCfg
ref array< ref SCR_ScriptProfanityFilterRequestCallback > m_aProfanityCallbacks
SCR_MapMarkerBase GetMarkerByWidget(Widget w)
vector m_vVisibleFrameMin
void SetStaticMarkerDisabled(notnull SCR_MapMarkerBase marker, bool state)
void OnAskRemoveStaticMarker(int markerID)
vector m_vVisibleFrameMax
void OnAddSynchedMarker(SCR_MapMarkerBase marker)
SCR_MapMarkerBase GetDisabledMarkerByID(int markerID)
void AssignMarkerUID(SCR_MapMarkerBase marker)
void RemoveDynamicMarker(notnull SCR_MapMarkerEntity ent)
void UnregisterDynamicMarker(SCR_MapMarkerEntity markerEnt)
void InsertStaticMarkerByType(SCR_EMapMarkerType type, int worldX, int worldY, bool isLocal, int configId=-1, int factionFlags=0, bool isServerMarker=false)
SPAWN/REMOVE API.
void RPC_DoRemoveStaticMarker(int markerID)
SCR_MapMarkerBase PrepareMilitaryMarker(EMilitarySymbolIdentity faction, EMilitarySymbolDimension dimension, EMilitarySymbolIcon typeFlags)
void EnableUpdate(bool state)
ref array< SCR_MapMarkerEntity > m_aDynamicMarkers
SCR_ScriptProfanityFilterRequestCallback RequestProfanityFilter(string text)
void OnAskAddStaticMarker(SCR_MapMarkerBase markerData)
void RPC_DoAddStaticMarker(SCR_MapMarkerBase markerData)
void RemoveStaticMarker(SCR_MapMarkerBase marker)
void OnFilteredCallback(array< string > texts)
void OnPlayerFactionChanged(SCR_PlayerFactionAffiliationComponent component, Faction previous, Faction current)
proto external BaseWorld GetWorld()
Object holding reference to resource. In destructor release the resource.
Replication connection identity.
SCR_MapUIBaseComponent GetMapUIComponent(typename componentType)
bool IsOpen()
Check if the map is opened.
static SCR_MapEntity GetMapInstance()
Get map entity instance.
void SetRotation(int angle)
void SetMarkerOwnerID(int playerID)
void SetColorEntry(int colorEntry)
void OnCreateMarker(bool skipProfanityFilter=false)
void SetMarkerFactionFlags(int flags)
Set faction flags directly without converting the faction indices.
bool IsFaction(int factionID)
Check whether the marker is one of the defined list of factions.
void SetIconEntry(int iconEntry)
void SetTimestamp(WorldTimestamp timestamp)
void SetMarkerConfigID(int id)
void SetCustomText(string text)
void SetType(SCR_EMapMarkerType type)
void SetWorldPos(int posX, int posY)
void SetTimestampVisibility(bool isVisible)
int GetMarkerFactionFlags()
Get faction flags representing indices of factions within FactionManager prefab.
void RequestProfanityFilter()
Requests profanity filtering for the text of this marker.
void SetServerDisabled(bool state)
Disable marker UI display on server -> for dedicated servers(no UI) or hosted server enemy faction.
void SetTarget(IEntity target)
Set entity this marker is tracking.
void SetType(SCR_EMapMarkerType type, int configID=-1)
void SetLocalVisible(bool state)
Marker dynamic entry base.
ResourceName GetMarkerPrefab()
override void InitServerLogic()
Override this to set up logic & event behavior on server.
Marker military symbol entry.
int GetDimensionEntryID(EMilitarySymbolDimension dimension)
int GetFactionEntryID(EMilitarySymbolIdentity faction)
void Register(SCR_MapMarkerManagerComponent component)
void Unregister(SCR_MapMarkerManagerComponent component)
Markers UI map component.
Handles filtering profanities in texts.
IEntity GetOwner()
Owner entity of the fuel tank.
override void EOnInit(IEntity owner)
SCR_FieldOfViewSettings Attribute
EntityEvent
Various entity events.
RespawnSystemComponentClass GameComponentClass vector vector rotation
override void OnPlayerDisconnected(int playerId, KickCauseCode cause, int timeout)
proto external PlayerController GetPlayerController()
EUserInteraction
Interaction type between two players.
proto external int GetPlayerId()
void RplRpc(RplChannel channel, RplRcver rcver, RplCondition condition=RplCondition.None, string customConditionName="")
RplChannel
Communication channel. Reliable is guaranteed to be delivered. Unreliable not.