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

◆ DoubleClick()

void ZombieContainer::DoubleClick ( Widget w,
int x,
int y,
int button )
inlineprotected

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

536 {
537 if( button == MouseState.LEFT && !g_Game.IsLeftCtrlDown())
538 {
539 if( w == null )
540 {
541 return;
542 }
543 ItemPreviewWidget iw = ItemPreviewWidget.Cast( w.FindAnyWidget( "Render" ) );
544 if( !iw )
545 {
546 string name = w.GetName();
547 name.Replace( "PanelWidget", "Render" );
548 iw = ItemPreviewWidget.Cast( w.FindAnyWidget( name ) );
549 }
550
551 if( !iw )
552 {
553 iw = ItemPreviewWidget.Cast( w );
554 }
555
556 ItemBase item = ItemBase.Cast( iw.GetItem() );
557 if( !item )
558 {
559 return;
560 }
561
562 PlayerBase player = PlayerBase.Cast( GetGame().GetPlayer() );
563
564 if( player.GetInventory().HasInventoryReservation( item, null ) || player.IsItemsToDelete() )
565 {
566 return;
567 }
568
569 if( !item.GetInventory().CanRemoveEntity() )
570 return;
571
572 if ( player.GetInventory().HasEntityInInventory( item ) && GetGame().GetPlayer().GetHumanInventory().CanAddEntityInHands( item ) )
573 {
574 player.PredictiveTakeEntityToHands( item );
575 }
576 else
577 {
578 InventoryLocation il = new InventoryLocation;
579 if( player.GetInventory().FindFreeLocationFor( item, FindInventoryLocationType.ANY, il) )
580 {
581 if( item.GetTargetQuantityMax(il.GetSlot()) < item.GetQuantity() )
582 item.SplitIntoStackMaxToInventoryLocationClient( il );
583 else
584 player.PredictiveTakeEntityToInventory( FindInventoryLocationType.ANY, item );
585 }
586 else if( GetGame().GetPlayer().GetHumanInventory().CanAddEntityInHands( item ) )
587 {
588 if( item.GetTargetQuantityMax() < item.GetQuantity() )
589 item.SplitIntoStackMaxHandsClient( player );
590 else
591 player.PredictiveTakeEntityToHands( item );
592 }
593 }
594
595 HideOwnedTooltip();
596 InventoryMenu menu = InventoryMenu.Cast( GetGame().GetUIManager().FindMenu( MENU_INVENTORY ) );
597 if( menu )
598 {
599 menu.RefreshQuickbar();
600 }
601 }
602 }
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
DayZGame g_Game
Определения DayZGame.c:3868
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
Определения InventoryLocation.c:17
void InventoryMenu()
Определения InventoryMenu.c:20
PlayerBase GetPlayer()
Определения ModifierBase.c:51
proto native int GetSlot()
returns slot id if current type is Attachment
proto native EntityAI GetItem()
proto native CGame GetGame()
const int MENU_INVENTORY
Определения constants.c:180
MouseState
Определения EnSystem.c:311

Перекрестные ссылки g_Game, GetGame(), ItemPreviewWidget::GetItem(), GetPlayer(), InventoryLocation::GetSlot(), InventoryMenu(), MENU_INVENTORY, name, x и y.