1 [
BaseContainerProps(configRoot :
true), SCR_ButtonEffectTitleAttribute(
"Opacity",
"m_sWidgetName")]
5 [
Attribute(defvalue:
"0.2", UIWidgets.EditBox,
"Duration of animation")]
6 protected float m_fAnimationTime;
18 float m_fActivatedHovered;
24 float m_fDisabledActivated;
48 override void OnStateDefault(
bool instant)
50 Apply(m_fDefault, instant);
54 override void OnStateHovered(
bool instant)
56 Apply(m_fHovered, instant);
60 override void OnStateActivated(
bool instant)
62 Apply(m_fActivated, instant);
66 override void OnStateActivatedHovered(
bool instant)
68 Apply(m_fActivatedHovered, instant);
72 override void OnClicked(
bool instant)
74 Apply(m_fClicked, instant);
78 override void OnStateDisabled(
bool instant)
80 Apply(m_fDisabled, instant);
84 override void OnStateDisabledActivated(
bool instant)
86 Apply(m_fDisabledActivated, instant);
90 override void OnFocusGained(
bool instant)
92 Apply(m_fFocusGained, instant);
96 override void OnFocusLost(
bool instant)
98 Apply(m_fFocusLost, instant);
102 override void OnToggledOn(
bool instant)
104 Apply(m_fToggledOn, instant);
108 override void OnToggledOff(
bool instant)
110 Apply(m_fToggledOff, instant);
114 override void OnMouseEnter(
bool instant)
116 Apply(m_fMouseEnter, instant);
120 override void OnMouseLeave(
bool instant)
122 Apply(m_fMouseLeave, instant);
127 override void OnDisabled()
129 AnimateWidget.StopAnimation(m_wTarget, WidgetAnimationOpacity);
133 protected void Apply(
float value,
bool instant)
137 if (!instant && m_fAnimationTime != 0)
139 AnimateWidget.Opacity(m_wTarget, value, 1 / m_fAnimationTime);
143 AnimateWidget.StopAnimation(m_wTarget, WidgetAnimationOpacity);
144 m_wTarget.SetOpacity(value);