Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_ScenarioFrameworkSlotMarker.c
Go to the documentation of this file.
1[EntityEditorProps(category: "GameScripted/ScenarioFramework/Slot", description: "")]
5
6class SCR_ScenarioFrameworkSlotMarker : SCR_ScenarioFrameworkSlotBase
7{
8 [Attribute(desc: "Marker Type", category: "Map Marker")]
9 protected ref SCR_ScenarioFrameworkMarkerType m_MapMarkerType;
10
11 [Attribute(desc: "When enabled, map marker can by removed by owner on map.", category: "Map Marker")]
12 protected bool m_bCanBeRemovedByOwner;
13
14 protected ref SCR_MapMarkerBase m_MapMarker;
15 protected SCR_MapMarkerDotCircle m_MarkerDotCircleEntity;
16
17 //------------------------------------------------------------------------------------------------
19 SCR_ScenarioFrameworkMarkerType GetMapMarkerType()
20 {
21 return m_MapMarkerType;
22 }
23
24 //------------------------------------------------------------------------------------------------
27 {
28 m_MapMarkerType = type;
29 }
30
31 //------------------------------------------------------------------------------------------------
34 {
35 return m_MapMarker;
36 }
37
38 //------------------------------------------------------------------------------------------------
42 {
43 super.AfterAllChildrenSpawned(this);
44
45 if (!GetIsTerminated())
47 }
48
49 //------------------------------------------------------------------------------------------------
54 override void RestoreToDefault(bool includeChildren = false, bool reinitAfterRestoration = false, bool affectRandomization = true, bool deleteSpawnedEntities = true)
55 {
56 super.RestoreToDefault(includeChildren, reinitAfterRestoration, affectRandomization, deleteSpawnedEntities);
58 }
59
60 //------------------------------------------------------------------------------------------------
62 protected void CreateMapMarker()
63 {
64 if (m_MarkerDotCircleEntity || m_MapMarker)
65 return;
66
67 SCR_ScenarioFrameworkMarkerDotCircle mapMarkerDotCircle = SCR_ScenarioFrameworkMarkerDotCircle.Cast(m_MapMarkerType);
68 if (mapMarkerDotCircle)
69 {
70 if (m_MarkerDotCircleEntity)
71 return;
72
74 params.TransformMode = ETransformMode.WORLD;
75 GetOwner().GetTransform(params.Transform);
76 m_MarkerDotCircleEntity = SCR_MapMarkerDotCircle.Cast(GetGame().SpawnEntityPrefabEx(mapMarkerDotCircle.m_sMarkerPrefab, false, params: params));
77 if (!m_MarkerDotCircleEntity)
78 return;
79
80 m_MarkerDotCircleEntity.m_DotColor = mapMarkerDotCircle.m_DotColor;
81 m_MarkerDotCircleEntity.m_fDotDensity = mapMarkerDotCircle.m_fDotDensity;
82 m_MarkerDotCircleEntity.m_fRadius = mapMarkerDotCircle.m_fRadius;
83 }
84
85 SCR_MapMarkerManagerComponent mapMarkerMgr = SCR_MapMarkerManagerComponent.Cast(GetGame().GetGameMode().FindComponent(SCR_MapMarkerManagerComponent));
86 if (!mapMarkerMgr)
87 return;
88
89 m_MapMarker = new SCR_MapMarkerBase();
90
91 SCR_ScenarioFrameworkMarkerCustom mapMarkerCustom = SCR_ScenarioFrameworkMarkerCustom.Cast(m_MapMarkerType);
92 if (mapMarkerCustom)
93 {
94 m_MapMarker.SetType(SCR_EMapMarkerType.PLACED_CUSTOM);
95 m_MapMarker.SetIconEntry(mapMarkerCustom.m_eMapMarkerIcon);
96 m_MapMarker.SetRotation(mapMarkerCustom.m_iMapMarkerRotation);
97 m_MapMarker.SetColorEntry(mapMarkerCustom.m_eMapMarkerColor);
98 }
99 else
100 {
101 SCR_ScenarioFrameworkMarkerMilitary mapMarkerMilitary = SCR_ScenarioFrameworkMarkerMilitary.Cast(m_MapMarkerType);
102 if (!mapMarkerMilitary)
103 return;
104
105 m_MapMarker = mapMarkerMgr.PrepareMilitaryMarker(mapMarkerMilitary.m_eMapMarkerFactionIcon, mapMarkerMilitary.m_eMapMarkerDimension, mapMarkerMilitary.m_eMapMarkerType1Modifier | mapMarkerMilitary.m_eMapMarkerType2Modifier);
106 }
107
108 vector worldPos = GetOwner().GetOrigin();
109 m_MapMarker.SetWorldPos(worldPos[0], worldPos[2]);
110 m_MapMarker.SetCustomText(m_MapMarkerType.m_sMapMarkerText);
111 m_MapMarker.SetCanBeRemovedByOwner(m_bCanBeRemovedByOwner);
112
113 FactionManager factionManager = GetGame().GetFactionManager();
114 if (factionManager)
115 {
116 Faction faction = factionManager.GetFactionByKey(m_sFactionKey);
117 if (faction)
118 m_MapMarker.AddMarkerFactionFlags(factionManager.GetFactionIndex(faction));
119 }
120
121 mapMarkerMgr.InsertStaticMarker(m_MapMarker, false, true);
122 }
123
124 //------------------------------------------------------------------------------------------------
127 {
128 if (m_MarkerDotCircleEntity)
129 SCR_EntityHelper.DeleteEntityAndChildren(m_MarkerDotCircleEntity);
130
131 if (!m_MapMarker)
132 return;
133
134 SCR_MapMarkerManagerComponent markerMgr = SCR_MapMarkerManagerComponent.GetInstance();
135 if (!markerMgr)
136 return;
137
138 const int markerID = m_MapMarker.GetMarkerID();
139 SCR_MapMarkerBase marker = markerMgr.GetStaticMarkerByID(markerID);
140 if (marker)
141 markerMgr.RemoveStaticMarker(marker);
142
143 m_MapMarker = null;
144 }
145
146 //------------------------------------------------------------------------------------------------
147 override void SetIsTerminated(bool state)
148 {
149 super.SetIsTerminated(state);
150 if (state)
152 }
153
154 //------------------------------------------------------------------------------------------------
157 {
159 return;
160
161 DynamicDespawn(this);
163 }
164}
165
168{
169 [Attribute(desc: "Text which will be displayed for the Map Marker", category: "Map Marker")]
170 LocalizedString m_sMapMarkerText;
171}
172
174class SCR_ScenarioFrameworkMarkerCustom : SCR_ScenarioFrameworkMarkerType
175{
176 [Attribute("0", UIWidgets.ComboBox, "Marker Icon", "", ParamEnumArray.FromEnum(SCR_EScenarioFrameworkMarkerCustom), category: "Map Marker")]
177 SCR_EScenarioFrameworkMarkerCustom m_eMapMarkerIcon;
178
179 [Attribute("0", UIWidgets.ComboBox, "Marker Color", "", ParamEnumArray.FromEnum(SCR_EScenarioFrameworkMarkerCustomColor), category: "Map Marker")]
180 SCR_EScenarioFrameworkMarkerCustomColor m_eMapMarkerColor;
181
182 [Attribute(defvalue: "0", uiwidget: UIWidgets.Slider, desc: "Rotation of the Map Marker", params: "-180 180 1", category: "Map Marker")]
183 int m_iMapMarkerRotation;
184}
185
187class SCR_ScenarioFrameworkMarkerMilitary : SCR_ScenarioFrameworkMarkerType
188{
189 [Attribute(defvalue: EMilitarySymbolIdentity.BLUFOR.ToString(), UIWidgets.ComboBox, "Marker Faction Icon. Not all of these combinations will work as they have to be properly defined in MapMarkerConfig.conf", "", ParamEnumArray.FromEnum(EMilitarySymbolIdentity), category: "Map Marker")]
190 EMilitarySymbolIdentity m_eMapMarkerFactionIcon;
191
192 [Attribute(defvalue: EMilitarySymbolDimension.LAND.ToString(), UIWidgets.ComboBox, "Marker Dimension. Not all of these combinations will work as they have to be properly defined in MapMarkerConfig.conf", "", ParamEnumArray.FromEnum(EMilitarySymbolDimension), category: "Map Marker")]
193 EMilitarySymbolDimension m_eMapMarkerDimension;
194
195 [Attribute(defvalue: EMilitarySymbolIcon.INFANTRY.ToString(), UIWidgets.ComboBox, "Marker Type 1 modifier. Not all of these combinations will work as they have to be properly defined in MapMarkerConfig.conf", "", ParamEnumArray.FromEnum(EMilitarySymbolIcon), category: "Map Marker")]
196 EMilitarySymbolIcon m_eMapMarkerType1Modifier;
197
198 [Attribute(defvalue: EMilitarySymbolIcon.INFANTRY.ToString(), UIWidgets.ComboBox, "Marker Type 2 modifier. Not all of these combinations will work as they have to be properly defined in MapMarkerConfig.conf", "", ParamEnumArray.FromEnum(EMilitarySymbolIcon), category: "Map Marker")]
199 EMilitarySymbolIcon m_eMapMarkerType2Modifier;
200}
201
203class SCR_ScenarioFrameworkMarkerDotCircle : SCR_ScenarioFrameworkMarkerType
204{
205 [Attribute(defvalue: "1000", desc: "Meter Radius", params: "0 inf 0.01")]
206 float m_fRadius;
207
208 [Attribute(defvalue: "1 0 0 1", desc: "Dot Color")]
209 ref Color m_DotColor;
210
211 [Attribute(defvalue: "0.02", desc: "Dot Density", params: "0 inf 0.01")]
212 float m_fDotDensity;
213
214 [Attribute(defvalue: "{EC95FBEA75AE409B}Prefabs/Markers/MapMarkerDotCircle.et", desc: "Marker Prefab", uiwidget: UIWidgets.ResourcePickerThumbnail, params: "et")]
215 ResourceName m_sMarkerPrefab;
216}
217
218enum SCR_EScenarioFrameworkMarkerCustom
219{
220 CIRCLE = 0,
221 CIRCLE2,
222 CROSS,
223 CROSS2,
224 DOT,
225 DOT2,
226 DROP_POINT,
227 DROP_POINT2,
228 ENTRY_POINT,
229 ENTRY_POINT2,
230 FLAG,
231 FLAG2,
232 FLAG3,
233 FORTIFICATION,
234 FORTIFICATION2,
235 MARK_EXCLAMATION,
236 MARK_EXCLAMATION2,
237 MARK_EXCLAMATION3,
238 MARK_QUESTION,
239 MARK_QUESTION2,
240 MARK_QUESTION3,
241 MINE_FIELD,
242 MINE_FIELD2,
243 MINE_FIELD3,
244 MINE_SINGLE,
245 MINE_SINGLE2,
246 MINE_SINGLE3,
247 OBJECTIVE_MARKER,
248 OBJECTIVE_MARKER2,
249 OBSERVATION_POST,
250 OBSERVATION_POST2,
251 PICK_UP,
252 PICK_UP2,
253 POINT_OF_INTEREST,
254 POINT_OF_INTEREST2,
255 POINT_OF_INTEREST3,
256 POINT_SPECIAL,
257 POINT_SPECIAL2,
258 RECON_OUTPOST,
259 RECON_OUTPOST2,
260 WAYPOINT,
261 WAYPOINT2,
262 DEFEND,
263 DEFEND2,
264 DESTROY,
265 DESTROY2,
266 HEAL,
267 HELP,
268 HELP2,
269 ATTACK,
270 ATTACK_MAIN,
271 CONTAIN,
272 CONTAIN2,
273 CONTAIN3,
274 RETAIN,
275 RETAIN2,
276 STRONG_POINT,
277 STRONG_POINT2,
278 TARGET_REFERENCE_POINT,
279 TARGET_REFERENCE_POINT2,
280 AMBUSH,
281 AMBUSH2,
282 RECONNAISSANCE,
283 SEARCH_AREA,
284 DIRECTION_OF_ATTACK,
285 DIRECTION_OF_ATTACK_MAIN,
286 DIRECTION_OF_ATTACK_PLANNED,
287 FOLLOW_AND_SUPPORT,
288 FOLLOW_AND_SUPPORT2,
289 JOIN,
290 JOIN2,
291 JOIN3,
292 ARROW_LARGE,
293 ARROW_LARGE2,
294 ARROW_LARGE3,
295 ARROW_MEDIUM,
296 ARROW_MEDIUM2,
297 ARROW_MEDIUM3,
298 ARROW_SMALL,
299 ARROW_SMALL2,
300 ARROW_SMALL3,
301 ARROW_CURVE_LARGE,
302 ARROW_CURVE_LARGE2,
303 ARROW_CURVE_LARGE3,
304 ARROW_CURVE_MEDIUM,
305 ARROW_CURVE_MEDIUM2,
306 ARROW_CURVE_MEDIUM3,
307 ARROW_CURVE_SMALL,
308 ARROW_CURVE_SMALL2,
309 ARROW_CURVE_SMALL3
310}
311
312enum SCR_EScenarioFrameworkMarkerCustomColor
313{
314 WHITE = 0,
315 REFORGER_ORANGE,
316 ORANGE,
317 RED,
318 OPFOR,
319 INDEPENDENT,
320 GREEN,
321 BLUE,
322 BLUFOR,
323 DARK_BLUE,
324 MAGENTA,
325 CIVILIAN,
326 DARK_PINK
327}
EMilitarySymbolIdentity
@ CIVILIAN
EMilitarySymbolDimension
EMilitarySymbolIcon
IEntity SpawnEntityPrefabEx(ResourceName prefab, bool randomizeEditableVariant, BaseWorld world=null, EntitySpawnParams params=null)
Definition game.c:90
ArmaReforgerScripted GetGame()
Definition game.c:1398
LayerPresets layer
@ ATTACK
@ HEAL
@ DEFEND
enum SCR_EAISettingOrigin WAYPOINT
SCR_BaseGameMode GetGameMode()
enum SCR_ECompassType EntityEditorProps(category:"GameScripted/Gadgets", description:"Compass", color:"0 0 255 255")
Prefab data class for compass component.
EDamageType type
@ CIRCLE
SCR_EMapMarkerType
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
FactionKey m_sFactionKey
void SetIsTerminated(bool state)
void AfterAllChildrenSpawned(SCR_ScenarioFrameworkLayerBase layer)
void SCR_ScenarioFrameworkLayerBase(IEntityComponentSource src, IEntity ent, IEntity parent)
void DynamicDespawn(SCR_ScenarioFrameworkLayerBase layer)
void RestoreToDefault()
void SCR_ScenarioFrameworkSlotBase(IEntityComponentSource src, IEntity ent, IEntity parent)
void SetMapMarkerType(SCR_ScenarioFrameworkMarkerType type)
void ~SCR_ScenarioFrameworkSlotMarker()
Removes map marker when not in edit mode, despawns object if in edit mode.
void RemoveMapMarker()
Removes map marker by ID from map marker manager.
SCR_ScenarioFrameworkMarkerType ScriptAndConfig BaseContainerProps()
void CreateMapMarker()
Creates a map marker based on provided type, sets its position, custom text, and adds it to map marke...
SCR_MapMarkerBase GetMapMarker()
class SCR_ServerBrowserDialogManager JOIN
proto external vector GetOrigin()
proto external void GetTransform(out vector mat[])
static bool IsEditMode()
Definition Functions.c:1566
void EntitySpawnParams()
Definition gameLib.c:130
IEntity GetOwner()
Owner entity of the fuel tank.
SCR_FieldOfViewSettings Attribute