Files
tbd-station-14/Content.Client/Research/UI/DiskConsoleBoundUserInterface.cs
Nemanja 4eee1ee9b2 clean up infinite researchsystem shitcode (#13136)
* clean up infinite researchsystem shitcode

* fml some more shit

* make syncing work logically

* naming naming naming
2022-12-25 15:22:23 -06:00

54 lines
1.3 KiB
C#

using Content.Shared.Research;
using Content.Shared.Research.Components;
using Robust.Client.GameObjects;
namespace Content.Client.Research.UI
{
public sealed class DiskConsoleBoundUserInterface : BoundUserInterface
{
private DiskConsoleMenu? _menu;
public DiskConsoleBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey)
{
}
protected override void Open()
{
base.Open();
_menu = new();
_menu.OnClose += Close;
_menu.OpenCentered();
_menu.OnServerButtonPressed += () =>
{
SendMessage(new ConsoleServerSelectionMessage());
};
_menu.OnPrintButtonPressed += () =>
{
SendMessage(new DiskConsolePrintDiskMessage());
};
}
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
if (!disposing)
return;
_menu?.Close();
}
protected override void UpdateState(BoundUserInterfaceState state)
{
base.UpdateState(state);
if (state is not DiskConsoleBoundUserInterfaceState msg)
return;
_menu?.Update(msg);
}
}
}