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

◆ ScrollToActiveContainer()

void HandsContainer::ScrollToActiveContainer ( Container active_container)
inlineprotected

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

161 {
162 if( !active_container )
163 return;
164 float x, y, y_s;
165 m_ScrollWidget.GetScreenPos( x, y );
166 m_ScrollWidget.GetScreenSize( x, y_s );
167 float amount;
168 float next_pos = active_container.GetFocusedContainerYScreenPos( true ) + active_container.GetFocusedContainerHeight( true );
169
170 if( next_pos > ( y + y_s ) )
171 {
172 amount = y + active_container.GetFocusedContainerYScreenPos( true );
173 m_ScrollWidget.VScrollToPos( m_ScrollWidget.GetVScrollPos() + active_container.GetFocusedContainerHeight( true ) + 2 );
174 }
175 else if( active_container.GetFocusedContainerYScreenPos( true ) < y )
176 {
177 amount = active_container.GetFocusedContainerYScreenPos( true ) - y;
178 m_ScrollWidget.VScrollToPos( m_ScrollWidget.GetVScrollPos() + amount - 2 );
179 }
180 }
Icon x
Icon y
override float GetFocusedContainerHeight(bool contents=false)
Определения CargoContainer.c:436
override float GetFocusedContainerYScreenPos(bool contents=false)
Определения CargoContainer.c:456
ScrollWidget m_ScrollWidget
Определения HandsContainer.c:18

Перекрестные ссылки Container::GetFocusedContainerHeight(), Container::GetFocusedContainerYScreenPos(), m_ScrollWidget, x и y.

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