1 [
BaseContainerProps(configRoot :
true), SCR_ButtonEffectTitleAttribute(
"Color",
"m_sWidgetName")]
7 [
Attribute(defvalue:
"0.2", UIWidgets.EditBox,
"How fast each animation proceeds")]
8 protected float m_fAnimationTime;
17 ref Color m_cActivated;
20 ref Color m_cActivatedHovered;
23 ref Color m_cDisabled;
26 ref Color m_cDisabledActivated;
32 ref Color m_cFocusGained;
35 ref Color m_cFocusLost;
38 ref Color m_cToggledOn;
41 ref Color m_cToggledOff;
47 override void OnStateDefault(
bool instant)
50 Color color = m_cDefault;
52 color = m_cFocusGained;
54 Apply(color, instant);
58 override void OnStateHovered(
bool instant)
60 Apply(m_cHovered, instant);
64 override void OnStateActivated(
bool instant)
67 Color color = m_cActivated;
69 color = m_cFocusGained;
71 Apply(color, instant);
75 override void OnStateDisabled(
bool instant)
77 Apply(m_cDisabled, instant);
81 override void OnStateDisabledActivated(
bool instant)
83 Apply(m_cDisabledActivated, instant);
87 override void OnStateActivatedHovered(
bool instant)
89 Apply(m_cActivatedHovered, instant);
93 override void OnClicked(
bool instant)
95 Apply(m_cClicked, instant);
99 override void OnFocusGained(
bool instant)
101 Apply(m_cFocusGained, instant);
105 override void OnFocusLost(
bool instant)
108 Color color = m_cFocusLost;
110 color = m_cActivated;
113 Apply(color, instant);
117 override void OnToggledOn(
bool instant)
119 Apply(m_cToggledOn, instant);
123 override void OnToggledOff(
bool instant)
125 Apply(m_cToggledOff, instant);
130 override void OnDisabled()
132 AnimateWidget.StopAnimation(m_wTarget, WidgetAnimationColor);
136 protected void Apply(Color color,
bool instant)
138 if (color && m_wTarget)
140 if (!instant && m_fAnimationTime != 0)
142 AnimateWidget.Color(m_wTarget, color, 1 / m_fAnimationTime);
146 AnimateWidget.StopAnimation(m_wTarget, WidgetAnimationColor);
147 m_wTarget.SetColor(color);