7 [
Attribute(
"false", UIWidgets.CheckBox,
"")]
8 protected bool m_bColorizeChildren;
10 [
Attribute(
"1 1 1 0", UIWidgets.ColorPicker,
"")]
11 protected ref Color m_ColorButtonDefault;
13 [
Attribute(
"1 1 1 1", UIWidgets.ColorPicker,
"")]
14 protected ref Color m_ColorButtonHovered;
16 [
Attribute(
"1 1 1 0", UIWidgets.ColorPicker,
"")]
17 protected ref Color m_ColorButtonDisabled;
19 [
Attribute(
"1 1 1 1", UIWidgets.ColorPicker,
"")]
20 protected ref Color m_ColorChildDefault;
22 [
Attribute(
"0 0 0 1", UIWidgets.ColorPicker,
"")]
23 protected ref Color m_ColorChildHovered;
25 [
Attribute(
"0.5 0.5 0.5 1", UIWidgets.ColorPicker,
"")]
26 protected ref Color m_ColorChildDisabled;
29 protected float m_fAnimationLength;
32 protected string m_sSoundClicked;
35 protected string m_sSoundHovered;
37 protected Widget m_wChild;
41 override void HandlerAttached(Widget w)
44 m_fAnimationLength = 1 / m_fAnimationLength;
48 w.SetColor(m_ColorButtonDisabled);
50 w.SetColor(m_ColorChildDisabled);
54 w.SetColor(m_ColorButtonDefault);
57 AnimateWidget.Color(m_wChild, m_ColorChildDefault, m_fAnimationLength);
63 override bool OnClick(Widget w,
int x,
int y,
int button)
70 override bool OnMouseEnter(Widget w,
int x,
int y)
73 AnimateWidget.Color(w, m_ColorButtonHovered, m_fAnimationLength);
74 if (m_bColorizeChildren && m_wChild)
75 AnimateWidget.Color(m_wChild, m_ColorChildHovered, m_fAnimationLength);
81 override bool OnMouseLeave(Widget w, Widget enterW,
int x,
int y)
83 AnimateWidget.Color(w, m_ColorButtonDefault, m_fAnimationLength);
84 if (m_bColorizeChildren && m_wChild)
85 AnimateWidget.Color(m_wChild, m_ColorChildDefault, m_fAnimationLength);