7 [
Attribute(
"1 1 1 0.05", UIWidgets.ColorPicker,
"")]
8 protected ref Color m_ColorButtonHovered;
10 [
Attribute(
"1 1 1 0.25", UIWidgets.ColorPicker,
"")]
11 protected ref Color m_ColorButtonHoveredFocused;
13 [
Attribute(
"1 1 1 1", UIWidgets.ColorPicker,
"")]
14 protected ref Color m_ColorChildHovered;
16 [
Attribute(
"0 0 0 1", UIWidgets.ColorPicker,
"")]
17 protected ref Color m_ColorChildHoveredFocused;
20 protected string m_sSoundHovered;
22 protected bool m_bIsHovered =
false;
25 override void HandlerDeattached(Widget w)
27 super.HandlerDeattached(w);
28 m_ColorButtonHovered =
null;
29 m_ColorChildHovered =
null;
30 m_ColorButtonHoveredFocused =
null;
31 m_ColorChildHoveredFocused =
null;
35 override bool OnMouseButtonUp(Widget w,
int x,
int y,
int button)
37 AnimateWidget.Color(w, m_ColorButtonHoveredFocused, m_fAnimationLength);
39 if (m_bColorizeChildren && m_wChild)
40 AnimateWidget.Color(m_wChild, m_ColorChildHoveredFocused, m_fAnimationLength);
46 override bool OnFocus(Widget w,
int x,
int y)
55 buttonColor = m_ColorButtonHoveredFocused;
56 childColor = m_ColorChildHoveredFocused;
60 buttonColor = m_ColorButtonFocused;
61 childColor = m_ColorChildFocused;
64 AnimateWidget.Color(w, buttonColor, m_fAnimationLength);
65 if (m_bColorizeChildren && m_wChild)
66 AnimateWidget.Color(m_wChild, childColor, m_fAnimationLength);
72 override bool OnFocusLost(Widget w,
int x,
int y)
80 buttonColor = m_ColorButtonHovered;
81 childColor = m_ColorChildHovered;
85 buttonColor = m_ColorButtonDefault;
86 childColor = m_ColorChildDefault;
89 AnimateWidget.Color(w, buttonColor, m_fAnimationLength);
90 if (m_bColorizeChildren && m_wChild)
91 AnimateWidget.Color(m_wChild, childColor, m_fAnimationLength);
97 override bool OnMouseEnter(Widget w,
int x,
int y)
106 buttonColor = m_ColorButtonHoveredFocused;
107 childColor = m_ColorChildHoveredFocused;
111 buttonColor = m_ColorButtonHovered;
112 childColor = m_ColorChildHovered;
115 AnimateWidget.Color(w, buttonColor, m_fAnimationLength);
116 if (m_bColorizeChildren && m_wChild)
117 AnimateWidget.Color(m_wChild, childColor, m_fAnimationLength);
123 override bool OnMouseLeave(Widget w, Widget enterW,
int x,
int y)
131 buttonColor = m_ColorButtonFocused;
132 childColor = m_ColorChildFocused;
136 buttonColor = m_ColorButtonDefault;
137 childColor = m_ColorChildDefault;
140 AnimateWidget.Color(w, buttonColor, m_fAnimationLength);
141 if (m_bColorizeChildren && m_wChild)
142 AnimateWidget.Color(m_wChild, childColor, m_fAnimationLength);