Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_AttributeButtonUIComponent.c
Go to the documentation of this file.
2{
4
5 protected string m_sButtonDescription;
6
7 protected bool m_bIsFocused;
8 protected bool m_bListeningToMouseLeft;
9 protected bool m_FocusUpdateBlocked;
10
11 protected const int MOUSE_LEFT_REMOVE_DESCRIPTION_DELAY = 50;
12
20 void ButtonDescriptionInit(SCR_ButtonBoxAttributeUIComponent attributeUIComponent, SCR_ButtonBaseComponent button, string buttonDescription, string buttonName = string.Empty)
21 {
22 m_AttributeUIComponent = attributeUIComponent;
23
24 if (!buttonDescription.IsEmpty())
25 m_sButtonDescription = buttonDescription;
26 else
27 m_sButtonDescription = buttonName;
28
29 button.m_OnShowBorder.Insert(OnButtonFocus);
30 }
31
32 protected void OnButtonFocus(SCR_ButtonBaseComponent button, bool value)
33 {
34 if (!value)
35 return;
36 }
37
38 override bool OnMouseEnter(Widget w, int x, int y)
39 {
40 m_bIsFocused = true;
42 return false;
43
44 if (!m_AttributeUIComponent.GetIsFocused())
45 return false;
46
47 m_AttributeUIComponent.ShowButtonDescription(this, true, m_sButtonDescription);
48 return false;
49 }
50
51 override bool OnMouseLeave(Widget w, Widget enterW, int x, int y)
52 {
53 m_bIsFocused = false;
54
56 {
59 }
60
61 return false;
62 }
63
64 protected void OnMouseLeaveDelay()
65 {
67
68 if (m_bIsFocused)
69 return;
70
72 return;
73
74 m_AttributeUIComponent.ShowButtonDescription(this, false);
75 }
76};
ArmaReforgerScripted GetGame()
Definition game.c:1398
SCR_ButtonBoxAttributeUIComponent m_AttributeUIComponent
override bool OnMouseLeave(Widget w, Widget enterW, int x, int y)
void OnButtonFocus(SCR_ButtonBaseComponent button, bool value)
override bool OnMouseEnter(Widget w, int x, int y)
void ButtonDescriptionInit(SCR_ButtonBoxAttributeUIComponent attributeUIComponent, SCR_ButtonBaseComponent button, string buttonDescription, string buttonName=string.Empty)
Base class for any button, regardless its own content.