Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_TutorialFakeBaseComponent.c
Go to the documentation of this file.
4
5class SCR_TutorialFakeBaseComponent : ScriptComponent
6{
7 [Attribute()]
8 protected ref SCR_GraphLinesData m_GraphLinesData;
9
11
12 [Attribute("BASE NAME")];
14
15 [Attribute("BASE NAME LONG")];
17
18 [Attribute("AVRORA")];
20
21 [Attribute("0.854994 0.031006 0.028000 1.000000", uiwidget: UIWidgets.ColorPicker)]
23
24 [Attribute("0", UIWidgets.ComboBox, "", enums: ParamEnumArray.FromEnum(EMilitarySymbolIdentity))]
26
27 [Attribute("2", UIWidgets.ComboBox, "", enums: ParamEnumArray.FromEnum(EMilitarySymbolDimension))]
29
30 [Attribute("0", UIWidgets.ComboBox, "", enums: ParamEnumArray.FromEnum(EMilitarySymbolIcon))]
32
33 [Attribute("0", UIWidgets.ComboBox, "", enums: ParamEnumArray.FromEnum(EMilitarySymbolAmplifier))]
35
36 [Attribute("0", UIWidgets.Flags, "", enums: ParamEnumArray.FromEnum(SCR_EFakeBaseServices))]
38
39 [Attribute("Hostile_Installation_Focus_Land")]
41
42 [Attribute()]
44
45 [Attribute("1")]
47
48 [Attribute("1")]
50
51 [Attribute()]
53
54 [Attribute("38")]
56
57 [Attribute("38")]
59
60 [Attribute()]
61 ref array <string> m_aBasesToLink;
62
63 protected MapItem m_MapItem;
64 protected ref array <MapLink> m_aLinks = {};
65
66 //------------------------------------------------------------------------------------------------
67 void RemoveLinkName(string link)
68 {
69 m_aBasesToLink.RemoveItem(link);
70 }
71
72 //------------------------------------------------------------------------------------------------
73 void AddLinkName(string link)
74 {
75 m_aBasesToLink.Insert(link);
76 }
77
78 //------------------------------------------------------------------------------------------------
79 void ColorLinks(bool isHoovering)
80 {
81 if (!m_aLinks || m_aLinks.IsEmpty())
82 return;
83
84 foreach (MapLink link : m_aLinks)
85 {
86 ColorMapLink(link, isHoovering);
87 }
88 }
89
90 //------------------------------------------------------------------------------------------------
92 {
93 if (m_MapItem)
94 m_MapItem.ClearLinks();
95
96 m_aLinks.Clear();
97 }
98
99 //------------------------------------------------------------------------------------------------
101 {
102 IEntity ent;
103 MapDescriptorComponent mapDescriptor;
104
105 foreach (string base : m_aBasesToLink)
106 {
107 ent = GetGame().GetWorld().FindEntityByName(base);
108 if (!ent)
109 continue;
110
112 if (!mapDescriptor)
113 continue;
114
115 MapLink link = m_MapItem.LinkTo(mapDescriptor.Item());
116 ColorMapLink(link, false);
117
118 m_aLinks.Insert(link);
119 }
120 }
121
122 //------------------------------------------------------------------------------------------------
123 protected void ColorMapLink(notnull MapLink link, bool isHovering)
124 {
125 MapLinkProps props = link.GetMapLinkProps();
126
127 if (!props)
128 return;
129
130 if (!m_GraphLinesData)
131 return;
132
133 props.SetLineWidth(m_GraphLinesData.GetLineWidth());
134
135 Color c = Color.FromInt(props.GetLineColor().PackToInt());
136
137 if (!c)
138 return;
139
140 if (isHovering)
141 c.SetA(m_GraphLinesData.GetHighlightedAlpha());
142 else
143 c.SetA(m_GraphLinesData.GetDefaultAlpha());
144
145 props.SetLineColor(c);
146 }
147
148 //------------------------------------------------------------------------------------------------
150 {
151 SCR_TutorialMapUI tutorialMapUI;
152 foreach (SCR_MapUIBaseComponent mapUIComponent : config.Components)
153 {
154 tutorialMapUI = SCR_TutorialMapUI.Cast(mapUIComponent);
155 if (tutorialMapUI)
156 break;
157 }
158
159 if (tutorialMapUI)
160 tutorialMapUI.InsertFakeBase(this);
161 }
162
163 //------------------------------------------------------------------------------------------------
164 override void OnPostInit(IEntity owner)
165 {
167 if (!m_MapEntity)
168 return;
169
170 m_MapEntity.GetOnMapOpen().Insert(OnMapOpen);
171
173 if (!mapDescriptor)
174 return;
175
176 m_MapItem = mapDescriptor.Item();
177
178 if (m_MapItem)
179 m_MapItem.GetProps().SetIconVisible(false);
180 }
181}
EMilitarySymbolIdentity
EMilitarySymbolDimension
EMilitarySymbolIcon
EMilitarySymbolAmplifier
ArmaReforgerScripted GetGame()
Definition game.c:1398
void OnMapOpen(MapConfiguration config)
SCR_EFakeBaseServices
SCR_MapEntity m_MapEntity
void ColorMapLink(notnull MapLink link, bool isHovering)
SCR_EFakeBaseServices m_eServices
ref array< MapLink > m_aLinks
void AddLinkName(string link)
EMilitarySymbolAmplifier m_eMilitarySymbolAplifier
EMilitarySymbolDimension m_eMilitarySymbolDimension
ref array< string > m_aBasesToLink
bool m_bAllowServicesSizeOverlay
bool m_bAntennaWidgetVisible
string m_sBaseCallSign
EMilitarySymbolIdentity m_eMilitarySymbolIdentity
string m_sBaseNameLonger
EMilitarySymbolIcon m_eMilitarySymbolIcon
void ColorLinks(bool isHoovering)
void RemoveLinkName(string link)
Definition Color.c:13
proto external Managed FindComponent(typename typeName)
proto external BaseWorld GetWorld()
static SCR_MapEntity GetMapInstance()
Get map entity instance.
void InsertFakeBase(notnull SCR_TutorialFakeBaseComponent fakeBase)
SCR_FieldOfViewSettings Attribute