657 {
662
664 {
666 icon.GetMainWidget().Show(false);
667 }
668 else if (!item)
669 {
671
673 if (cont)
674 {
676 this.Remove(cont);
677 (
Container.Cast(cont.m_Parent)).Remove(cont);
678 }
679 icon.GetMainWidget().Show(true);
680 }
681 else
682 {
683 icon.GetMainWidget().Show(true);
685 {
687 }
688 else
689 {
691 }
692
694 if (cont && cont.GetEntity() != item)
695 {
697 (
Container.Cast(cont.m_Parent)).Remove(cont);
698 this.Remove(cont);
699 cont = null;
700 }
701
702 if (!cont)
703 {
705 {
708 cont.SetEntity(item);
709 cont.SetSlotIcon(icon);
710
713
714 SetOpenForSlotIcon(cont.IsOpened(),icon);
715 }
716 }
717
718 if (cont)
719 {
721 }
722
723 string slotName = InventorySlots.GetSlotName(slot_id_);
724 bool draggable = true;
725 bool can_be_removed = item.GetInventory().CanRemoveEntity();
729 {
731 draggable = false;
732 }
733 else
734 {
736 }
737
739 {
740 draggable = false;
741 }
742
743 if ((in_hands_condition || in_vicinity_condition) && can_be_removed)
744 {
746 }
747 else
748 {
750 draggable = false;
751 }
752
753 if (draggable)
754 {
756 }
757 else
758 {
760 }
761 }
762 }
PlayerSpawnPreset slotName
bool IsCategoryReachable(EntityAI ent, string categoryName, float range=1.5)
ref AttachmentsGroupContainer m_AttachmentsContainer
ref map< int, ref ContainerWithCargo > m_AttachmentCargos
string GetCategoryIdentifier()
void ContainerWithCargo(LayoutHolder parent, int sort=-1)
proto native GameInventory GetInventory()
bool CanDisplayAttachmentSlot(int slot_id)
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)
override void ClearRemainSelected()
void SetContainer(Container container)
Widget GetRadialIconPanel()
Widget GetOutOfReachWidget()
ItemPreviewWidget GetRender()
Widget GetMountedWidget()
void Init(EntityAI obj, bool reservation=false)