7 [
Attribute(
UIConstants.ICONS_IMAGE_SET, UIWidgets.ResourcePickerThumbnail,
"Select edds texture or imageset",
"edds imageset")]
8 ResourceName m_sIconImageset;
10 [
Attribute(
UIConstants.ICONS_GLOW_IMAGE_SET, UIWidgets.ResourcePickerThumbnail,
"Select edds texture or imageset",
"edds imageset")]
11 ResourceName m_sGlowImageset;
21 SizeLayoutWidget m_wSize;
24 override void HandlerAttached(Widget w)
26 super.HandlerAttached(w);
27 m_wIcon = ImageWidget.Cast(w.FindAnyWidget(
"Icon"));
28 m_wGlow = ImageWidget.Cast(w.FindAnyWidget(
"Glow"));
29 m_wSize = SizeLayoutWidget.Cast(w.FindAnyWidget(
"Size"));
31 SetImage(m_sImageName);
35 ImageWidget GetIconWidget()
41 ImageWidget GetGlowWidget()
47 void SetImage(
string imageName, ResourceName iconImageSet =
string.Empty, ResourceName glowImageSet =
string.Empty)
52 if (iconImageSet.IsEmpty())
53 iconImageSet = m_sIconImageset;
55 SetImage_Internal(
m_wIcon, iconImageSet, imageName);
57 if (glowImageSet.IsEmpty())
58 glowImageSet = m_sGlowImageset;
60 SetImage_Internal(m_wGlow, glowImageSet, imageName);
62 m_sIconImageset = iconImageSet;
63 m_sGlowImageset = glowImageSet;
64 m_sImageName = imageName;
68 m_wSize.SetWidthOverride(m_sImageSize[0]);
69 m_wSize.SetHeightOverride(m_sImageSize[1]);
74 protected void SetImage_Internal(ImageWidget image, ResourceName imageSet,
string imageName)
76 if (imageSet.EndsWith(
"imageset"))
77 image.LoadImageFromSet(0, imageSet, imageName);
79 image.LoadImageTexture(0, imageSet);
81 image.SetSize(m_sImageSize[0], m_sImageSize[1]);
85 void SetIconColor(Color color)
94 void SetGlowColor(Color color)
99 m_wGlow.SetColor(color);
103 void SetVisibile(
bool visible)
109 m_wGlow.SetVisible(visible);
114 string GetIcon(out
string imageSet)
116 if (m_sImageName ==
string.Empty)
117 return m_sIconImageset;
118 imageSet = m_sIconImageset;