Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_MapMarkerEntryPlaced.c
Go to the documentation of this file.
1 //------------------------------------------------------------------------------------------------
5 {
6  [Attribute("#AR-MapMarker_CustomHint", desc: "Description in selection menu")]
7  protected string m_sMenuDescription;
8 
9  [Attribute("{3262679C50EF4F01}UI/Textures/Icons/icons_wrapperUI.imageset", UIWidgets.ResourcePickerThumbnail, desc: "Imageset resource", params: "imageset")]
10  protected ResourceName m_sMenuImageset;
11 
12  [Attribute("settings", desc: "Imageset icon")]
13  protected string m_sMenuIcon;
14 
15  [Attribute("", UIWidgets.Object, "Categories of marker icons for sorting")]
16  protected ref array<ref SCR_MarkerIconCategory> m_aPlacedMarkerIconCategories;
17 
18  [Attribute("", UIWidgets.Object, "Icons which can be chosen when placing a custom marker")]
19  protected ref array<ref SCR_MarkerIconEntry> m_aPlacedMarkerIcons;
20 
21  [Attribute("", UIWidgets.Object, "Colors which can be chosen when placing a custom marker")]
22  protected ref array<ref SCR_MarkerColorEntry> m_aPlacedMarkerColors;
23 
24  //------------------------------------------------------------------------------------------------
25  string GetMenuDescription()
26  {
28  }
29 
30  //------------------------------------------------------------------------------------------------
31  ResourceName GetMenuImageset()
32  {
34  }
35 
36  //------------------------------------------------------------------------------------------------
37  string GetMenuIcon()
38  {
39  return m_sMenuIcon;
40  }
41 
42  //------------------------------------------------------------------------------------------------
43  Color GetColorEntry(int i)
44  {
45  if (!m_aPlacedMarkerColors.IsIndexValid(i))
46  return Color.FromInt(Color.WHITE);
47 
48  return m_aPlacedMarkerColors[i].GetColor();
49  }
50 
51  //------------------------------------------------------------------------------------------------
52  bool GetIconEntry(int i, out ResourceName imageset, out ResourceName imagesetGlow, out string imageQuad)
53  {
54  if (!m_aPlacedMarkerIcons.IsIndexValid(i))
55  return false;
56 
57  m_aPlacedMarkerIcons[i].GetIconResource(imageset, imagesetGlow, imageQuad);
58 
59  return true;
60  }
61 
62  //------------------------------------------------------------------------------------------------
63  int GetIconCategoryID(int iconID)
64  {
65  if (!m_aPlacedMarkerIcons.IsIndexValid(iconID))
66  return null;
67 
68  string identifier = m_aPlacedMarkerIcons[iconID].m_sCategoryIdentifier;
69 
71  {
72  if (identifier == category.m_sIdentifier)
73  return i;
74  }
75 
76  return null;
77  }
78 
79  //------------------------------------------------------------------------------------------------
80  array<ref SCR_MarkerColorEntry> GetColorEntries()
81  {
83  }
84 
85  //------------------------------------------------------------------------------------------------
86  array<ref SCR_MarkerIconEntry> GetIconEntries()
87  {
89  }
90 
91  //------------------------------------------------------------------------------------------------
92  array<ref SCR_MarkerIconCategory> GetIconCategories()
93  {
95  }
96 
97  //------------------------------------------------------------------------------------------------
98  override SCR_EMapMarkerType GetMarkerType()
99  {
100  return SCR_EMapMarkerType.PLACED_CUSTOM;
101  }
102 
103  //------------------------------------------------------------------------------------------------
104  override void InitClientSettings(SCR_MapMarkerBase marker, SCR_MapMarkerWidgetComponent widgetComp)
105  {
106  super.InitClientSettings(marker, widgetComp);
107 
108  ResourceName imageset, imagesetGlow;
109  string quad;
110  GetIconEntry(marker.GetIconEntry(), imageset, imagesetGlow, quad);
111  widgetComp.SetImage(imageset, quad);
112  widgetComp.SetText(marker.GetCustomText());
113  widgetComp.SetColor(GetColorEntry(marker.GetColorEntry()));
114  if (imagesetGlow)
115  widgetComp.SetGlowImage(imagesetGlow, quad);
116 
117  widgetComp.SetEventListening(true);
118  }
119 
120  //------------------------------------------------------------------------------------------------
121  override void OnMapLayerChanged(notnull SCR_MapMarkerWidgetComponent widgetComp, int layerID)
122  {
123  if (layerID > 1)
124  {
125  widgetComp.SetTextVisible(false);
126  }
127  else
128  {
129  widgetComp.SetTextVisible(true);
130  }
131  }
132 }
133 
134 //------------------------------------------------------------------------------------------------
137 class SCR_MarkerColorEntry
138 {
139  [Attribute("1.0 1.0 1.0 1.0")]
140  protected ref Color m_Color;
141 
142  //------------------------------------------------------------------------------------------------
143  Color GetColor()
144  {
145  return Color.FromInt(m_Color.PackToInt());
146  }
147 
148 }
149 
150 //------------------------------------------------------------------------------------------------
154 {
155  [Attribute("", desc: "Set this wihin the icon to link it to this category")]
156  string m_sIdentifier;
157 
158  [Attribute("", desc: "Name of the category")]
159  string m_sName;
160 }
161 
162 //------------------------------------------------------------------------------------------------
165 class SCR_MarkerIconEntry
166 {
167  [Attribute("general", desc: "Category tab within marker dialog")]
168  string m_sCategoryIdentifier;
169 
170  [Attribute("{E23427CAC80DA8B7}UI/Textures/Icons/icons_mapMarkersUI.imageset", UIWidgets.ResourcePickerThumbnail, desc: "Image resource", params: "imageset")]
171  protected ResourceName m_sIconImageset;
172 
173  [Attribute("{67B3A6DC2D712B52}UI/Textures/Icons/icons_mapMarkersUI-glow.imageset", UIWidgets.ResourcePickerThumbnail, desc: "Image resource", params: "imageset")]
174  protected ResourceName m_sIconGlowImageset;
175 
176  [Attribute("", desc: "Imageset quad")]
177  protected string m_sIconImagesetQuad;
178 
179  //------------------------------------------------------------------------------------------------
180  void GetIconResource(out ResourceName imageset, out ResourceName imagesetGlow, out string imageQuad)
181  {
182  imageset = m_sIconImageset;
183  imagesetGlow = m_sIconGlowImageset;
184  imageQuad = m_sIconImagesetQuad;
185  }
186 }
187 
188 //------------------------------------------------------------------------------------------------
189 class SCR_MapMarkerTitle: BaseContainerCustomTitle
190 {
191  //------------------------------------------------------------------------------------------------
192  override bool _WB_GetCustomTitle(BaseContainer source, out string title)
193  {
194  typename tName = source.GetClassName().ToType();
195  SCR_MapMarkerEntryConfig cfg = SCR_MapMarkerEntryConfig.Cast(tName.Spawn());
196  if (cfg)
197  title = source.GetClassName() + ": " + typename.EnumToString(SCR_EMapMarkerType, cfg.GetMarkerType());
198 
199  return true;
200  }
201 }
202 
203 //------------------------------------------------------------------------------------------------
204 class SCR_MapMarkerIconEntryTitle: BaseContainerCustomTitle
205 {
206  //------------------------------------------------------------------------------------------------
207  override bool _WB_GetCustomTitle(BaseContainer source, out string title)
208  {
209  string quad, identifier;
210  source.Get("m_sCategoryIdentifier", identifier);
211  source.Get("m_sIconImagesetQuad", quad);
212 
213  title = identifier + ": " + quad;
214 
215  return true;
216  }
217 }
m_sMenuIcon
protected string m_sMenuIcon
Definition: SCR_MapMarkerEntryMilitary.c:9
m_aPlacedMarkerIconCategories
protected ref array< ref SCR_MarkerIconCategory > m_aPlacedMarkerIconCategories
Definition: SCR_MapMarkerEntryPlaced.c:12
SCR_MapMarkerEntryPlaced
Marker entry which can be placed through map.
Definition: SCR_MapMarkerEntryPlaced.c:4
m_aPlacedMarkerIcons
protected ref array< ref SCR_MarkerIconEntry > m_aPlacedMarkerIcons
Definition: SCR_MapMarkerEntryPlaced.c:15
m_sMenuDescription
protected string m_sMenuDescription
Definition: SCR_MapMarkerEntryMilitary.c:3
BaseContainerProps
SCR_MapMarkerEntryPlaced SCR_MapMarkerEntryConfig BaseContainerProps()] class SCR_MarkerColorEntry
Placed marker color entry.
Definition: SCR_MapMarkerEntryPlaced.c:136
_WB_GetCustomTitle
SCR_MapMarkerTitle BaseContainerCustomTitle _WB_GetCustomTitle(BaseContainer source, out string title)
Definition: SCR_MapMarkerEntryPlaced.c:207
SCR_MapMarkerBase
Definition: SCR_MapMarkerBase.c:3
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition: SCR_RespawnBriefingComponent.c:17
SCR_MapMarkerTitle
Definition: SCR_MapMarkerEntryPlaced.c:189
SCR_MapMarkerIconEntryTitle
class SCR_MarkerIconCategory SCR_MapMarkerIconEntryTitle()] class SCR_MarkerIconEntry
Definition: SCR_MapMarkerEntryPlaced.c:164
SCR_MapMarkerEntryConfig
Base entry config.
Definition: SCR_MapMarkerConfig.c:50
m_aPlacedMarkerColors
protected ref array< ref SCR_MarkerColorEntry > m_aPlacedMarkerColors
Definition: SCR_MapMarkerEntryPlaced.c:18
Attribute
typedef Attribute
Post-process effect of scripted camera.
SCR_EMapMarkerType
SCR_EMapMarkerType
Definition: SCR_MapMarkerConfig.c:5
SCR_MarkerIconCategory
Placed marker icon category.
Definition: SCR_MapMarkerEntryPlaced.c:153
m_sMenuImageset
protected ResourceName m_sMenuImageset
Definition: SCR_MapMarkerEntryMilitary.c:6
GetColor
Color GetColor()
Definition: SCR_EditableCommentComponent.c:52
m_Color
ref Color m_Color
Definition: SCR_GeneratorBaseEntity.c:3
params
Configs ServerBrowser KickDialogs params
Definition: SCR_NotificationSenderComponent.c:24
SCR_MapMarkerWidgetComponent
Definition: SCR_MapMarkerWidgetComponent.c:3
category
params category
Definition: SCR_VehicleDamageManagerComponent.c:180