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_CursorCustom.c
Go to the documentation of this file.
1
//------------------------------------------------------------------------------------------------
3
class
SCR_CursorCustom
4
{
5
const
int
REAL_CURSOR_HIDE = 12;
// "empty" visual ID of real cursor used to "hide" it
6
const
string
layoutPath =
"{80F7ED5410342195}UI/layouts/Map/CursorCustom.layout"
;
7
8
protected
bool
m_bIsVisible
;
9
protected
Widget
m_wRoot
;
10
protected
Widget
m_wCursor
;
11
protected
ImageWidget
m_wCursorImage
;
12
13
//------------------------------------------------------------------------------------------------
16
void
SetCursorVisual
(SCR_CursorVisualState stateCfg)
17
{
18
if
(!stateCfg)
19
{
20
WidgetManager
.SetCursor(0);
21
m_bIsVisible
=
false
;
22
m_wRoot
.SetVisible(
false
);
23
return
;
24
}
25
else
if
(!
m_bIsVisible
)
26
{
27
WidgetManager
.SetCursor(REAL_CURSOR_HIDE);
28
m_bIsVisible
=
true
;
29
m_wRoot
.SetVisible(
true
);
30
}
31
32
if
(
SCR_MapCursorInfo
.isGamepad && !stateCfg.m_sImageQuadController.IsEmpty())
33
m_wCursorImage
.LoadImageFromSet(0, stateCfg.m_sCursorIconsImageset, stateCfg.m_sImageQuadController);
34
else
35
m_wCursorImage
.LoadImageFromSet(0, stateCfg.m_sCursorIconsImageset, stateCfg.m_sImageQuad);
36
37
AlignableSlot
.SetPadding(
m_wCursorImage
, stateCfg.m_fPaddingLeft, stateCfg.m_fPaddingTop, 0, 0);
38
39
m_wCursorImage
.SetColor(stateCfg.m_Color);
40
}
41
42
//------------------------------------------------------------------------------------------------
44
void
SetOpacity
(
float
opacity)
45
{
46
m_wCursorImage
.SetOpacity(opacity);
47
}
48
49
//------------------------------------------------------------------------------------------------
51
void
Update
(
float
x,
float
y)
52
{
53
FrameSlot
.SetPos(
m_wCursor
, x, y);
54
}
55
56
//------------------------------------------------------------------------------------------------
57
void
SCR_CursorCustom
()
58
{
59
m_wRoot
=
GetGame
().GetWorkspace().CreateWidgets(layoutPath);
60
m_wCursor
=
m_wRoot
.FindAnyWidget(
"CursorWidget"
);
61
m_wCursorImage
=
ImageWidget
.Cast(
m_wRoot
.FindAnyWidget(
"CursorImage"
));
62
}
63
64
//------------------------------------------------------------------------------------------------
65
void
~SCR_CursorCustom
()
66
{
67
m_wCursorImage
.RemoveFromHierarchy();
68
m_wRoot
.RemoveFromHierarchy();
69
}
70
71
};
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
AlignableSlot
Definition
AlignableSlot.c:13
FrameSlot
Definition
FrameSlot.c:13
ImageWidget
Definition
ImageWidget.c:13
SCR_CursorCustom::SetOpacity
void SetOpacity(float opacity)
Set opacity.
Definition
SCR_CursorCustom.c:44
SCR_CursorCustom::m_wRoot
Widget m_wRoot
Definition
SCR_CursorCustom.c:9
SCR_CursorCustom::Update
void Update(float x, float y)
Update position, has to be called manually.
Definition
SCR_CursorCustom.c:51
SCR_CursorCustom::SCR_CursorCustom
void SCR_CursorCustom()
Definition
SCR_CursorCustom.c:57
SCR_CursorCustom::m_bIsVisible
bool m_bIsVisible
Definition
SCR_CursorCustom.c:8
SCR_CursorCustom::m_wCursorImage
ImageWidget m_wCursorImage
Definition
SCR_CursorCustom.c:11
SCR_CursorCustom::SetCursorVisual
void SetCursorVisual(SCR_CursorVisualState stateCfg)
Definition
SCR_CursorCustom.c:16
SCR_CursorCustom::m_wCursor
Widget m_wCursor
Definition
SCR_CursorCustom.c:10
SCR_CursorCustom::~SCR_CursorCustom
void ~SCR_CursorCustom()
Definition
SCR_CursorCustom.c:65
SCR_MapCursorInfo
Cursor data.
Definition
SCR_MapCursorModule.c:4
Widget
Definition
Widget.c:13
WidgetManager
Definition
WidgetManager.c:16
scripts
Game
UI
SCR_CursorCustom.c
Generated by
1.17.0