823 {
825 {
827 {
828 g_Game.GetPlayer().GetHumanInventory().ClearUserReservedLocationSynced(
m_Item);
829 }
831 {
832 #ifdef DIAG_DEVELOPER
835 else
836 #endif
837 {
839
842 }
843 }
844
845 }
847 {
848 switch (button)
849 {
852 break;
853
855 PlayerBase controlledPlayer = PlayerBase.Cast(
g_Game.GetPlayer());
856 if (
g_Game.IsLeftCtrlDown())
857 {
858 if (controlledPlayer.CanDropEntity(
m_Item))
859 {
860 if (
m_Item.GetTargetQuantityMax() <
m_Item.GetQuantity())
861 m_Item.SplitIntoStackMaxClient(null, -1);
862 else
863 controlledPlayer.PhysicalPredictiveDropItem(
m_Item);
864
865 ItemManager.GetInstance().SetWidgetDraggable(w, false);
866 }
867 }
868 else
869 {
870 InventoryLocation il = new InventoryLocation();
871 m_Obj.GetInventory().GetCurrentInventoryLocation(il);
872
873 bool draggable = !controlledPlayer.GetInventory().HasInventoryReservation(
m_Obj, null) && !controlledPlayer.GetInventory().IsInventoryLocked() && !controlledPlayer.IsItemsToDelete();
874 draggable = draggable && (
m_Obj.GetHierarchyRoot() &&
m_Obj.GetInventory().CanRemoveEntity() || !
m_Obj.GetHierarchyRoot() && AttachmentsOutOfReach.IsAttachmentReachable(
m_Obj,
"", il.
GetSlot()));
875
876 ItemManager.GetInstance().SetWidgetDraggable(w, draggable);
877 }
878 break;
879 }
880 }
881 }
proto native int GetSlot()
returns slot id if current type is Attachment