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

◆ UpdateQuickbarItems()

void ScriptedWidgetEventHandler::UpdateQuickbarItems ( TItemsMap items)
inlineprivate

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

397 {
398 int i;
399 int c;
400 int index;
401 int width;
402 int height;
403 int row;
404 int col;
405 InventoryItem item;
406 vector data;
407 Widget bck;
408 Widget item_w;
409
410 // remove not actual items
411 c = m_Items.Count();
412 for (i = 0; i < c; i++)
413 {
414 item = m_Items.GetKey(i);
415 if( item != NULL )
416 {
417 bool remove_item = false;
418
419 if (items.Contains(item) == false)
420 {
421 remove_item = true;
422 }
423 else
424 {
425 // check items position actual
426 if ((m_Items.Get(item) - items.Get(item)).LengthSq() > 0.01)
427 {
428 // item has different position or size
429 remove_item = true;
430 }
431 }
432
433 if (remove_item)
434 {
435 RemoveItem(item);
436 c--;
437 i--;
438 }
439 }
440 }
441
442 // add new items
443 for (i = 0; i < items.Count(); i++)
444 {
445 item = items.GetKey(i);
446 data = items.Get(item);
447
448 if (m_Items.Contains(item) == false)
449 {
450 AddItem(item, data, Vector(0,0,0) );
451 }
452 }
453
454 // cache if entity in hands can be added to inventory
455 m_CanAddItemInHandToInventory = m_Controller.CanAddItemInHandToInventory();
456
457 // refresh quickbar
458 for (i = 0; i < items.Count(); i++)
459 {
460 item = items.GetKey(i);
461 data = items.Get(item);
462 RefreshQuickbarItemVariables( item, data );
463 }
464 }
bool m_CanAddItemInHandToInventory
Определения InventoryGrid.c:57
void AddItem(InventoryItem item, vector data, vector rotation)
Определения InventoryGrid.c:650
void RefreshQuickbarItemVariables(InventoryItem item, vector data)
Определения InventoryGrid.c:567
InventoryGridController m_Controller
Определения InventoryGrid.c:51
void RemoveItem(InventoryItem item)
Определения InventoryGrid.c:750
ref TItemsMap m_Items
Определения InventoryGrid.c:50
proto native vector Vector(float x, float y, float z)
Vector constructor from components.
WorkspaceWidget Widget
Defined in code.

Перекрестные ссылки AddItem(), m_CanAddItemInHandToInventory, m_Controller, m_Items, RefreshQuickbarItemVariables(), RemoveItem() и Vector().