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

◆ AddItem()

void ScriptedWidgetEventHandler::AddItem ( InventoryItem item,
vector data,
vector rotation )
inlineprivate

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

651 {
652 m_Items.Set(item, data);
653
654 int index = Math.Round(data[0]);
655 int width = Math.Round(data[1]);
656 int height = Math.Round(data[2]);
657
658 Widget bck = GetItemBackground(index);
659 Widget item_w_bck = GetGame().GetWorkspace().CreateWidgets("gui/layouts/inventory/inventoryGridItem.layout", bck);
660 Widget item_w = item_w_bck.FindAnyWidget("GridItem");
661
662 bck.FindAnyWidget("LabelTR").Show( true );
663 bck.FindAnyWidget("LabelCC").Show( false );
664
665 m_ItemWidgets.Insert( index, item_w );
666
667 ResetItemWidget(item_w, width, height);
668
669 if ( item )
670 {
671 ItemPreviewWidget item_preview = ItemPreviewWidget.Cast( item_w.FindAnyWidget("Preview") );
672 item_preview.SetItem(item);
673 item_preview.SetModelOrientation( rotation );
674 item_preview.SetView( item_preview.GetItem().GetViewIndex() );
675
676 RefreshItemVariables( item, data, true, true );
677 }
678 }
proto native WorkspaceWidget GetWorkspace()
proto native void SetView(int viewIndex)
proto native void SetItem(EntityAI object)
proto native void SetModelOrientation(vector vOrientation)
proto native EntityAI GetItem()
ref map< int, Widget > m_ItemWidgets
Определения InventoryGrid.c:49
ref TItemsMap m_Items
Определения InventoryGrid.c:50
void RefreshItemVariables(InventoryItem item, vector data, bool show_quantity, bool show_temperature)
Определения InventoryGrid.c:584
void ResetItemWidget(Widget item_w, int width, int height)
Определения InventoryGrid.c:719
Widget GetItemBackground(int index)
Определения InventoryGrid.c:347
proto native CGame GetGame()
proto native external Widget CreateWidgets(string layout, Widget parentWidget=NULL, bool immedUpdate=true)
Create widgets from *.layout file.
WorkspaceWidget Widget
Defined in code.

Перекрестные ссылки WorkspaceWidget::CreateWidgets(), GetGame(), ItemPreviewWidget::GetItem(), GetItemBackground(), CGame::GetWorkspace(), m_Items, m_ItemWidgets, RefreshItemVariables(), ResetItemWidget(), Math::Round(), ItemPreviewWidget::SetItem(), ItemPreviewWidget::SetModelOrientation() и ItemPreviewWidget::SetView().

Используется в UpdateItems() и UpdateQuickbarItems().