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

◆ Select()

override bool ZombieContainer::Select ( )
inlineprotected

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

670 {
671 if( GetFocusedContainer().IsInherited( ContainerWithCargo ) || GetFocusedContainer().IsInherited( ContainerWithCargoAndAttachments ) )
672 {
673 return GetFocusedContainer().Select();
674 }
675 else
676 {
677 SlotsIcon selected_slot = ItemManager.GetInstance().GetSelectedIcon();
678 EntityAI focused_item = GetFocusedItem();
679 EntityAI selected_item = ItemManager.GetInstance().GetSelectedItem();
680 if( !(selected_slot && selected_slot.IsOutOfReach() ) )
681 {
682 if( selected_item )
683 {
684 if( selected_item != focused_item)
685 {
686 if( selected_item.GetInventory().CanRemoveEntity() )
687 {
688 GetGame().GetPlayer().PredictiveTakeEntityToTargetInventory( m_ZombieEntity, FindInventoryLocationType.ANY, selected_item );
689 ItemManager.GetInstance().SetSelectedItemEx(null, null, null);
690 return true;
691 }
692 }
693 }
694 else
695 {
696 if( focused_item && focused_item.GetInventory().CanRemoveEntity() )
697 {
698 EntityAI item_in_hands = GetGame().GetPlayer().GetHumanInventory().GetEntityInHands();
699 if( item_in_hands && item_in_hands.GetInventory().CanRemoveEntity() )
700 {
701 if( GameInventory.CanSwapEntitiesEx( item_in_hands, focused_item ) )
702 {
703 GetGame().GetPlayer().PredictiveSwapEntities( item_in_hands, focused_item );
704 return true;
705 }
706 else
707 {
708 InventoryLocation il_hands_dst = new InventoryLocation;
709 if( GetGame().GetPlayer().GetHumanInventory().FindFreeLocationFor( item_in_hands, FindInventoryLocationType.ANY, il_hands_dst ) )
710 {
711 InventoryMode invMode = InventoryMode.PREDICTIVE;
712
713 if ( GetGame().GetPlayer().NeedInventoryJunctureFromServer(item_in_hands, item_in_hands.GetHierarchyParent(), il_hands_dst.GetParent()) || GetGame().GetPlayer().NeedInventoryJunctureFromServer(focused_item, focused_item.GetHierarchyParent(), GetGame().GetPlayer()) )
714 invMode = InventoryMode.JUNCTURE;
715
716 GetGame().GetPlayer().GetHumanInventory().ForceSwapEntities( InventoryMode.JUNCTURE, focused_item, item_in_hands, il_hands_dst );
717 return true;
718 }
719 }
720 }
721 else
722 {
723 if( GetGame().GetPlayer().GetHumanInventory().CanAddEntityInHands( focused_item ) )
724 {
725 GetGame().GetPlayer().PredictiveTakeEntityToHands( focused_item );
726 return true;
727 }
728 }
729 }
730 }
731 }
732 }
733 return false;
734 }
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
Определения Inventory.c:22
class LogManager EntityAI
FindInventoryLocationType
flags for searching locations in inventory
Определения InventoryLocation.c:17
PlayerBase GetPlayer()
Определения ModifierBase.c:51
proto native DayZPlayer GetPlayer()
override EntityAI GetFocusedItem()
Определения CargoContainer.c:733
proto native EntityAI GetParent()
returns parent of current inventory location
bool IsOutOfReach()
Определения SlotsIcon.c:729
EntityAI m_ZombieEntity
Определения ZombieContainer.c:7
proto native CGame GetGame()

Перекрестные ссылки GameInventory::CanSwapEntitiesEx(), Container::GetFocusedItem(), GetGame(), ItemManager::GetInstance(), InventoryLocation::GetParent(), CGame::GetPlayer(), GetPlayer(), ItemManager::GetSelectedIcon(), ItemManager::GetSelectedItem(), SlotsIcon::IsOutOfReach(), m_ZombieEntity и ItemManager::SetSelectedItemEx().