1 [
BaseContainerProps(configRoot :
true), SCR_ButtonEffectTitleAttribute(
"Padding",
"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;
39 override void OnStateDefault(
bool instant)
41 Apply(m_fDefault, instant);
45 override void OnStateHovered(
bool instant)
47 Apply(m_fHovered, instant);
51 override void OnStateActivated(
bool instant)
53 Apply(m_fActivated, instant);
57 override void OnStateActivatedHovered(
bool instant)
59 Apply(m_fActivatedHovered, instant);
63 override void OnStateDisabled(
bool instant)
65 Apply(m_fDisabled, instant);
69 override void OnStateDisabledActivated(
bool instant)
71 Apply(m_fDisabled, instant);
75 override void OnFocusGained(
bool instant)
77 Apply(m_fFocusGained, instant);
81 override void OnFocusLost(
bool instant)
83 Apply(m_fFocusLost, instant);
87 override void OnToggledOn(
bool instant)
89 Apply(m_fToggledOn, instant);
93 override void OnToggledOff(
bool instant)
95 Apply(m_fToggledOff, instant);
100 override void OnDisabled()
102 AnimateWidget.StopAnimation(m_wTarget, WidgetAnimationPadding);
106 protected void Apply(
float value,
bool instant)
110 if (!instant && m_fAnimationTime != 0)
112 float padding[4] = {value, value, value, value};
113 AnimateWidget.Padding(m_wTarget, padding, 1/m_fAnimationTime);
117 AnimateWidget.StopAnimation(m_wTarget, WidgetAnimationPadding);
118 AlignableSlot.SetPadding(m_wTarget, value, value, value, value);