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

◆ Update()

void AutoHeightSpacer::Update ( )
inlineprotected

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

12 {
13 float x = 0;
14 float y = 0;
15 float width = 0;
16 float height = 0;
17 float heightOld = 0;
18 float top = Top;
19 float rowRight;
20 float rowHeight;
21 float rowWidth;
22 Widget child = m_root.GetChildren();
23
24 //PrintString(m_root.GetName() + ": AutoHeightSpacer::Update()");
25
26 if ( !AlignChilds ) top = -100000;
27
28 if (child != NULL)
29 {
30 // first row init
31 m_root.GetScreenSize(rowWidth, height);
32 rowHeight = 0;
33 rowRight = rowWidth;
34
35 while (child)
36 {
37 if (child.IsVisible() == false || child.GetName() == "SelectedContainer" || child.GetName() == "Icon")
38 {
39 // skip invisible widgets
40 child = child.GetSibling();
41 continue;
42 }
43
44 child.GetScreenSize(width, height);
45
46 if (AlignChilds)
47 {
48 child.SetFlags(WidgetFlags.EXACTPOS, false);
49
50 // no space left in this row, move to next one
51 if (rowRight < width)
52 {
53 top += rowHeight;
54 if ( rowHeight > 0 ) top += Gap;
55 rowRight = rowWidth;
56 rowHeight = 0;
57 }
58
59 // increase row height if necessary
60 if (height > rowHeight) rowHeight = height;
61
62 child.SetPos(rowWidth - rowRight, top, false);
63 rowRight -= width + Gap;
64 }
65 else
66 {
67 child.GetScreenPos(x, y);
68 y += height;
69 if (top < y) top = y;
70 }
71
72 child = child.GetSibling();
73 }
74
75 // add last row height;
76 top += rowHeight;
77
78 if (AlignChilds)
79 {
80 height = top;
81 }
82 else
83 {
84 m_root.GetScreenPos(x, y);
85 height = top - y;
86 }
87 }
88
89 m_root.GetSize(width, heightOld);
90
91 if (MaxHeight > 0 && height > MaxHeight)
92 {
93 height = MaxHeight;
94 }
95
96 if (MinHeight > height)
97 {
98 height = MinHeight;
99 }
100
101 if (Math.AbsInt(heightOld - height) > 1)
102 {
103 m_root.SetSize(width, height);
104 }
105 else if (AlignChilds)
106 {
107 m_root.Update();
108 }
109
110 return;
111 }
Icon x
Icon y
Widget m_root
Определения AutoHeightSpacer.c:9
reference float Top
Определения AutoHeightSpacer.c:8
reference int Gap
Определения AutoHeightSpacer.c:7
reference int MaxHeight
Определения AutoHeightSpacer.c:6
reference bool AlignChilds
Определения AutoHeightSpacer.c:4
reference int MinHeight
Определения AutoHeightSpacer.c:5
WidgetFlags
Определения EnWidgets.c:58
WorkspaceWidget Widget
Defined in code.

Перекрестные ссылки Math::AbsInt(), AlignChilds, Gap, m_root, MaxHeight, MinHeight, Top, x и y.

Используется в AddModifier(), HudDebugWinBase::AddValue(), InitEntityEntries(), OnChildRemove(), NoticeSpacer::OnEvent(), OnWidgetScriptInit(), ScriptedWidgetEventHandler::Show() и HudDebugWinBase::Update().