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

◆ OnDropReceivedFromHeader()

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

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

398 {
399 ItemPreviewWidget iw = ItemPreviewWidget.Cast( w.FindAnyWidget("Render") );
400 if(!iw)
401 {
402 string name = w.GetName();
403 name.Replace("PanelWidget", "Render");
404 iw = ItemPreviewWidget.Cast( w.FindAnyWidget(name) );
405 }
406 if(!iw)
407 {
408 iw = ItemPreviewWidget.Cast( w );
409 }
410 if( !iw.GetItem() )
411 return;
412 if( m_Entity.GetInventory().CanAddAttachment( iw.GetItem() ) && iw.GetItem().GetInventory().CanRemoveEntity() )
413 {
414 g_Game.GetPlayer().PredictiveTakeEntityToTargetAttachment( m_Entity, iw.GetItem() );
415 }
416 else if( m_Entity.GetInventory().CanAddEntityToInventory( iw.GetItem() ) && iw.GetItem().GetInventory().CanRemoveEntity() )
417 {
418 g_Game.GetPlayer().PredictiveTakeEntityToTargetInventory( m_Entity, FindInventoryLocationType.ANY, iw.GetItem() );
419 }
420 }
Entity m_Entity
Определения CachedEquipmentStorageBase.c:14
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
DayZGame g_Game
Определения DayZGame.c:3942
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.