void Refresh() { // Update labels and lists availableGoldLabel.Text = PlayerEntity.GetGoldAmount().ToString(); if (selectedItem == null) { itemNameLabel.Text = string.Empty; enchantmentCostLabel.Text = string.Empty; goldCostLabel.Text = string.Empty; } else { int totalEnchantmentCost = GetTotalEnchantmentCost(); int totalGoldCost = GetTotalGoldCost(); int itemEnchantmentPower = selectedItem.GetEnchantmentPower(); enchantmentCostLabel.Text = string.Format("{0}/{1}", totalEnchantmentCost, itemEnchantmentPower); Debug.LogFormat("used: {0} onBuild: {1}", itemEnchantmentPower, selectedItem.enchantmentPoints); goldCostLabel.Text = totalGoldCost.ToString(); } // Add appropriate items to filtered list itemsFiltered.Clear(); ItemCollection playerItems = PlayerEntity.Items; for (int i = 0; i < playerItems.Count; i++) { AddFilteredItem(playerItems.GetItem(i)); } itemsListScroller.Items = itemsFiltered; if (selectedItem != null) { ImageData image = DaggerfallUnity.Instance.ItemHelper.GetInventoryImage(selectedItem); selectedItemPanel.BackgroundTexture = image.texture; selectedItemPanel.Size = new Vector2(image.texture.width, image.texture.height); } else { selectedItemPanel.BackgroundTexture = null; } }