Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
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")]
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 //------------------------------------------------------------------------------------------------
26 {
27 return m_sMenuDescription;
28 }
29
30 //------------------------------------------------------------------------------------------------
35
36 //------------------------------------------------------------------------------------------------
37 string GetMenuIcon()
38 {
39 return m_sMenuIcon;
40 }
41
42 //------------------------------------------------------------------------------------------------
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 0;
67
68 string identifier = m_aPlacedMarkerIcons[iconID].m_sCategoryIdentifier;
69
71 {
72 if (identifier == category.m_sIdentifier)
73 return i;
74 }
75
76 return 0;
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 //------------------------------------------------------------------------------------------------
99 {
100 return SCR_EMapMarkerType.PLACED_CUSTOM;
101 }
102
103 //------------------------------------------------------------------------------------------------
104 override void InitClientSettings(SCR_MapMarkerBase marker, SCR_MapMarkerWidgetComponent widgetComp, bool skipProfanityFilter = false)
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(), skipProfanityFilter);
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//------------------------------------------------------------------------------------------------
137class SCR_MarkerColorEntry
139 [Attribute("1.0 1.0 1.0 1.0")]
140 protected ref Color m_Color;
142 [Attribute(desc: "Color name, used for pairing settings with predefined markers")]
143 protected string m_sName;
145 //------------------------------------------------------------------------------------------------
148 return Color.FromInt(m_Color.PackToInt());
149 }
151 //------------------------------------------------------------------------------------------------
153 string GetName()
154 {
155 return m_sName;
157
158}
159
160//------------------------------------------------------------------------------------------------
164{
165 [Attribute("", desc: "Set this wihin the icon to link it to this category")]
166 string m_sIdentifier;
167
168 [Attribute("", desc: "Name of the category")]
169 string m_sName;
170}
171
172//------------------------------------------------------------------------------------------------
175class SCR_MarkerIconEntry
176{
177 [Attribute("general", desc: "Category tab within marker dialog")]
178 string m_sCategoryIdentifier;
179
180 [Attribute("{E23427CAC80DA8B7}UI/Textures/Icons/icons_mapMarkersUI.imageset", UIWidgets.ResourcePickerThumbnail, desc: "Image resource", params: "imageset")]
181 protected ResourceName m_sIconImageset;
182
183 [Attribute("{67B3A6DC2D712B52}UI/Textures/Icons/icons_mapMarkersUI-glow.imageset", UIWidgets.ResourcePickerThumbnail, desc: "Image resource", params: "imageset")]
184 protected ResourceName m_sIconGlowImageset;
185
186 [Attribute("", desc: "Imageset quad")]
187 protected string m_sIconImagesetQuad;
188
189 //------------------------------------------------------------------------------------------------
190 void GetIconResource(out ResourceName imageset, out ResourceName imagesetGlow, out string imageQuad)
191 {
192 imageset = m_sIconImageset;
193 imagesetGlow = m_sIconGlowImageset;
195 }
196}
197
198//------------------------------------------------------------------------------------------------
200{
201 //------------------------------------------------------------------------------------------------
202 override bool _WB_GetCustomTitle(BaseContainer source, out string title)
203 {
204 typename tName = source.GetClassName().ToType();
205 SCR_MapMarkerEntryConfig cfg = SCR_MapMarkerEntryConfig.Cast(tName.Spawn());
206 if (cfg)
207 title = source.GetClassName() + ": " + typename.EnumToString(SCR_EMapMarkerType, cfg.GetMarkerType());
208
209 return true;
210 }
212
213//------------------------------------------------------------------------------------------------
215{
216 //------------------------------------------------------------------------------------------------
217 override bool _WB_GetCustomTitle(BaseContainer source, out string title)
218 {
219 string quad, identifier;
220 source.Get("m_sCategoryIdentifier", identifier);
221 source.Get("m_sIconImagesetQuad", quad);
222
223 title = identifier + ": " + quad;
224
225 return true;
226 }
227}
string m_sIconImagesetQuad
ref Color m_Color
LocalizedString m_sName
SCR_EMapMarkerType
class SCR_MarkerIconCategory SCR_MapMarkerIconEntryTitle()] class SCR_MarkerIconEntry
SCR_MapMarkerEntryPlaced SCR_MapMarkerEntryConfig BaseContainerProps()] class SCR_MarkerColorEntry
Placed marker color entry.
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition Color.c:13
Base entry config.
SCR_EMapMarkerType GetMarkerType()
Override this in child classes with own config entries to define type.
Marker entry which can be placed through map.
string GetMenuIcon()
override SCR_EMapMarkerType GetMarkerType()
bool GetIconEntry(int i, out ResourceName imageset, out ResourceName imagesetGlow, out string imageQuad)
int GetIconCategoryID(int iconID)
ResourceName GetMenuImageset()
ref array< ref SCR_MarkerIconEntry > m_aPlacedMarkerIcons
string m_sMenuIcon
array< ref SCR_MarkerColorEntry > GetColorEntries()
override void OnMapLayerChanged(notnull SCR_MapMarkerWidgetComponent widgetComp, int layerID)
override void InitClientSettings(SCR_MapMarkerBase marker, SCR_MapMarkerWidgetComponent widgetComp, bool skipProfanityFilter=false)
array< ref SCR_MarkerIconCategory > GetIconCategories()
array< ref SCR_MarkerIconEntry > GetIconEntries()
ResourceName m_sMenuImageset
ref array< ref SCR_MarkerColorEntry > m_aPlacedMarkerColors
string GetMenuDescription()
ref array< ref SCR_MarkerIconCategory > m_aPlacedMarkerIconCategories
string m_sMenuDescription
Color GetColorEntry(int i)
void SetText(string text, bool skipProfanityFilter=false)
void SetGlowImage(ResourceName icon, string quad)
void SetImage(ResourceName icon, string quad, float aspectRatio=1)
Placed marker icon category.
SCR_FieldOfViewSettings Attribute
class SCR_BaseManualCameraComponent _WB_GetCustomTitle(BaseContainer source, out string title)