protected override void LoadDataInternal() { if (!isInitialized) { return; } InventoryData inventoryData = parentMenu.InventoryData; ItemData itemData = null; int count = 0; bool itemIconEnabled = false; bool locked = false; if (!slotId.isEquipmentSlot) { InventorySlotData inventorySlotData = inventoryData.GetInventorySlotData(slotId.inventorySlotId); if (!inventorySlotData.Empty) { itemData = inventorySlotData.Item; itemIconEnabled = true; } count = inventorySlotData.Count; } else if (slotId.isEquipmentSlot) { EquipmentSlotData eqSlotData = inventoryData.EquipmentData.GetEquipmentSlot(slotId.equipmentSlotType); if (!eqSlotData.Empty) { itemData = eqSlotData.Item; if (eqSlotData.Primary) { itemIconEnabled = true; } else { locked = true; } } } if (itemData != null) { if (itemData.IsType(ItemType.Weapon)) { UnitWeaponCombiner combiner = new UnitWeaponCombiner(parentMenu.UnitData, itemData.WeaponData); if (!combiner.CanUse) { locked = true; } } } if (itemIconEnabled) { itemIcon.enabled = true; itemIcon.texture = parentMenu.ItemIconAtlas; itemIcon.uvRect = parentMenu.GetItemIconUvRect(itemData); } else { itemIcon.enabled = false; } lockIcon.enabled = locked; if (count > 1) { countText.text = count.ToString(); } else { countText.text = ""; } nameText.text = eqSlotName; if (parentMenu.IsSelected(slotId)) { borderImage.color = selectedBorderColor; } else { borderImage.color = deselectedBorderColor; } }