Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_ScenarioFrameworkSlotMarker.c
Go to the documentation of this file.
1 [EntityEditorProps(category: "GameScripted/ScenarioFramework/Slot", description: "")]
3 {
4 }
5 
6 class SCR_ScenarioFrameworkSlotMarker : SCR_ScenarioFrameworkSlotBase
7 {
8  [Attribute(desc: "Marker Type", category: "Map Marker")]
9  protected ref SCR_ScenarioFrameworkMarkerType m_MapMarkerType;
10 
11  protected ref SCR_MapMarkerBase m_MapMarker;
12 
13  //------------------------------------------------------------------------------------------------
15  SCR_ScenarioFrameworkMarkerType GetMapMarkerType()
16  {
17  return m_MapMarkerType;
18  }
19 
20  //------------------------------------------------------------------------------------------------
23  {
24  m_MapMarkerType = type;
25  }
26 
27  //------------------------------------------------------------------------------------------------
30  {
31  return m_MapMarker;
32  }
33 
34  //------------------------------------------------------------------------------------------------
36  override void RestoreToDefault(bool includeChildren = false, bool reinitAfterRestoration = false)
37  {
39  m_MapMarker = null;
40 
41  super.RestoreToDefault(includeChildren, reinitAfterRestoration);
42  }
43 
44  //------------------------------------------------------------------------------------------------
46  {
48  {
49  //If just one condition is false, we don't continue and interrupt the init
50  if (!activationCondition.Init(GetOwner()))
51  {
52  super.AfterAllChildrenSpawned(this);
53  return;
54  }
55  }
56 
57  if (!m_MapMarker)
59 
60  super.AfterAllChildrenSpawned(this);
61  }
62 
63  //------------------------------------------------------------------------------------------------
66  {
67  if (!m_MapMarker)
68  return;
69 
70  SCR_MapMarkerManagerComponent markerMgr = SCR_MapMarkerManagerComponent.GetInstance();
71  if (!markerMgr)
72  return;
73 
74  int markerID = m_MapMarker.GetMarkerID();
75 
76  SCR_MapMarkerBase marker = markerMgr.GetStaticMarkerByID(markerID);
77  if (!marker)
78  return;
79 
80  markerMgr.RemoveStaticMarker(marker);
81  m_MapMarker = null;
82  }
83 
84  //------------------------------------------------------------------------------------------------
85  protected void CreateMapMarker()
86  {
87  SCR_MapMarkerManagerComponent mapMarkerMgr = SCR_MapMarkerManagerComponent.Cast(GetGame().GetGameMode().FindComponent(SCR_MapMarkerManagerComponent));
88  if (!mapMarkerMgr)
89  return;
90 
91  m_MapMarker = new SCR_MapMarkerBase();
92 
93  SCR_ScenarioFrameworkMarkerCustom mapMarkerCustom = SCR_ScenarioFrameworkMarkerCustom.Cast(m_MapMarkerType);
94  if (mapMarkerCustom)
95  {
96  m_MapMarker.SetType(SCR_EMapMarkerType.PLACED_CUSTOM);
97  m_MapMarker.SetIconEntry(mapMarkerCustom.m_eMapMarkerIcon);
98  m_MapMarker.SetRotation(mapMarkerCustom.m_iMapMarkerRotation);
99  m_MapMarker.SetColorEntry(mapMarkerCustom.m_eMapMarkerColor);
100  }
101  else
102  {
103  SCR_ScenarioFrameworkMarkerMilitary mapMarkerMilitary = SCR_ScenarioFrameworkMarkerMilitary.Cast(m_MapMarkerType);
104  if (!mapMarkerMilitary)
105  return;
106 
107  m_MapMarker = mapMarkerMgr.PrepareMilitaryMarker(mapMarkerMilitary.m_eMapMarkerFactionIcon, mapMarkerMilitary.m_eMapMarkerDimension, mapMarkerMilitary.m_eMapMarkerType1Modifier | mapMarkerMilitary.m_eMapMarkerType2Modifier);
108  }
109 
110  vector worldPos = GetOwner().GetOrigin();
111  m_MapMarker.SetWorldPos(worldPos[0], worldPos[2]);
112  m_MapMarker.SetCustomText(m_MapMarkerType.m_sMapMarkerText);
113 
114  FactionManager factionManager = GetGame().GetFactionManager();
115  if (factionManager)
116  {
117  Faction faction = factionManager.GetFactionByKey(m_sFactionKey);
118  if (faction)
119  m_MapMarker.AddMarkerFactionFlags(factionManager.GetFactionIndex(faction));
120  }
121 
122  mapMarkerMgr.InsertStaticMarker(m_MapMarker, false, true);
123  }
124 }
125 
127 class SCR_ScenarioFrameworkMarkerType : ScriptAndConfig
128 {
129  [Attribute(desc: "Text which will be displayed for the Map Marker", category: "Map Marker")];
130  LocalizedString m_sMapMarkerText;
131 }
132 
134 class SCR_ScenarioFrameworkMarkerCustom : SCR_ScenarioFrameworkMarkerType
135 {
136  [Attribute("0", UIWidgets.ComboBox, "Marker Icon", "", ParamEnumArray.FromEnum(SCR_EScenarioFrameworkMarkerCustom), category: "Map Marker")]
137  SCR_EScenarioFrameworkMarkerCustom m_eMapMarkerIcon;
138 
139  [Attribute("0", UIWidgets.ComboBox, "Marker Color", "", ParamEnumArray.FromEnum(SCR_EScenarioFrameworkMarkerCustomColor), category: "Map Marker")]
140  SCR_EScenarioFrameworkMarkerCustomColor m_eMapMarkerColor;
141 
142  [Attribute(defvalue: "0", uiwidget: UIWidgets.Slider, desc: "Rotation of the Map Marker", params: "-180 180 1", category: "Map Marker")]
143  int m_iMapMarkerRotation;
144 }
145 
147 class SCR_ScenarioFrameworkMarkerMilitary : SCR_ScenarioFrameworkMarkerType
148 {
149  [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")]
150  EMilitarySymbolIdentity m_eMapMarkerFactionIcon;
151 
152  [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")]
153  EMilitarySymbolDimension m_eMapMarkerDimension;
154 
155  [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")]
156  EMilitarySymbolIcon m_eMapMarkerType1Modifier;
157 
158  [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")]
159  EMilitarySymbolIcon m_eMapMarkerType2Modifier;
160 }
161 
162 enum SCR_EScenarioFrameworkMarkerCustom
163 {
164  CIRCLE = 0,
165  CIRCLE2,
166  CROSS,
167  CROSS2,
168  DOT,
169  DOT2,
170  DROP_POINT,
171  DROP_POINT2,
172  ENTRY_POINT,
173  ENTRY_POINT2,
174  FLAG,
175  FLAG2,
176  FLAG3,
177  FORTIFICATION,
178  FORTIFICATION2,
179  MARK_EXCLAMATION,
180  MARK_EXCLAMATION2,
181  MARK_EXCLAMATION3,
182  MARK_QUESTION,
183  MARK_QUESTION2,
184  MARK_QUESTION3,
185  MINE_FIELD,
186  MINE_FIELD2,
187  MINE_FIELD3,
188  MINE_SINGLE,
189  MINE_SINGLE2,
190  MINE_SINGLE3,
191  OBJECTIVE_MARKER,
192  OBJECTIVE_MARKER2,
193  OBSERVATION_POST,
194  OBSERVATION_POST2,
195  PICK_UP,
196  PICK_UP2,
197  POINT_OF_INTEREST,
198  POINT_OF_INTEREST2,
199  POINT_OF_INTEREST3,
200  POINT_SPECIAL,
201  POINT_SPECIAL2,
202  RECON_OUTPOST,
203  RECON_OUTPOST2,
204  WAYPOINT,
205  WAYPOINT2,
206  DEFEND,
207  DEFEND2,
208  DESTROY,
209  DESTROY2,
210  HEAL,
211  HELP,
212  HELP2,
213  ATTACK,
214  ATTACK_MAIN,
215  CONTAIN,
216  CONTAIN2,
217  CONTAIN3,
218  RETAIN,
219  RETAIN2,
220  STRONG_POINT,
221  STRONG_POINT2,
222  TARGET_REFERENCE_POINT,
223  TARGET_REFERENCE_POINT2,
224  AMBUSH,
225  AMBUSH2,
226  RECONNAISSANCE,
227  SEARCH_AREA,
228  DIRECTION_OF_ATTACK,
229  DIRECTION_OF_ATTACK_MAIN,
230  DIRECTION_OF_ATTACK_PLANNED,
231  FOLLOW_AND_SUPPORT,
232  FOLLOW_AND_SUPPORT2,
233  JOIN,
234  JOIN2,
235  JOIN3,
236  ARROW_LARGE,
237  ARROW_LARGE2,
238  ARROW_LARGE3,
239  ARROW_MEDIUM,
240  ARROW_MEDIUM2,
241  ARROW_MEDIUM3,
242  ARROW_SMALL,
243  ARROW_SMALL2,
244  ARROW_SMALL3,
245  ARROW_CURVE_LARGE,
246  ARROW_CURVE_LARGE2,
247  ARROW_CURVE_LARGE3,
248  ARROW_CURVE_MEDIUM,
249  ARROW_CURVE_MEDIUM2,
250  ARROW_CURVE_MEDIUM3,
251  ARROW_CURVE_SMALL,
252  ARROW_CURVE_SMALL2,
253  ARROW_CURVE_SMALL3
254 }
255 
256 enum SCR_EScenarioFrameworkMarkerCustomColor
257 {
258  WHITE = 0,
259  REFORGER_ORANGE,
260  ORANGE,
261  RED,
262  OPFOR,
263  INDEPENDENT,
264  GREEN,
265  BLUE,
266  BLUFOR,
267  DARK_BLUE,
268  MAGENTA,
269  CIVILIAN,
270  DARK_PINK
271 }
BLUE
@ BLUE
Definition: SCR_BaseVehicleInfo.c:19
CreateMapMarker
protected void CreateMapMarker()
Definition: SCR_ScenarioFrameworkSlotMarker.c:85
SCR_ScenarioFrameworkActivationConditionBase
Definition: SCR_ScenarioFrameworkSlotBase.c:677
CIVILIAN
@ CIVILIAN
Definition: EMilitarySymbol.c:7
ORANGE
@ ORANGE
Definition: SCR_BaseVehicleInfo.c:21
EntityEditorProps
enum EQueryType EntityEditorProps(category:"GameScripted/Sound", description:"THIS IS THE SCRIPT DESCRIPTION.", color:"0 0 255 255")
Definition: SCR_AmbientSoundsComponent.c:12
SetMapMarkerType
void SetMapMarkerType(SCR_ScenarioFrameworkMarkerType type)
Definition: SCR_ScenarioFrameworkSlotMarker.c:22
SCR_ScenarioFrameworkSlotBaseClass
Definition: SCR_ScenarioFrameworkSlotBase.c:2
DESTROY
SCR_GameModeSFManagerClass DESTROY
HEAL
@ HEAL
Definition: SCR_AIGetMemberByGoal.c:4
WHITE
@ WHITE
Definition: SCR_BaseVehicleInfo.c:18
BaseContainerProps
SCR_ScenarioFrameworkMarkerType ScriptAndConfig BaseContainerProps()
RED
@ RED
Definition: SCR_BaseVehicleInfo.c:22
SCR_MapMarkerBase
Definition: SCR_MapMarkerBase.c:3
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
DEFEND
@ DEFEND
Definition: SCR_AIMessage.c:33
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition: SCR_RespawnBriefingComponent.c:17
SCR_ScenarioFrameworkMarkerType
Definition: SCR_ScenarioFrameworkSlotMarker.c:127
m_sFactionKey
protected FactionKey m_sFactionKey
Definition: SCR_ScenarioFrameworkLayerBase.c:25
GetGameMode
SCR_BaseGameMode GetGameMode()
Definition: SCR_BaseGameModeComponent.c:15
RestoreToDefault
override void RestoreToDefault(bool includeChildren=false, bool reinitAfterRestoration=false)
Definition: SCR_ScenarioFrameworkSlotMarker.c:36
EMilitarySymbolIdentity
EMilitarySymbolIdentity
Definition: EMilitarySymbol.c:1
SCR_ScenarioFrameworkSlotBase
void SCR_ScenarioFrameworkSlotBase(IEntityComponentSource src, IEntity ent, IEntity parent)
Definition: SCR_ScenarioFrameworkSlotBase.c:661
ATTACK
@ ATTACK
Definition: SCR_AIMessage.c:18
FLAG
@ FLAG
Definition: SCR_ECampaignTutorialArlandStage.c:16
SCR_ContainerActionTitle
SCR_ContainerActionTitle BaseContainerCustomTitle SCR_ContainerActionTitle()] class SCR_ScenarioFrameworkActionBase
Definition: SCR_ScenarioFrameworkActions.c:43
SCR_EMapMarkerType
SCR_EMapMarkerType
Definition: SCR_MapMarkerConfig.c:5
GREEN
@ GREEN
Definition: SCR_BaseVehicleInfo.c:20
OPFOR
@ OPFOR
Definition: SCR_CampaignFactionManager.c:134
WAYPOINT
@ WAYPOINT
AI Waypoint (inherited from AIWaypoint)
Definition: EEditableEntityType.c:11
GetOwner
IEntity GetOwner()
Owner entity of the fuel tank.
Definition: SCR_FuelNode.c:128
GetMapMarker
SCR_MapMarkerBase GetMapMarker()
Definition: SCR_ScenarioFrameworkSlotMarker.c:29
Faction
Definition: Faction.c:12
CIRCLE
@ CIRCLE
Definition: SCR_MapConstants.c:75
JOIN
@ JOIN
Definition: SCR_ServerBrowserDialogManager.c:630
SCR_ScenarioFrameworkLayerBase
void SCR_ScenarioFrameworkLayerBase(IEntityComponentSource src, IEntity ent, IEntity parent)
Definition: SCR_ScenarioFrameworkLayerBase.c:875
type
EDamageType type
Definition: SCR_DestructibleTreeV2.c:32
EMilitarySymbolDimension
EMilitarySymbolDimension
Definition: EMilitarySymbol.c:14
RemoveMapMarker
void RemoveMapMarker()
Definition: SCR_ScenarioFrameworkSlotMarker.c:65
params
Configs ServerBrowser KickDialogs params
Definition: SCR_NotificationSenderComponent.c:24
Attribute
SCR_ScenarioFrameworkSlotMarkerClass SCR_ScenarioFrameworkSlotBaseClass Attribute(desc:"Marker Type", category:"Map Marker")
Definition: SCR_ScenarioFrameworkSlotMarker.c:8
BLUFOR
@ BLUFOR
Definition: SCR_CampaignFactionManager.c:133
SCR_ScenarioFrameworkSlotMarkerClass
Definition: SCR_ScenarioFrameworkSlotMarker.c:2
AfterAllChildrenSpawned
override void AfterAllChildrenSpawned(SCR_ScenarioFrameworkLayerBase layer)
Definition: SCR_ScenarioFrameworkSlotMarker.c:45
LocalizedString
Definition: LocalizedString.c:21
EMilitarySymbolIcon
EMilitarySymbolIcon
Definition: EMilitarySymbol.c:29
m_aActivationConditions
protected ref array< ref SCR_ScenarioFrameworkActivationConditionBase > m_aActivationConditions
Definition: SCR_ScenarioFrameworkLayerBase.c:46
category
params category
Definition: SCR_VehicleDamageManagerComponent.c:180