Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_CustomReconMarkerEntry.c
Go to the documentation of this file.
1[BaseContainerProps(), SCR_CustomReconMarkerEntryTitle()]
3{
4 [Attribute(desc: "Description in selection menu")]
5 protected string m_sMenuDescription;
6
7 [Attribute(desc: "Color name from Placed Marker Colors in MapMarkerConfig")]
8 protected string m_sColorName;
9
10 [Attribute(desc: "Imageset quad from Placed Marker Icons in MapMarkerConfig")]
11 protected string m_sIconImagesetQuad;
12
14
15 //------------------------------------------------------------------------------------------------
16 override void SetMenuEntry(notnull SCR_MapMarkerMenuEntry entry)
17 {
18 super.SetMenuEntry(entry);
19
20 SCR_MapMarkerConfig markerConfig = m_MarkerMgr.GetMarkerConfig();
21 if (!markerConfig)
22 return;
23
24 m_PlacedMarkerConfig = SCR_MapMarkerEntryPlaced.Cast(markerConfig.GetMarkerEntryConfigByType(SCR_EMapMarkerType.PLACED_CUSTOM));
26 return;
27
28 m_MenuEntry.SetMarkerType(SCR_EMapMarkerType.PLACED_CUSTOM);
30
31 int iconIndex = GetPlacedMarkerIconIndex();
32 if (iconIndex < 0)
33 return;
34
35 string imageset, imagesetGlow, imageQuad;
36 m_PlacedMarkerConfig.GetIconEntry(iconIndex, imageset, imagesetGlow, imageQuad);
37 m_MenuEntry.SetIcon(imageset, imageQuad);
38 }
39
40 //------------------------------------------------------------------------------------------------
42 {
44 return -1;
45
46 array<ref SCR_MarkerIconEntry> iconsArr = m_PlacedMarkerConfig.GetIconEntries();
47 if (!iconsArr)
48 return -1;
49
50 string imageset, imagesetGlow, imageQuad;
51 foreach (int i, SCR_MarkerIconEntry iconEntry : iconsArr)
52 {
53 iconEntry.GetIconResource(imageset, imagesetGlow, imageQuad);
54 if (imageQuad == m_sIconImagesetQuad)
55 return i;
56 }
57
58 return -1;
59 }
60
61 //------------------------------------------------------------------------------------------------
63 {
64 SCR_MapMarkerConfig markerConfig = m_MarkerMgr.GetMarkerConfig();
65 if (!markerConfig)
66 return;
67
68 m_PlacedMarkerConfig = SCR_MapMarkerEntryPlaced.Cast(markerConfig.GetMarkerEntryConfigByType(SCR_EMapMarkerType.PLACED_CUSTOM));
70 return;
71
73 marker.SetType(SCR_EMapMarkerType.PLACED_CUSTOM);
74
75 int iconIndex = GetPlacedMarkerIconIndex();
76 if (iconIndex != -1)
77 marker.SetIconEntry(iconIndex);
78
79 int colorIndex;
80 foreach (int i, SCR_MarkerColorEntry colorEntry : m_PlacedMarkerConfig.GetColorEntries())
81 {
82 if (colorEntry.GetName() == m_sColorName)
83 {
84 colorIndex = i;
85 break;
86 }
87 }
88
89 marker.SetColorEntry(colorIndex);
91
92 float wX, wY;
93 m_MapEntity.GetMapCenterWorldPosition(wX, wY);
94 marker.SetWorldPos(wX, wY);
95
96 FactionManager factionManager = GetGame().GetFactionManager();
97 if (factionManager)
98 {
99 Faction markerOwnerFaction = SCR_FactionManager.SGetPlayerFaction(GetGame().GetPlayerController().GetPlayerId());
100 if (markerOwnerFaction)
101 marker.AddMarkerFactionFlags(factionManager.GetFactionIndex(markerOwnerFaction));
102 }
103
104 m_MarkerMgr.InsertStaticMarker(marker, false);
105 }
106}
107
108class SCR_CustomReconMarkerEntryTitle : BaseContainerCustomTitle
109{
110 //------------------------------------------------------------------------------------------------
111 override bool _WB_GetCustomTitle(BaseContainer source, out string title)
112 {
113 string quad;
114 source.Get("m_sIconImagesetQuad", quad);
115 title = source.GetClassName() + ": "+ quad;
117 return true;
118 }
ArmaReforgerScripted GetGame()
Definition game.c:1398
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
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
SCR_MapMarkerMenuEntry m_MenuEntry
void SCR_BaseReconMarkerEntry()
SCR_MapMarkerEntryPlaced m_PlacedMarkerConfig
int GetPlacedMarkerIconIndex()
override void OnEntryPerformed(SCR_SelectionMenuEntry entry)
string m_sIconImagesetQuad
string m_sColorName
override void SetMenuEntry(notnull SCR_MapMarkerMenuEntry entry)
string m_sMenuDescription
void SetColorEntry(int colorEntry)
void AddMarkerFactionFlags(int flags)
Add faction index to flags which you can acquire by calling GetFactionIndex().
void SetIconEntry(int iconEntry)
void SetCustomText(string text)
void SetType(SCR_EMapMarkerType type)
void SetWorldPos(int posX, int posY)
Marker entry which can be placed through map.
Base entry for marker selection menu.
SCR_FieldOfViewSettings Attribute
proto external PlayerController GetPlayerController()
class SCR_BaseManualCameraComponent _WB_GetCustomTitle(BaseContainer source, out string title)
proto external int GetPlayerId()