From ee1703b69b7977a8cd6d37dd097f425c8c905882 Mon Sep 17 00:00:00 2001 From: miepzerino <o.skotnik@gmail.com> Date: Thu, 03 Apr 2025 22:24:35 +0000 Subject: [PATCH] #42 added jobs for tile generation --- Assets/Scripts/Inventory/ItemUIScript.cs | 17 +++++++++++++++-- 1 files changed, 15 insertions(+), 2 deletions(-) diff --git a/Assets/Scripts/Inventory/ItemUIScript.cs b/Assets/Scripts/Inventory/ItemUIScript.cs index 17fbae2..a4ad058 100644 --- a/Assets/Scripts/Inventory/ItemUIScript.cs +++ b/Assets/Scripts/Inventory/ItemUIScript.cs @@ -1,4 +1,5 @@ using Assets.Scripts.Helpers; +using System; using System.Collections; using System.Collections.Generic; using TMPro; @@ -30,10 +31,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