Arma Reforger Explorer
1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Toggle main menu visibility
Loading...
Searching...
No Matches
SCR_AttributeButtonUIComponent.c
Go to the documentation of this file.
1
class
SCR_AttributeButtonUIComponent
:
ScriptedWidgetComponent
2
{
3
protected
SCR_ButtonBoxAttributeUIComponent
m_AttributeUIComponent
;
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
;
41
if
(!
m_AttributeUIComponent
)
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
55
if
(!
m_bListeningToMouseLeft
)
56
{
57
m_bListeningToMouseLeft
=
true
;
58
GetGame
().GetCallqueue().CallLater(
OnMouseLeaveDelay
,
MOUSE_LEFT_REMOVE_DESCRIPTION_DELAY
);
59
}
60
61
return
false
;
62
}
63
64
protected
void
OnMouseLeaveDelay
()
65
{
66
m_bListeningToMouseLeft
=
false
;
67
68
if
(
m_bIsFocused
)
69
return
;
70
71
if
(!
m_AttributeUIComponent
)
72
return
;
73
74
m_AttributeUIComponent
.ShowButtonDescription(
this
,
false
);
75
}
76
};
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
SCR_AttributeButtonUIComponent
Definition
SCR_AttributeButtonUIComponent.c:2
SCR_AttributeButtonUIComponent::MOUSE_LEFT_REMOVE_DESCRIPTION_DELAY
const int MOUSE_LEFT_REMOVE_DESCRIPTION_DELAY
Definition
SCR_AttributeButtonUIComponent.c:11
SCR_AttributeButtonUIComponent::m_AttributeUIComponent
SCR_ButtonBoxAttributeUIComponent m_AttributeUIComponent
Definition
SCR_AttributeButtonUIComponent.c:3
SCR_AttributeButtonUIComponent::OnMouseLeave
override bool OnMouseLeave(Widget w, Widget enterW, int x, int y)
Definition
SCR_AttributeButtonUIComponent.c:51
SCR_AttributeButtonUIComponent::OnButtonFocus
void OnButtonFocus(SCR_ButtonBaseComponent button, bool value)
Definition
SCR_AttributeButtonUIComponent.c:32
SCR_AttributeButtonUIComponent::m_bIsFocused
bool m_bIsFocused
Definition
SCR_AttributeButtonUIComponent.c:7
SCR_AttributeButtonUIComponent::m_sButtonDescription
string m_sButtonDescription
Definition
SCR_AttributeButtonUIComponent.c:5
SCR_AttributeButtonUIComponent::m_FocusUpdateBlocked
bool m_FocusUpdateBlocked
Definition
SCR_AttributeButtonUIComponent.c:9
SCR_AttributeButtonUIComponent::OnMouseEnter
override bool OnMouseEnter(Widget w, int x, int y)
Definition
SCR_AttributeButtonUIComponent.c:38
SCR_AttributeButtonUIComponent::m_bListeningToMouseLeft
bool m_bListeningToMouseLeft
Definition
SCR_AttributeButtonUIComponent.c:8
SCR_AttributeButtonUIComponent::ButtonDescriptionInit
void ButtonDescriptionInit(SCR_ButtonBoxAttributeUIComponent attributeUIComponent, SCR_ButtonBaseComponent button, string buttonDescription, string buttonName=string.Empty)
Definition
SCR_AttributeButtonUIComponent.c:20
SCR_AttributeButtonUIComponent::OnMouseLeaveDelay
void OnMouseLeaveDelay()
Definition
SCR_AttributeButtonUIComponent.c:64
SCR_ButtonBaseComponent
Base class for any button, regardless its own content.
Definition
SCR_ButtonBaseComponent.c:7
SCR_ButtonBaseComponent::m_OnShowBorder
ref ScriptInvoker m_OnShowBorder
Definition
SCR_ButtonBaseComponent.c:60
SCR_ButtonBoxAttributeUIComponent
Definition
SCR_ButtonBoxAttributeUIComponent.c:4
ScriptedWidgetComponent
Definition
ScriptedWidgetComponent.c:13
Widget
Definition
Widget.c:13
scripts
Game
Editor
UI
Components
Attributes
SCR_AttributeButtonUIComponent.c
Generated by
1.17.0