From b6a9e525aa30f6ea7b26ca41c0400b60b7118806 Mon Sep 17 00:00:00 2001 From: miepzerino <o.skotnik@gmail.com> Date: Thu, 03 Apr 2025 22:24:55 +0000 Subject: [PATCH] fix build --- Assets/Scripts/Inventory/ItemUIScript.cs | 18 ++++++++++++++++-- 1 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Assets/Scripts/Inventory/ItemUIScript.cs b/Assets/Scripts/Inventory/ItemUIScript.cs index d58b250..e45c7ca 100644 --- a/Assets/Scripts/Inventory/ItemUIScript.cs +++ b/Assets/Scripts/Inventory/ItemUIScript.cs @@ -1,9 +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 { @@ -29,9 +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; + 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