using System; using System.Collections.Generic; using KernelPanic.Data; using UnityEngine; using UnityEngine.TextCore.Text; using UnityEngine.UIElements; namespace KernelPanic.UI { /// /// Renders the main menu's neofetch-style featured unit panel. /// [Serializable] public sealed class FeaturedUnitPanel { private const string EmptyAccent = "5cff91"; private VisualElement _panel; private Label _titleLabel; private Label _asciiLabel; private VisualElement _asciiPlaceholder; private Label _unitNameLabel; private Label _languagesLabel; private Label _passiveLabel; private Label _bestWaveLabel; private Label _emptyTitleLabel; private Label _emptyHintLabel; private VisualElement _populatedState; private VisualElement _emptyState; private FontAsset _monospaceFont; private AsciiArtFitter _asciiFitter; private IReadOnlyList _units = Array.Empty(); private Func _getBestWave; private Action _activateUnit; private DistroDefinition _currentUnit; private int _selectedIndex; public void Bind(VisualElement root, FontAsset artFont, Func getBestWave = null, Action activateUnit = null) { _monospaceFont = artFont; _getBestWave = getBestWave; _activateUnit = activateUnit; _panel = root.Q("FeaturedUnitPanel"); _titleLabel = root.Q