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

◆ OnDropReceivedFromHeader()

override void AttachmentCategoriesContainer::OnDropReceivedFromHeader ( Widget w,
int x,
int y,
Widget receiver )
inlineprotected

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

392 {
393 ItemPreviewWidget iw = ItemPreviewWidget.Cast(w.FindAnyWidget("Render"));
394 if (!iw)
395 {
396 string name = w.GetName();
397 name.Replace("PanelWidget", "Render");
398 iw = ItemPreviewWidget.Cast(w.FindAnyWidget(name));
399 }
400 if (!iw)
401 {
402 iw = ItemPreviewWidget.Cast(w);
403 }
404 if (!iw.GetItem())
405 return;
406 if (m_Entity.GetInventory().CanAddAttachment(iw.GetItem()) && iw.GetItem().GetInventory().CanRemoveEntity())
407 {
408 g_Game.GetPlayer().PredictiveTakeEntityToTargetAttachment( m_Entity, iw.GetItem() );
409 }
410 else if (m_Entity.GetInventory().CanAddEntityToInventory(iw.GetItem()) && iw.GetItem().GetInventory().CanRemoveEntity())
411 {
412 g_Game.GetPlayer().PredictiveTakeEntityToTargetInventory( m_Entity, FindInventoryLocationType.ANY, iw.GetItem() );
413 }
414 }
Entity m_Entity
Определения CachedEquipmentStorageBase.c:16
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
DayZGame g_Game
Определения DayZGame.c:4074
FindInventoryLocationType
flags for searching locations in inventory
Определения InventoryLocation.c:18
proto native GameInventory GetInventory()
proto native bool CanAddAttachment(notnull EntityAI e)
Check if attachment can be added to any slot.
bool CanAddEntityToInventory(notnull EntityAI item, int flag=FindInventoryLocationType.ANY)
ask inventory if item could be placed somewhere in inventory
proto native EntityAI GetItem()

Перекрестные ссылки g_Game, ItemPreviewWidget::GetItem(), m_Entity, name, x и y.