public void SetOneItem(ItemSlot slot_select, ItemSlot slot_target)
        {
            InventoryData inventory1 = slot_select.GetInventory();
            InventoryData inventory2 = slot_target.GetInventory();

            if (current_player != null && inventory1 != null && inventory2 != null)
            {
                InventoryItemData invdata = inventory1.GetItem(slot_select.index);
                if (invdata != null && invdata.quantity > 0 && slot_target.GetItem() == null)
                {
                    if (inventory2.type == InventoryType.Equipment)
                    {
                        current_player.Inventory.EquipItem(inventory1, slot_select.index);
                    }
                    else if (inventory1.type == InventoryType.Equipment && slot_select is EquipSlotUI)
                    {
                        EquipSlotUI eslot = (EquipSlotUI)slot_select;
                        current_player.Inventory.UnequipItemTo(inventory2, eslot.equip_slot, slot_target.index);
                    }
                    else
                    {
                        string uid = invdata.quantity > 1 ? UniqueID.GenerateUniqueID() : invdata.uid;
                        inventory1.RemoveItemAt(slot_select.index, 1);
                        inventory2.AddItemAt(invdata.item_id, slot_target.index, 1, invdata.durability, uid);
                    }

                    if (invdata.quantity <= 1)
                    {
                        CancelPlayerSelection();
                    }
                }
            }
        }
        protected override void RefreshPanel()
        {
            InventoryData inventory = GetInventory();

            if (inventory != null)
            {
                for (int i = 0; i < slots.Length; i++)
                {
                    EquipSlotUI slot = (EquipSlotUI)slots[i];
                    if (slot != null)
                    {
                        InventoryItemData invdata = inventory.GetItem((int)slot.equip_slot);
                        ItemData          idata   = ItemData.Get(invdata?.item_id);

                        if (invdata != null && idata != null)
                        {
                            slot.SetSlot(idata, invdata.quantity, selected_slot == slot.index || selected_right_slot == slot.index);
                            slot.SetDurability(idata.GetDurabilityPercent(invdata.durability), ShouldShowDurability(idata, invdata.durability));
                            slot.SetFilter(GetFilterLevel(idata, invdata.durability));
                        }
                        else
                        {
                            slot.SetSlot(null, 0, false);
                        }
                    }
                }
            }
        }
        public override void DoAction(PlayerCharacter character, ItemSlot slot)
        {
            ItemData      item      = slot.GetItem();
            InventoryData inventory = slot.GetInventory();

            if (item != null && item.type == ItemType.Equipment)
            {
                if (inventory.type == InventoryType.Equipment && slot is EquipSlotUI)
                {
                    EquipSlotUI eslot = (EquipSlotUI)slot;
                    character.Inventory.UnequipItem(eslot.equip_slot);
                }
                else
                {
                    character.Inventory.EquipItem(inventory, slot.index);
                }
            }
        }
        public void SwapItems(ItemSlot slot1, ItemSlot slot2)
        {
            InventoryData inventory1 = slot1.GetInventory();
            InventoryData inventory2 = slot2.GetInventory();

            if (inventory1 != null && inventory2 != null && current_player != null)
            {
                if (inventory2.type == InventoryType.Equipment)
                {
                    current_player.Inventory.EquipItem(inventory1, slot1.index);
                }
                else if (inventory1.type == InventoryType.Equipment && slot1 is EquipSlotUI)
                {
                    EquipSlotUI eslot = (EquipSlotUI)slot1;
                    current_player.Inventory.UnequipItemTo(inventory2, eslot.equip_slot, slot2.index);
                }
                else
                {
                    current_player.Inventory.SwapItems(inventory1, slot1.index, inventory2, slot2.index);
                }

                CancelPlayerSelection();
            }
        }