using Robust.Client.AutoGenerated; using Robust.Client.UserInterface.Controls; using Robust.Client.UserInterface.XAML; namespace Content.Client.Kitchen.UI; [GenerateTypedNameReferences] public sealed partial class MicrowaveCookTimeButton : Button { public event Action? OnCookTimeSelected; private uint _cookTime = 0; public uint CookTime { get => _cookTime; set { _cookTime = value; UpdateLabel(); } } public MicrowaveCookTimeButton() { RobustXamlLoader.Load(this); UpdateLabel(); OnPressed += _ => OnCookTimeSelected?.Invoke(Text ?? string.Empty, _cookTime); } private void UpdateLabel() { var labelText = _cookTime == 0 ? Loc.GetString("microwave-menu-instant-button") : _cookTime.ToString(); Text = labelText; } }