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

◆ UpdateItems()

void ScriptedWidgetEventHandler::UpdateItems ( TItemsMap items,
bool show_quantity,
bool show_temperature )
inlineprivate

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

469 {
470 int i;
471 int c;
472 int index;
473 int width;
474 int height;
475 int row;
476 int col;
477 InventoryItem item;
478 vector data;
479 Widget bck;
480 Widget item_w;
481
482 // remove not actual items
483 c = m_Items.Count();
484 for (i = 0; i < c; i++)
485 {
486 item = m_Items.GetKey(i);
487
488 bool remove_item = false;
489
490 if (items.Contains(item) == false)
491 {
492 remove_item = true;
493 }
494 else
495 {
496 // check items position actual
497 if ((m_Items.Get(item) - items.Get(item)).LengthSq() > 0.01)
498 {
499 // item has different position or size
500 remove_item = true;
501 }
502 }
503
504 if (remove_item)
505 {
506 RemoveItem(item);
507 c--;
508 i--;
509 }
510 }
511
512 // add new items
513 for (i = 0; i < items.Count(); i++)
514 {
515 item = items.GetKey(i);
516 data = items.Get(item);
517
518 if (m_Items.Contains(item) == false)
519 {
520 AddItem(item, data, Vector(0,0,0) );
521 }
522 }
523
524 // add new items
525 for (i = 0; i < items.Count(); i++)
526 {
527 item = items.GetKey(i);
528 data = items.Get(item);
529 // refresh quantity
530 RefreshItemVariables( item, data, show_quantity, show_temperature );
531 }
532 }
void AddItem(InventoryItem item, vector data, vector rotation)
Определения InventoryGrid.c:650
void RemoveItem(InventoryItem item)
Определения InventoryGrid.c:750
ref TItemsMap m_Items
Определения InventoryGrid.c:50
void RefreshItemVariables(InventoryItem item, vector data, bool show_quantity, bool show_temperature)
Определения InventoryGrid.c:584
proto native vector Vector(float x, float y, float z)
Vector constructor from components.
WorkspaceWidget Widget
Defined in code.

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