977 {
978 ItemManager.GetInstance().HideDropzones();
979 ItemManager.GetInstance().SetIsDragging(false);
980 string name = w.GetName();
981 name.Replace(
"PanelWidget",
"Render");
982
983 ItemPreviewWidget targetIpw = ItemPreviewWidget.Cast(receiver.FindAnyWidget( "Render" ));
985 {
986 targetIpw = ItemPreviewWidget.Cast(receiver.GetParent().FindAnyWidget( "Render" ));
987 }
988
989 ItemPreviewWidget selectedIpw = ItemPreviewWidget.Cast(w.FindAnyWidget(
name ));
990 if (selectedIpw == null)
991 {
992 selectedIpw = ItemPreviewWidget.Cast(w.FindAnyWidget( "Render" ));
993 }
994 if (selectedIpw == null)
995 {
996 return;
997 }
998
999 InventoryItem targetEntity = InventoryItem.Cast(targetIpw.
GetItem());
1000 InventoryItem selectedEntity = InventoryItem.Cast(selectedIpw.
GetItem());
1001 if (!selectedEntity || !targetEntity)
1002 {
1003 return;
1004 }
1005
1007 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
1008
1009 InventoryLocation ilDst = new InventoryLocation();
1010 InventoryLocation ilSrc = new InventoryLocation();
1011 targetEntity.GetInventory().GetCurrentInventoryLocation(ilSrc);
1012 Icon icon = ItemManager.GetInstance().GetDraggedIcon();
1013
1014 int index = player.GetHumanInventory().FindUserReservedLocationIndex(targetEntity);
1015 if (index>=0)
1016 {
1017 player.GetHumanInventory().GetUserReservedLocation(index, ilDst);
1018
1019 if (GameInventory.CanForceSwapEntitiesEx( selectedEntity, ilSrc, targetEntity, ilDst ))
1020 {
1021 if (
m_HandsIcon && !player.GetInventory().HasInventoryReservation(itemInHands, null) && !player.IsItemsToDelete())
1022 {
1023 GetGame().
GetPlayer().PredictiveForceSwapEntities(selectedEntity, targetEntity, ilDst);
1024 return;
1025 }
1026 }
1027 }
1028 static int testedFlags = InventoryCombinationFlags.SWAP | InventoryCombinationFlags.FSWAP;
1029
1030 int chosenInventoryAction = ItemManager.GetChosenCombinationFlag(selectedEntity, targetEntity, testedFlags, ilDst);
1032 }
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
proto native DayZPlayer GetPlayer()
void Icon(LayoutHolder parent, bool hands_icon=false)
bool PerformCombination(EntityAI selectedEntity, EntityAI targetEntity, int combinationFlag, InventoryLocation ilSwapDst=null)
proto native CGame GetGame()