Arma Reforger Explorer
1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Toggle main menu visibility
Loading...
Searching...
No Matches
BasicButtonComponent.c
Go to the documentation of this file.
1
class
BasicButtonComponent
:
ScriptedWidgetComponent
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
{
26
SCR_UISoundEntity
.SoundEvent(
m_sSoundClicked
);
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
{
35
SCR_UISoundEntity
.SoundEvent(
m_sSoundFocused
);
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
};
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
AnimateWidget
Definition
AnimateWidget.c:3
AnimateWidget::Color
static WidgetAnimationColor Color(Widget widget, Color color, float speed)
Definition
AnimateWidget.c:200
BasicButtonComponent
Definition
BasicButtonComponent.c:2
BasicButtonComponent::m_sSoundClicked
string m_sSoundClicked
Definition
BasicButtonComponent.c:12
BasicButtonComponent::OnClick
override bool OnClick(Widget w, int x, int y, int button)
Definition
BasicButtonComponent.c:24
BasicButtonComponent::HandlerAttached
override void HandlerAttached(Widget w)
Definition
BasicButtonComponent.c:15
BasicButtonComponent::m_sSoundFocused
string m_sSoundFocused
Definition
BasicButtonComponent.c:9
BasicButtonComponent::OnMouseEnter
override bool OnMouseEnter(Widget w, int x, int y)
Definition
BasicButtonComponent.c:48
BasicButtonComponent::OnFocusLost
override bool OnFocusLost(Widget w, int x, int y)
Definition
BasicButtonComponent.c:41
BasicButtonComponent::OnFocus
override bool OnFocus(Widget w, int x, int y)
Definition
BasicButtonComponent.c:33
Color
Definition
Color.c:13
SCR_SoundEvent
Definition
SCR_SoundEvent.c:2
SCR_UISoundEntity
Definition
SCR_UISoundEntity.c:8
ScriptedWidgetComponent
Definition
ScriptedWidgetComponent.c:13
UIConstants
Definition
Constants.c:151
UIWidgets
Definition
attributes.c:40
Widget
Definition
Widget.c:13
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
scripts
Game
UI
Deprecated
BasicButtonComponent.c
Generated by
1.17.0