using System.Collections.Generic; using System.Globalization; using System.Linq; using Sirenix.Utilities; using UnityEngine; using UnityEngine.UIElements; using VOID.Generic.Dict; using VOID.Generic.Objects.Weapon; using VOID.UserInterface.Game.Util; namespace VOID.UserInterface.Game.Tooltip { public class WeaponTooltipUI : ITooltip { // VisualElement - Container private readonly VisualElement _templateElement; // VisualElements - Sections private readonly VisualElement _titleSection; private readonly VisualElement _mainDetailsSection; private readonly VisualElement _detailsSection; private readonly VisualElement _descriptionSection; private readonly VisualElement _footSection; // VisualElements - Data private readonly SlotUI _weaponIcon = new(); private readonly List _mainDetails = new(); private readonly List _details = new(); private readonly Label _weaponName; private readonly Label _weaponQuality; private readonly Label _weaponType; private readonly Label _weaponDescription; private readonly Label _weaponValue; private readonly Label _weaponWeight; public WeaponTooltipUI(VisualElement templateElement) { // Tooltip for this type _templateElement = templateElement.Q(null, "tooltip"); // Sections _titleSection = templateElement.Q("title-section"); _mainDetailsSection = templateElement.Q("main-details-section"); _detailsSection = templateElement.Q("details-section"); _descriptionSection = templateElement.Q("description-section"); _footSection = templateElement.Q("foot-section"); // Elements _weaponIcon.Init(templateElement.Q("weapon-icon"), SlotType.None, -1); _weaponName = templateElement.Q