using Content.Shared.Research.Prototypes; using Robust.Client.AutoGenerated; using Robust.Client.GameObjects; using Robust.Client.Graphics; using Robust.Client.UserInterface.CustomControls; using Robust.Client.UserInterface.XAML; namespace Content.Client.Lathe.UI { [GenerateTypedNameReferences] public sealed partial class LatheQueueMenu : DefaultWindow { [Dependency] private readonly IEntityManager _entityManager = default!; private readonly SpriteSystem _spriteSystem; public LatheQueueMenu(LatheBoundUserInterface owner) { RobustXamlLoader.Load(this); IoCManager.InjectDependencies(this); _spriteSystem = _entityManager.EntitySysManager.GetEntitySystem(); SetInfo(null); } public void SetInfo(LatheRecipePrototype? recipe) { if (recipe != null) { Icon.Texture = _spriteSystem.Frame0(recipe.Icon); NameLabel.Text = recipe.Name; Description.Text = recipe.Description; } else { Icon.Texture = Texture.Transparent; NameLabel.Text = string.Empty; Description.Text = Loc.GetString("lathe-queue-menu-not-producing-text"); } } public void PopulateList(List queue) { QueueList.Clear(); var idx = 1; foreach (var recipe in queue) { QueueList.AddItem($"{idx}. {recipe.Name}", _spriteSystem.Frame0(recipe.Icon)); idx++; } } } }