fish-station/Content.Client/_Sunrise/CartridgeLoader/Cartridges/CreateGroupDialog.xaml.cs
Vigers Ray 95d7d4d348
ыыыыы, месенжер макс, ихихяхя (#3789)
Co-authored-by: Daniel <77834935+Orvex07@users.noreply.github.com>
2026-01-26 22:44:54 +03:00

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();
};
}
}