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
3class PluginDrawCheckerboard extends PluginBase
4{
6 private bool m_IsActive;
7
8
13
15
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 {
32
34 if (childId > (tilesPerLine * row) - 1)
35 row++;
36
37 if (IsEven(row))
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}
bool m_IsActive
ref Widget m_MainWindow
void PluginDrawCheckerboard()
bool IsEven(int num)
even or odd
void ShowWidgets(bool show)
proto native CGame GetGame()