656 {
661
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_ );
728 {
730 draggable = false;
731 }
732 else
733 {
735 }
736
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
void ContainerWithCargo(LayoutHolder parent, int sort=-1)
bool CanDisplayAttachmentSlot(string slot_name)
proto native GameInventory GetInventory()
bool CanReleaseAttachment(EntityAI attachment)
calls this->CanReleaseAttachment(attachment)
proto native EntityAI GetHierarchyRoot()
Returns root of current hierarchy (for example: if this entity is in Backpack on gnd,...
proto native bool GetSlotLock(int slot)
proto native EntityAI FindAttachment(int slot)
Returns attached entity in slot (you can use InventorySlots.GetSlotIdFromString(name) to get slot id)
void ClearRemainSelected()
ItemPreviewWidget GetRender()
void Init(EntityAI obj, bool reservation=false)
void SetContainer(Container container)
Widget GetMountedWidget()
Widget GetOutOfReachWidget()
Widget GetRadialIconPanel()