6
StarHorizon_Public/Content.Client/_NF/Lathe/UI/QueuedRecipeControl.xaml.cs
2026-01-24 12:49:55 +03:00

41 lines
1.1 KiB
C#

using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.XAML;
namespace Content.Client._NF.Lathe.UI;
[GenerateTypedNameReferences]
public sealed partial class QueuedRecipeControl : Control
{
public Action<int>? OnDeletePressed;
public Action<int>? OnMoveUpPressed;
public Action<int>? OnMoveDownPressed;
public QueuedRecipeControl(string displayText, int index, Control displayControl)
{
RobustXamlLoader.Load(this);
RecipeName.Text = displayText;
RecipeDisplayContainer.AddChild(displayControl);
MoveUp.OnPressed += (_) =>
{
OnMoveUpPressed?.Invoke(index);
};
MoveUp.AddStyleClass("OpenRight"); // Left extra style classes in here, unsure how to define multiple in XAML.
MoveDown.OnPressed += (_) =>
{
OnMoveDownPressed?.Invoke(index);
};
MoveDown.AddStyleClass("OpenBoth");
Delete.OnPressed += (_) =>
{
OnDeletePressed?.Invoke(index);
};
Delete.AddStyleClass("OpenLeft");
}
}