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

◆ UpdateItems()

void InventoryGridController::UpdateItems ( Widget quickbarGridWidget)
inlineprotected

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

20 {
21 if( !quickbarGridWidget )
22 {
23 return;
24 }
25
26 PlayerBase player = PlayerBase.Cast( GetGame().GetPlayer() );
27 if ( !player )
28 return;
29
30 int i;
31
32 // create grid and align it to center
33 if( !m_Grid )
34 {
35 quickbarGridWidget.GetScript( m_Grid );
36 m_Grid.SetController( this );
37 m_Grid.GenerateQuickBarBackgroundTiles( 10 );
38 }
39
40 m_Items.Clear();
41 InventoryItem item;
42
43 if( m_Grid )
44 {
45 if( m_Grid.GetGridSize() != player.GetQuickBarSize() )
46 {
47 m_Grid.SetGridSize( player.GetQuickBarSize() );
48 }
49 }
50
51 for( i = 0; i < m_Grid.GetGridSize(); i++)
52 {
53 item = InventoryItem.Cast( player.GetQuickBarEntity(i) );
54 if( item )
55 {
56 m_Items.Set( item, Vector(i, 1, 1) );
57 }
58 }
59
60 if( m_Grid )
61 {
62 m_Grid.UpdateQuickbarItems( m_Items );
63 }
64 }
PlayerBase GetPlayer()
Определения ModifierBase.c:51
ref TItemsMap m_Items
Определения InventoryQuickbar.c:4
InventoryGrid m_Grid
Определения InventoryQuickbar.c:5
proto native CGame GetGame()
proto native vector Vector(float x, float y, float z)
Vector constructor from components.

Перекрестные ссылки GetGame(), GetPlayer(), m_Grid, m_Items и Vector().

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