4 protected string m_sSelection;
6 protected string m_sSpawnPoint;
9 protected RplId m_SpawnPointId;
10 protected string m_sFactionKey;
11 protected TextWidget m_wSpawnPointName;
12 protected Widget m_wImageOverlay;
13 protected OverlayWidget m_wSymbolOverlay;
15 protected ButtonWidget m_wButton;
16 protected SizeLayoutWidget m_wSizeLayout;
17 protected Widget m_wSupplies;
18 protected RichTextWidget m_wSuppliesText
20 protected SCR_ResourceComponent m_ResourceComponent;
21 protected SCR_ResourceConsumer m_ResourceConsumer;
23 protected RplId m_ResourceInventoryPlayerComponentRplId;
29 m_SpawnPointId = spawnPoint.GetRplId();
32 m_wSpawnPointName.SetText(spawnPoint.GetSpawnPointName());
56 override void SetName(
string name)
58 if (m_wSpawnPointName)
59 m_wSpawnPointName.SetText(name);
63 override vector GetPos()
69 protected void UpdateResources()
74 m_wSuppliesText.SetText(
string.ToString(
m_ResourceConsumer.GetAggregatedResourceValue()));
90 ruleSet.UpdateSymbol(symbol, faction);
100 switch (symbol.GetIdentity())
104 selection =
"Neutral_Select";
105 highlight =
"Neutral_Focus";
110 selection =
"Hostile_Select";
111 highlight =
"Hostile_Focus";
116 selection =
"Friend_Select";
117 highlight =
"Friend_Focus";
122 selection =
"Unknown_Select";
123 highlight =
"Unknown_Focus";
129 m_wHighlightImg.LoadImageFromSet(0, m_sImageSetARO, highlight);
130 m_wSelectImg.LoadImageFromSet(0, m_sImageSetARO, selection);
137 m_wSymbolOverlay.SetColor(GetColorForFaction(
m_sFactionKey));
142 m_MilitarySymbolComponent.Update(symbol);
146 override void HandlerAttached(Widget w)
148 super.HandlerAttached(w);
150 m_wImageOverlay = w.FindAnyWidget(
"IconOverlay");
151 m_wSizeLayout = SizeLayoutWidget.Cast(w.FindAnyWidget(
"SizeLayout"));
152 m_wSpawnPointName = TextWidget.Cast(w.FindAnyWidget(
"Name"));
153 m_wSymbolOverlay = OverlayWidget.Cast(m_wImageOverlay.FindWidget(
"Symbol"));
155 if (!m_wSymbolOverlay)
160 m_wButton = ButtonWidget.Cast(w.FindAnyWidget(
"Button"));
165 m_wSupplies = w.FindAnyWidget(
"w_Supplies");
168 m_wSuppliesText = RichTextWidget.Cast(m_wSupplies.FindAnyWidget(
"SuppliesText"));
172 override void HandlerDeattached(Widget w)
174 super.HandlerDeattached(w);
183 override void SelectIcon(
bool invoke =
true)
188 if (s_SelectedElement && s_SelectedElement !=
this)
189 s_SelectedElement.Select(
false);
193 m_wSelectImg.SetVisible(
true);
195 m_wGradient.SetVisible(
true);
197 if (m_bIsSelected && invoke)
198 m_Parent.OnSpawnPointSelected(m_SpawnPointId);
225 override bool OnMouseEnter(Widget w,
int x,
int y)
227 if (m_wSizeLayout && w == m_wSizeLayout &&
m_wButton)
230 GetGame().GetWorkspace().SetFocusedWidget(w);
231 super.OnMouseEnter(w, x, y);
233 m_wHighlightImg.SetVisible(
true);
236 m_wGradient.SetVisible(
true);
242 m_wSupplies.SetVisible(
true);
248 override bool OnMouseLeave(Widget w, Widget enterW,
int x,
int y)
250 super.OnMouseLeave(w, enterW, x, y);
252 m_wHighlightImg.SetVisible(
false);
253 if (!m_bIsSelected && m_wGradient)
254 m_wGradient.SetVisible(
false);
260 if (RenderTargetWidget.Cast(enterW) &&
m_wButton.IsEnabled())
264 m_wSupplies.SetVisible(
false);
269 override RplId GetSpawnPointId()
271 return m_SpawnPointId;