Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_MilitaryReconMarkerEntry.c
Go to the documentation of this file.
3{
4 [Attribute(uiwidget: UIWidgets.SearchComboBox, desc: "Military dimension defines", enumType: EMilitarySymbolDimension)]
6
7 [Attribute(uiwidget: UIWidgets.SearchComboBox, desc: "Military Type A can be set e.g. to Light and can be combined with Military Type B", enumType: EMilitarySymbolIcon)]
9
10 [Attribute(uiwidget: UIWidgets.SearchComboBox, desc: "Military Type B can be set e.g. to Infantry and can be combined with Military Type A", enumType: EMilitarySymbolIcon)]
12
13 [Attribute(uiwidget: UIWidgets.SearchComboBox, desc: "Predefined marker faction", enumType: EMilitarySymbolIdentity)]
15
16 [Attribute("1", desc: "Show timestamp when the marker was created")]
17 protected bool m_bShowTimestamp;
18
20
21 //------------------------------------------------------------------------------------------------
23 {
24 SCR_MapMarkerConfig markerConfig = m_MarkerMgr.GetMarkerConfig();
25 if (!markerConfig)
26 return null;
27
28 return SCR_MapMarkerEntryMilitary.Cast(markerConfig.GetMarkerEntryConfigByType(SCR_EMapMarkerType.PLACED_MILITARY));
29 }
30
31 //------------------------------------------------------------------------------------------------
32 override void SetMenuEntry(notnull SCR_MapMarkerMenuEntry entry)
33 {
34 super.SetMenuEntry(entry);
35
38
40 return;
41
42 entry.SetMarkerType(SCR_EMapMarkerType.PLACED_MILITARY);
43 entry.SetLayout();
44
45 // set military symbol identity by setting from config
46 int factionID = m_MilitaryMarkerConfig.GetFactionEntryID(m_eMilitarySymbolIdentity);
47 if (factionID < 0)
48 {
49 PrintFormat("EMilitarySymbolIdentity:%1, set in SCR_MilitaryReconMarkerEntry is not supported.", m_eMilitarySymbolIdentity, level: LogLevel.WARNING);
50 return;
51 }
52
53 SCR_MarkerMilitaryFactionEntry factionEntry = m_MilitaryMarkerConfig.GetFactionEntry(factionID);
54 if (factionEntry)
55 entry.SetSymbolProps(m_eMilitarySymbolIdentity, factionEntry.GetColor(), m_eDimension, m_eTypeA | m_eTypeB, EMilitarySymbolAmplifier.NONE);
56
57 int dimensionID = m_MilitaryMarkerConfig.GetDimensionEntryID(m_eDimension);
58 if (dimensionID < 0)
59 {
60 PrintFormat("EMilitarySymbolDimension:%1, set in SCR_MilitaryReconMarkerEntry is not supported.", m_eDimension, level: LogLevel.WARNING);
61 return;
62 }
63
64 string entryName = string.Empty;
65 SCR_MarkerMilitaryDimension dimensionData = m_MilitaryMarkerConfig.GetDimensionEntry(dimensionID);
66 if (dimensionData)
67 entryName = dimensionData.GetTranslation();
68
69 array<ref SCR_MarkerMilitaryType> milTypes = m_MilitaryMarkerConfig.GetMilitaryTypes();
70 if (!milTypes)
71 return;
72
73 // create entry name from dimension and military type
74 foreach (SCR_MarkerMilitaryType type : milTypes)
75 {
76 if (!(m_eTypeA & type.GetType()) && !(m_eTypeB & type.GetType()))
77 continue;
78
79 if (!entryName.IsEmpty())
80 entryName += " ";
81
82 entryName += type.GetTranslation();
83 }
84
85 entry.SetName(entryName);
86 }
87
88 //------------------------------------------------------------------------------------------------
90 {
91 super.OnEntryPerformed(entry);
92
95
97 return;
98
100 marker.SetType(SCR_EMapMarkerType.PLACED_MILITARY);
101 marker.SetFlags(m_eTypeA | m_eTypeB);
102 int dimensionID = m_MilitaryMarkerConfig.GetDimensionEntryID(m_eDimension);
103 if (dimensionID < 0)
104 {
105 PrintFormat("EMilitarySymbolDimension:%1, set in SCR_MilitaryReconMarkerEntry is not supported.", m_eDimension, level: LogLevel.WARNING);
106 return;
107 }
108
109 // set military symbol identity by setting in config
110 EMilitarySymbolIdentity militarySymbolIdentity = m_eMilitarySymbolIdentity;
111 int factionID = m_MilitaryMarkerConfig.GetFactionEntryID(militarySymbolIdentity);
112 if (factionID < 0)
113 {
114 PrintFormat("EMilitarySymbolIdentity:%1, set in SCR_MilitaryReconMarkerEntry is not supported.", m_eMilitarySymbolIdentity, level: LogLevel.WARNING);
115 return;
116 }
117
118 marker.SetMarkerConfigID(dimensionID * 100 + factionID); // combination of faction and dimension id
119
120 float wX, wY;
121 m_MapEntity.GetMapCenterWorldPosition(wX, wY);
122 marker.SetWorldPos(wX, wY);
123
124 FactionManager factionManager = GetGame().GetFactionManager();
125 if (factionManager)
126 {
127 Faction markerOwnerFaction = SCR_FactionManager.SGetPlayerFaction(GetGame().GetPlayerController().GetPlayerId());
128 if (markerOwnerFaction)
129 marker.AddMarkerFactionFlags(factionManager.GetFactionIndex(markerOwnerFaction));
130 }
131
133
134 ChimeraWorld world = GetGame().GetWorld();
135 if (world)
136 marker.SetTimestamp(world.GetServerTimestamp());
137
138 m_MarkerMgr.InsertStaticMarker(marker, false);
139 }
140}
EMilitarySymbolIdentity
EMilitarySymbolDimension
EMilitarySymbolIcon
EMilitarySymbolAmplifier
ArmaReforgerScripted GetGame()
Definition game.c:1398
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
EDamageType type
void SCR_FactionManager(IEntitySource src, IEntity parent)
SCR_EMapMarkerType
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
SCR_MapEntity m_MapEntity
SCR_MapMarkerManagerComponent m_MarkerMgr
void SCR_BaseReconMarkerEntry()
void AddMarkerFactionFlags(int flags)
Add faction index to flags which you can acquire by calling GetFactionIndex().
void SetFlags(int flags)
void SetTimestamp(WorldTimestamp timestamp)
void SetMarkerConfigID(int id)
void SetType(SCR_EMapMarkerType type)
void SetWorldPos(int posX, int posY)
void SetTimestampVisibility(bool isVisible)
Marker military symbol entry.
Base entry for marker selection menu.
EMilitarySymbolIcon m_eTypeA
SCR_MapMarkerEntryMilitary m_MilitaryMarkerConfig
EMilitarySymbolIdentity m_eMilitarySymbolIdentity
EMilitarySymbolDimension m_eDimension
SCR_MapMarkerEntryMilitary GetMilitaryMarkerConfig()
override void SetMenuEntry(notnull SCR_MapMarkerMenuEntry entry)
EMilitarySymbolIcon m_eTypeB
override void OnEntryPerformed(SCR_SelectionMenuEntry entry)
bool m_bShowTimestamp
LogLevel
Enum with severity of the logging message.
Definition LogLevel.c:14
proto void PrintFormat(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL, LogLevel level=LogLevel.NORMAL)
SCR_FieldOfViewSettings Attribute
proto external PlayerController GetPlayerController()
proto external int GetPlayerId()