DayZ 1.28
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ CreateWidgetOverlay()

void PluginBase::CreateWidgetOverlay ( )
inlineprivate

row counter

sets alpha level for even/odd child

См. определение в файле PluginDrawCheckerboard.c строка 16

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 {
36 row++;
37 }
38
39 if(IsEven(row))
40 {
41 evenOrOdd = !evenOrOdd;
42 }
43
45 if(evenOrOdd)
46 child.SetAlpha(0.15);
47 else
48 child.SetAlpha(0.05);
49
50 child = child.GetSibling();
51 childId++;
52 }
53 }
54#endif
55 }
proto native WorkspaceWidget GetWorkspace()
ref Widget m_MainWindow
Определения PluginDrawCheckerboard.c:5
bool IsEven(int num)
even or odd
Определения PluginDrawCheckerboard.c:63
proto native CGame GetGame()
proto native external Widget CreateWidgets(string layout, Widget parentWidget=NULL, bool immedUpdate=true)
Create widgets from *.layout file.
WorkspaceWidget Widget
Defined in code.

Перекрестные ссылки WorkspaceWidget::CreateWidgets(), GetGame(), CGame::GetWorkspace(), IsEven() и m_MainWindow.

Используется в PluginDrawCheckerboard().