using System.Globalization; using Sirenix.Utilities; using UnityEngine; using UnityEngine.UIElements; using VOID.Generic.Dict; using VOID.Generic.Objects.Item; using VOID.UserInterface.Game.Util; namespace VOID.UserInterface.Game.Tooltip { public class ItemTooltipUI : ITooltip { // VisualElement - Container private readonly VisualElement _templateElement; // VisualElements - Sections private readonly VisualElement _titleSection; private readonly VisualElement _descriptionSection; private readonly VisualElement _footSection; // VisualElements - Data private readonly SlotUI _itemIcon = new(); private readonly Label _itemName; private readonly Label _itemQuality; private readonly Label _itemDescription; private readonly Label _itemValue; private readonly Label _itemWeight; public ItemTooltipUI(VisualElement templateElement) { // Tooltip for this type _templateElement = templateElement.Q(null, "tooltip"); // Sections _titleSection = templateElement.Q("title-section"); _descriptionSection = templateElement.Q("description-section"); _footSection = templateElement.Q("foot-section"); // Elements _itemIcon.Init(templateElement.Q("item-icon"), SlotType.None, -1); _itemName = templateElement.Q