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_TileBaseComponent.c
Go to the documentation of this file.
1
class
SCR_TileBaseComponent
:
SCR_ScriptedWidgetComponent
2
{
3
[
Attribute
(
UIConstants
.ENABLED_WIDGET_SATURATION.ToString())]
4
float
m_fSaturationSelected;
5
6
[
Attribute
(
UIConstants
.DISABLED_WIDGET_SATURATION.ToString())]
7
float
m_fSaturationDeselected;
8
9
[
Attribute
(
UIColors
.GetColorAttribute(
UIColors
.NEUTRAL_INFORMATION),
UIWidgets
.ColorPicker)]
10
ref
Color
m_ColorSelected;
11
12
[
Attribute
(
"0.5 0.5 0.5 1"
,
UIWidgets
.ColorPicker)]
13
ref
Color
m_ColorDeselected;
14
15
[
Attribute
(
"0.2"
)]
16
float
m_fAnimationTime;
17
18
[
Attribute
(
"Image"
)]
19
string
m_sContentName;
20
21
ImageWidget
m_wImage;
22
float
m_fAnimationRate;
23
24
bool
m_bIsInErrorState;
25
26
ref
ScriptInvoker
m_OnFocused =
new
ScriptInvoker
();
27
ref
ScriptInvoker
m_OnFocusLost =
new
ScriptInvoker
();
28
29
//------------------------------------------------------------------------------------------------
30
override
void
HandlerAttached(
Widget
w)
31
{
32
super.HandlerAttached(w);
33
34
m_wImage =
ImageWidget
.Cast(w.FindAnyWidget(m_sContentName));
35
36
SetInitialAnimationRate();
37
38
// Set initial color
39
if
(!m_wImage)
40
return
;
41
42
m_wImage.SetColor(m_ColorDeselected);
43
m_wImage.SetSaturation(m_fSaturationDeselected);
44
}
45
46
//------------------------------------------------------------------------------------------------
47
private
void
SetInitialAnimationRate()
48
{
49
m_fAnimationRate =
SCR_WLibComponentBase
.
START_ANIMATION_RATE
;
50
GetGame
().GetCallqueue().CallLater(SetAnimationRate,
SCR_WLibComponentBase
.
START_ANIMATION_PERIOD
);
51
}
52
53
//------------------------------------------------------------------------------------------------
54
private
void
SetAnimationRate()
55
{
56
if
(m_fAnimationTime <= 0)
57
m_fAnimationRate = 1000;
58
else
59
m_fAnimationRate = 1 / m_fAnimationTime;
60
}
61
62
//------------------------------------------------------------------------------------------------
63
override
bool
OnFocus(
Widget
w,
int
x,
int
y)
64
{
65
if
(!m_bIsInErrorState)
66
{
67
AnimateWidget
.
Saturation
(m_wImage, m_fSaturationSelected, m_fAnimationRate);
68
AnimateWidget
.
Color
(m_wImage, m_ColorSelected, m_fAnimationRate);
69
}
70
71
m_OnFocused.Invoke(
this
);
72
return
super.OnFocus(w, x, y);
73
}
74
75
//------------------------------------------------------------------------------------------------
76
override
bool
OnFocusLost(
Widget
w,
int
x,
int
y)
77
{
78
AnimateWidget
.
Saturation
(m_wImage, m_fSaturationDeselected, m_fAnimationRate);
79
AnimateWidget
.
Color
(m_wImage, m_ColorDeselected, m_fAnimationRate);
80
m_OnFocusLost.Invoke(
this
);
81
return
super.OnFocusLost(w, x, y);
82
}
83
}
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
AnimateWidget::Saturation
static WidgetAnimationImageSaturation Saturation(Widget widget, float targetValue, float speed)
Definition
AnimateWidget.c:178
Color
Definition
Color.c:13
ImageWidget
Definition
ImageWidget.c:13
SCR_ScriptedWidgetComponent
Definition
SCR_ScriptedWidgetComponent.c:8
SCR_TileBaseComponent
Definition
SCR_TileBaseComponent.c:2
SCR_WLibComponentBase
Base class for all final Reforger interactive elements.
Definition
SCR_WLibComponentBase.c:9
SCR_WLibComponentBase::START_ANIMATION_PERIOD
static const float START_ANIMATION_PERIOD
Definition
SCR_WLibComponentBase.c:33
SCR_WLibComponentBase::START_ANIMATION_RATE
static const float START_ANIMATION_RATE
Definition
SCR_WLibComponentBase.c:32
UIColors
Definition
Constants.c:17
UIConstants
Definition
Constants.c:151
UIWidgets
Definition
attributes.c:40
Widget
Definition
Widget.c:13
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
ScriptInvoker
ScriptInvokerBase< func > ScriptInvoker
Definition
tools.c:134
scripts
Game
UI
Components
MainMenu
SCR_TileBaseComponent.c
Generated by
1.17.0