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

◆ ScrollToEntry()

void ScrollToEntry ( ServerBrowserEntry entry)
protected

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

146 {
147 if ( entry )
148 {
149 float x, y;
150 float x_s, y_s;
151 float x_l, y_l;
152
153 Widget root = entry.GetRoot();
154 Widget first_child = root.GetParent().GetChildren();
155 Widget last_child = first_child;
156 while ( last_child )
157 {
158 if ( last_child.GetSibling() )
159 last_child = last_child.GetSibling();
160 else
161 break;
162 }
163
164 root.GetParent().Update();
165 root.Update();
166
167 m_ServerListScroller.GetScreenPos( x, y );
168 m_ServerListScroller.GetScreenSize( x_s, y_s );
169
170 float bottom_pos = y + y_s;
171
172 root.GetScreenPos( x_l, y_l );
173 root.GetScreenSize( x_s, y_s );
174
175 if ( root == first_child )
176 {
177 m_ServerListScroller.VScrollToPos01( 0 );
178 }
179 else if ( root == last_child )
180 {
181 m_ServerListScroller.VScrollToPos01( 1 );
182 }
183 else if ( y_l + y_s >= bottom_pos )
184 {
185 m_ServerListScroller.VScrollToPos( m_ServerListScroller.GetVScrollPos() + y_s );
186 }
187 else if ( y_l <= y )
188 {
189 m_ServerListScroller.VScrollToPos( m_ServerListScroller.GetVScrollPos() - y_s );
190 }
191 }
192 }
Icon x
Icon y
ScrollWidget m_ServerListScroller
Определения ServerBrowserTab.c:27
Определения EnWidgets.c:190

Перекрестные ссылки m_ServerListScroller, x и y.

Используется в Focus(), ServerBrowserTab::Focus() и SelectServer().