main cult

This commit is contained in:
EnefFlow
2024-01-27 15:19:52 +03:00
committed by Aviu00
parent 6310813ce6
commit 4fab8188f0
429 changed files with 12281 additions and 9 deletions

View File

@@ -0,0 +1,45 @@
using Content.Shared.White.Cult.UI;
using Robust.Client.GameObjects;
namespace Content.Client._White.Cult.UI.NameSelector;
public sealed class NameSelectorBUI : BoundUserInterface
{
public NameSelectorBUI(EntityUid owner, Enum uiKey) : base(owner, uiKey)
{
}
private NameSelectorWindow? _window;
protected override void Open()
{
base.Open();
_window = new();
_window.OpenCentered();
_window.OnNameChange += OnNameSelected;
_window.OnClose += Close;
}
private void OnNameSelected(string name)
{
SendMessage(new NameSelectorMessage(name));
}
protected override void UpdateState(BoundUserInterfaceState state)
{
if (state is not NameSelectorBuiState cast || _window == null)
{
return;
}
_window.UpdateState(cast.Name);
}
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
_window?.Close();
}
}