1 [
BaseContainerProps(configRoot :
true), SCR_ButtonEffectTitleAttribute(
"Image",
"m_sWidgetName")]
5 [
Attribute(
"", UIWidgets.ResourceNamePicker,
"Common image set",
"imageset")]
6 ResourceName m_ImageSet;
9 ref SCR_ButtonEffectImage_ImageOrImageSet m_Default;
12 ref SCR_ButtonEffectImage_ImageOrImageSet m_Hovered;
15 ref SCR_ButtonEffectImage_ImageOrImageSet m_Activated;
18 ref SCR_ButtonEffectImage_ImageOrImageSet m_ActivatedHovered;
21 ref SCR_ButtonEffectImage_ImageOrImageSet m_Disabled;
24 ref SCR_ButtonEffectImage_ImageOrImageSet m_DisabledActivated;
27 ref SCR_ButtonEffectImage_ImageOrImageSet m_FocusGained;
30 ref SCR_ButtonEffectImage_ImageOrImageSet m_FocusLost;
33 ref SCR_ButtonEffectImage_ImageOrImageSet m_ToggledOn;
36 ref SCR_ButtonEffectImage_ImageOrImageSet m_ToggledOff;
39 override void OnStateDefault(
bool instant)
45 override void OnStateHovered(
bool instant)
51 override void OnStateActivated(
bool instant)
57 override void OnStateActivatedHovered(
bool instant)
63 override void OnStateDisabled(
bool instant)
69 override void OnStateDisabledActivated(
bool instant)
75 override void OnFocusGained(
bool instant)
81 override void OnFocusLost(
bool instant)
87 override void OnToggledOn(
bool instant)
93 override void OnToggledOff(
bool instant)
99 protected void Apply(SCR_ButtonEffectImage_ImageOrImageSet imgSpec)
101 ImageWidget w = ImageWidget.Cast(m_wTarget);
106 if (!imgSpec.m_ImageName.IsEmpty() && !imgSpec.m_ImageOrImageSet.IsEmpty())
107 w.LoadImageFromSet(0, imgSpec.m_ImageOrImageSet, imgSpec.m_ImageName);
108 else if (!imgSpec.m_ImageName.IsEmpty() && !
m_ImageSet.IsEmpty())
109 w.LoadImageFromSet(0,
m_ImageSet, imgSpec.m_ImageName);
110 else if (!imgSpec.m_ImageName.IsEmpty())
111 w.LoadImageTexture(0, imgSpec.m_ImageOrImageSet);
116 class SCR_ButtonEffectImage_ImageOrImageSet
119 ResourceName m_ImageOrImageSet;
128 void SCR_ButtonEffectImage_ImageOrImageSet(ResourceName resource =
string.Empty,
string imageName =
string.Empty)
130 if (!resource.IsEmpty())
131 m_ImageOrImageSet = resource;
133 if (!imageName.IsEmpty())
134 m_ImageName = imageName;