33 lines
823 B
C#
33 lines
823 B
C#
using Robust.Client.AutoGenerated;
|
|
using Robust.Client.UserInterface.CustomControls;
|
|
using Robust.Client.UserInterface.XAML;
|
|
|
|
namespace Content.Client._Sunrise.CartridgeLoader.Cartridges;
|
|
|
|
[GenerateTypedNameReferences]
|
|
public sealed partial class CreateGroupDialog : DefaultWindow
|
|
{
|
|
public event Action<string>? OnCreate;
|
|
public event Action? OnCancel;
|
|
|
|
public CreateGroupDialog()
|
|
{
|
|
RobustXamlLoader.Load(this);
|
|
|
|
CreateButton.OnPressed += _ =>
|
|
{
|
|
var groupName = NameInput.Text.Trim();
|
|
if (!string.IsNullOrWhiteSpace(groupName))
|
|
{
|
|
OnCreate?.Invoke(groupName);
|
|
Close();
|
|
}
|
|
};
|
|
|
|
CancelButton.OnPressed += _ =>
|
|
{
|
|
OnCancel?.Invoke();
|
|
Close();
|
|
};
|
|
}
|
|
}
|