miepzerino
2025-04-03 b6a9e525aa30f6ea7b26ca41c0400b60b7118806
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
{
@@ -33,7 +33,19 @@
                    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;
            }
        }