DayZ
1.24
Loading...
Searching...
No Matches
PluginDrawCheckerboard.c
Go to the documentation of this file.
1
// quick and dirty way for displaying of checker overlay on screen
2
// - userd for camera settings primarily
3
class
PluginDrawCheckerboard
extends
PluginBase
4
{
5
private
ref
Widget
m_MainWindow
;
6
private
bool
m_IsActive
;
7
8
9
void
PluginDrawCheckerboard
()
10
{
11
CreateWidgetOverlay
();
12
}
13
14
void
~PluginDrawCheckerboard
() {}
15
16
void
CreateWidgetOverlay
()
17
{
18
#ifndef NO_GUI
19
if
(!m_MainWindow)
20
{
21
m_MainWindow =
GetGame
().GetWorkspace().CreateWidgets(
"gui/layouts/camera_checkerboard.layout"
);
22
m_MainWindow.Show(
false
);
23
int
childId
= 0;
24
int
row
= 0;
25
bool
evenOrOdd
;
26
int
tilesPerLine
= 8;
27
28
Widget
child
= m_MainWindow.GetChildren();
29
while
(
child
)
30
{
31
evenOrOdd
=
IsEven
(
childId
);
32
34
if
(
childId
> (
tilesPerLine
*
row
) - 1)
35
row
++;
36
37
if
(
IsEven
(
row
))
38
evenOrOdd
= !
evenOrOdd
;
39
41
if
(
evenOrOdd
)
42
child
.SetAlpha(0.15);
43
else
44
child
.SetAlpha(0.05);
45
46
child
=
child
.GetSibling();
47
childId
++;
48
}
49
}
50
#endif
51
}
52
53
bool
IsActive
()
54
{
55
return
m_IsActive
;
56
}
57
59
bool
IsEven
(
int
num
)
60
{
61
if
((
num
% 2) == 0)
62
return
true
;
63
else
64
return
false
;
65
}
66
67
void
ShowWidgets
(
bool
show)
68
{
69
if
(m_MainWindow)
70
m_MainWindow.Show(show);
71
}
72
74
void
Show
()
75
{
76
ShowWidgets
(
true
);
77
m_IsActive
=
true
;
78
}
79
81
void
Hide
()
82
{
83
ShowWidgets
(
false
);
84
m_IsActive
=
false
;
85
}
86
}
m_IsActive
bool m_IsActive
Definition
ModifierBase.c:20
Param3
Definition
EntityAI.c:95
PluginBase
Definition
PluginBase.c:2
PluginBase::m_MainWindow
ref Widget m_MainWindow
Definition
PluginDrawCheckerboard.c:5
PluginBase::PluginDrawCheckerboard
void PluginDrawCheckerboard()
Definition
PluginDrawCheckerboard.c:9
PluginBase::IsEven
bool IsEven(int num)
even or odd
Definition
PluginDrawCheckerboard.c:59
PluginBase::ShowWidgets
void ShowWidgets(bool show)
Definition
PluginDrawCheckerboard.c:67
PluginBase::~PluginDrawCheckerboard
void ~PluginDrawCheckerboard()
Definition
PluginDrawCheckerboard.c:14
PluginBase::m_IsActive
bool m_IsActive
Definition
PluginDayZInfectedDebug.c:43
PluginBase::Hide
void Hide()
Definition
PluginDrawCheckerboard.c:81
PluginBase::IsActive
bool IsActive()
Definition
PluginDrawCheckerboard.c:53
PluginBase::CreateWidgetOverlay
void CreateWidgetOverlay()
Definition
PluginDrawCheckerboard.c:16
PluginBase::Show
void Show()
Definition
PluginDrawCheckerboard.c:74
Widget
Definition
EnWidgets.c:190
GetGame
proto native CGame GetGame()
scripts
4_World
Plugins
PluginBase
PluginDeveloper
PluginDrawCheckerboard.c
Generated by
1.10.0