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

◆ ScrollToEntry()

void ScriptedWidgetEventHandler::ScrollToEntry ( PlayerListEntryScriptedWidget entry)
inlineprotected

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

288 {
289 if ( entry )
290 {
291 float x, y;
292 float x_s, y_s;
293 float x_l, y_l;
294
295 Widget root = entry.GetButtonWidget().GetParent();
296 Widget first_child = root.GetParent().GetChildren();
297 Widget last_child = first_child;
298 while ( last_child )
299 {
300 if ( last_child.GetSibling() )
301 last_child = last_child.GetSibling();
302 else
303 break;
304 }
305
306 root.GetParent().Update();
307 root.Update();
308
309 m_ScrollContainer.GetScreenPos( x, y );
310 m_ScrollContainer.GetScreenSize( x_s, y_s );
311
312 float bottom_pos = y + y_s;
313
314 root.GetScreenPos( x_l, y_l );
315 root.GetScreenSize( x_s, y_s );
316
317 if ( root == first_child )
318 {
319 m_ScrollContainer.VScrollToPos01( 0 );
320 }
321 else if ( root == last_child )
322 {
323 m_ScrollContainer.VScrollToPos01( 1 );
324 }
325 else if ( y_l + y_s >= bottom_pos )
326 {
327 m_ScrollContainer.VScrollToPos( m_ScrollContainer.GetVScrollPos() + y_s );
328 }
329 else if ( y_l <= y )
330 {
331 m_ScrollContainer.VScrollToPos( m_ScrollContainer.GetVScrollPos() - y_s );
332 }
333 }
334 }
Icon x
Icon y
ScrollWidget m_ScrollContainer
Определения PlayerListScriptedWidget.c:4
WorkspaceWidget Widget
Defined in code.

Перекрестные ссылки m_ScrollContainer, PlayerListEntryScriptedWidget(), x и y.

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