miepzerino
2025-04-02 5e14cc355fd3a4a27a0196f504fee16d68f39612
#41 fixed item description text
2 files modified
15 ■■■■ changed files
Assets/Scripts/Helpers/VectorHelper.cs 9 ●●●●● patch | view | raw | blame | history
Assets/Scripts/Inventory/ItemUIScript.cs 6 ●●●●● patch | view | raw | blame | history
Assets/Scripts/Helpers/VectorHelper.cs
@@ -138,5 +138,14 @@
            }
            return result;
        }
        public static string ToRangeString(this Vector2 vector)
        {
            if (vector.x == vector.y)
            {
                return $"{vector.x}";
            }
            return $"{vector.x}-{vector.y}";
        }
    }
}
Assets/Scripts/Inventory/ItemUIScript.cs
@@ -42,10 +42,8 @@
                        description += $"\n<b>Generation</b>";
                        foreach (var variant in variants)
                        {
                            if (variant.maxHeight > 0 || variant.minHeight > 0)
                            {
                                description += $"\nSpawns between Y: {variant.minHeight} - {variant.maxHeight}. Amount: {variant.dropRange}";
                            }
                            description += $"\nLocation\tY: {variant.maxHeight} to {variant.minHeight}";
                            description += $"\n\tAmount: {variant.dropRange.ToRangeString()}";
                        }
                    }
                    gameObject.transform.Find("ItemTextDescription").GetComponent<TextMeshProUGUI>().text = description;