Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
BasicButtonComponent.c
Go to the documentation of this file.
2{
3 static const ref Color COLOR_DEFAULT = new Color(0, 0, 0, 0.6);
4 static const ref Color COLOR_FOCUSED = new Color(1, 1, 1, 0.06);
5 static const ref Color COLOR_HOVERED = new Color(1, 1, 1, 0.06);
6 static const ref Color COLOR_PRESSED = new Color(0.8, 0.8, 0.8, 0.06);
7
8 [Attribute(SCR_SoundEvent.FOCUS, UIWidgets.EditBox, "")]
9 protected string m_sSoundFocused;
10
11 [Attribute(SCR_SoundEvent.CLICK, UIWidgets.EditBox, "")]
12 protected string m_sSoundClicked;
13
14 //------------------------------------------------------------------------------------------------
15 override void HandlerAttached(Widget w)
16 {
17 w.SetColor(COLOR_DEFAULT);
18
19 if (!w.IsEnabled())
20 w.SetOpacity(0.5);
21 }
22
23 //------------------------------------------------------------------------------------------------
24 override bool OnClick(Widget w, int x, int y, int button)
25 {
27 AnimateWidget.Color(w, COLOR_PRESSED, UIConstants.FADE_RATE_DEFAULT);
28
29 return false;
30 }
31
32 //------------------------------------------------------------------------------------------------
33 override bool OnFocus(Widget w, int x, int y)
34 {
36 AnimateWidget.Color(w, COLOR_FOCUSED, UIConstants.FADE_RATE_DEFAULT);
37 return false;
38 }
39
40 //------------------------------------------------------------------------------------------------
41 override bool OnFocusLost(Widget w, int x, int y)
42 {
43 AnimateWidget.Color(w, COLOR_DEFAULT, UIConstants.FADE_RATE_DEFAULT);
44 return false;
45 }
46
47 //------------------------------------------------------------------------------------------------
48 override bool OnMouseEnter(Widget w, int x, int y)
49 {
50 GetGame().GetWorkspace().SetFocusedWidget(w);
51 return false;
52 }
53};
ArmaReforgerScripted GetGame()
Definition game.c:1398
static WidgetAnimationColor Color(Widget widget, Color color, float speed)
override bool OnClick(Widget w, int x, int y, int button)
override void HandlerAttached(Widget w)
override bool OnMouseEnter(Widget w, int x, int y)
override bool OnFocusLost(Widget w, int x, int y)
override bool OnFocus(Widget w, int x, int y)
Definition Color.c:13
SCR_FieldOfViewSettings Attribute