From a576c4a6edc69f703422ab289ee46b05011b9275 Mon Sep 17 00:00:00 2001 From: miepzerino <o.skotnik@gmail.com> Date: Sun, 06 Apr 2025 17:46:38 +0000 Subject: [PATCH] #48 added cache to map savefile --- Assets/Scripts/Inventory/ItemUIScript.cs | 18 +++++++++++++++--- 1 files changed, 15 insertions(+), 3 deletions(-) diff --git a/Assets/Scripts/Inventory/ItemUIScript.cs b/Assets/Scripts/Inventory/ItemUIScript.cs index 17fbae2..e45c7ca 100644 --- a/Assets/Scripts/Inventory/ItemUIScript.cs +++ b/Assets/Scripts/Inventory/ItemUIScript.cs @@ -1,10 +1,10 @@ using Assets.Scripts.Helpers; +using System; using System.Collections; using System.Collections.Generic; using TMPro; using UnityEngine; using UnityEngine.UI; -using static UnityEditor.Progress; public enum ItemUIType { @@ -30,10 +30,22 @@ gameObject.transform.Find("ItemName").GetComponent<TextMeshProUGUI>().text = inventorySlot.item.itemName; gameObject.transform.Find("ItemQuantity").GetComponent<TextMeshProUGUI>().text = inventorySlot.quantity.ToString() + "x"; gameObject.transform.Find("ItemIcon").GetComponent<Image>().sprite = inventorySlot.item.itemIcon; - TextMeshProHelper.UpdateItemMaxCountText(gameObject.transform.Find("ItemQuantity").GetComponent<TextMeshProUGUI>(), inventorySlot.quantity, inventorySlot.item.maxStackSize); + UIHelper.UpdateItemMaxCountText(gameObject.transform.Find("ItemQuantity").GetComponent<TextMeshProUGUI>(), inventorySlot.quantity, inventorySlot.item.maxStackSize); break; case ItemUIType.ItemDescription: - gameObject.transform.Find("ItemTextDescription").GetComponent<TextMeshProUGUI>().text = inventorySlot.item.itemDescription; + string description = $"<b>Description</b>\n{inventorySlot.item.itemDescription}\n"; + + GenerateableDatabase.Instance.TryGetGenerateables(inventorySlot.item.itemId, out var variants); + if (variants != null) + { + description += $"\n<b>Generation</b>"; + foreach (var variant in variants) + { + description += $"\nLocation\tY: {variant.maxHeight} to {variant.minHeight}"; + description += $"\n\tAmount: {variant.dropRange.ToRangeString()}"; + } + } + gameObject.transform.Find("ItemTextDescription").GetComponent<TextMeshProUGUI>().text = description; break; } } -- Gitblit v1.9.3