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

◆ ScrollToEntry()

void ScrollToEntry ( ServerBrowserEntry entry)
protected

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

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

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

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