using Content.Shared.Research.Prototypes; using Robust.Client.AutoGenerated; using Robust.Client.Graphics; using Robust.Client.UserInterface; using Robust.Client.UserInterface.XAML; namespace Content.Client.Lathe.UI; [GenerateTypedNameReferences] public sealed partial class RecipeControl : Control { public Action? OnButtonPressed; public RecipeControl(LatheRecipePrototype recipe, string tooltip, bool canProduce, Texture? texture = null) { RobustXamlLoader.Load(this); RecipeName.Text = recipe.Name; RecipeTexture.Texture = texture; Button.ToolTip = tooltip; Button.Disabled = !canProduce; Button.OnPressed += (_) => { OnButtonPressed?.Invoke(recipe.ID); }; } }