17 protected Widget m_wRoot;
21 protected ImageWidget m_wImage;
22 protected ImageWidget m_wGradient;
23 protected ImageWidget m_wSelectImg;
24 protected ImageWidget m_wHighlightImg;
26 protected bool m_bIsSelected;
27 protected const float ANIM_SPEED = 20;
29 protected bool m_bVisible =
false;
31 [
Attribute(
"{8479B3B5347DF5CF}UI/Imagesets/MilitarySymbol/ID_D.imageset")]
32 protected ResourceName m_sImageSetARO;
34 [
Attribute(
"{27F2439D610D02B3}UI/Imagesets/MilitarySymbol/ICO_Land.imageset")]
35 protected ResourceName m_sImageSetSpecial;
38 protected bool m_bUseBackgroundGradient;
41 protected string m_sSoundBase;
44 protected string m_sSoundEnemyBase;
47 protected string m_sSoundRelay;
50 protected string m_sSoundTask;
53 protected string m_sSoundService;
56 protected string m_sSoundHover;
59 ref Color m_UnknownFactionColor;
61 protected string m_sName;
64 override void HandlerAttached(Widget w)
68 m_wImage = ImageWidget.Cast(w.FindAnyWidget(
"Image"));
69 m_wSelectImg = ImageWidget.Cast(w.FindAnyWidget(
"Corners"));
70 m_wHighlightImg = ImageWidget.Cast(w.FindAnyWidget(
"Highlight"));
72 if (m_bUseBackgroundGradient)
73 m_wGradient = ImageWidget.Cast(w.FindAnyWidget(
"BackgroundGradient"));
96 void ShowName(
bool visible)
101 void SetVisible(
bool visible)
128 override bool OnClick(Widget w,
int x,
int y,
int button)
137 void SelectIcon(
bool invoke =
true)
142 void Select(
bool select =
true)
144 s_SelectedElement =
this;
145 m_bIsSelected = select;
147 m_wSelectImg.SetVisible(select);
150 s_SelectedElement =
this;
158 m_wGradient.SetVisible(select);
162 protected void AnimExpand()
167 protected void AnimCollapse()
172 protected void PlayHoverSound(
string sound)
174 if (sound !=
string.Empty)
184 protected void SetImage(
string image)
189 Color GetColorForFaction(
string factionKey)
191 FactionManager fm =
GetGame().GetFactionManager();
195 Faction faction = fm.GetFactionByKey(factionKey);
197 return Color.FromInt(m_UnknownFactionColor.PackToInt());
199 return Color.FromInt(faction.GetFactionColor().PackToInt());
203 RplId GetSpawnPointId()
205 return RplId.Invalid();
209 void SetName(
string name);