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

◆ ScrollToEntry()

void ScrollToEntry ( ServerBrowserEntry entry)
protected

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

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

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

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