656 {
661
662 if (!
m_Entity.CanDisplayAttachmentSlot(slot_id_))
663 {
665 icon.GetMainWidget().Show( false );
666 }
667 else if (!item)
668 {
670
672 if (cont)
673 {
676 (
Container.Cast( cont.m_Parent ) ).Remove( cont );
677 }
678 icon.GetMainWidget().Show(true);
679 }
680 else
681 {
682 icon.GetMainWidget().Show( true );
684 {
686 }
687 else
688 {
690 }
691
693 if( cont && cont.GetEntity() != item)
694 {
696 (
Container.Cast( cont.m_Parent ) ).Remove( cont );
698 cont = null;
699 }
700
701 if( !cont )
702 {
704 {
707 cont.SetEntity( item );
708 cont.SetSlotIcon( icon );
709
712
713 SetOpenForSlotIcon(cont.IsOpened(),icon);
714 }
715 }
716
717 if (cont)
718 {
720 }
721
722 string slot_name_ = InventorySlots.GetSlotName(slot_id_);
723 bool draggable = true;
724 bool can_be_removed = item.GetInventory().CanRemoveEntity();
726 bool in_vicinity_condition = AttachmentsOutOfReach.IsAttachmentReachable(
m_Entity, slot_name_ );
727 if(
m_Entity.GetInventory().GetSlotLock( slot_id_ ) && ItemManager.GetInstance().GetDraggedItem() != item )
728 {
730 draggable = false;
731 }
732 else
733 {
735 }
736
737 if( !
m_Entity.CanReleaseAttachment( item ) )
738 {
739 draggable = false;
740 }
741
742 if ((in_hands_condition || in_vicinity_condition) && can_be_removed)
743 {
745 }
746 else
747 {
749 draggable = false;
750 }
751
752 if( draggable )
753 {
755 }
756 else
757 {
759 }
760 }
761 }
void Remove(Object object)
ref AttachmentsGroupContainer m_AttachmentsContainer
ref map< int, ref ContainerWithCargo > m_AttachmentCargos
proto native DayZPlayer GetPlayer()
void ContainerWithCargo(LayoutHolder parent, int sort=-1)
void ClearRemainSelected()
ItemPreviewWidget GetRender()
void Init(EntityAI obj, bool reservation=false)
void SetContainer(Container container)
Widget GetMountedWidget()
Widget GetOutOfReachWidget()
Widget GetRadialIconPanel()
proto native CGame GetGame()