Technology Disks (#13077)
* clean up a bunch of R&D code * don't store components * brug * speedrun some sloth review * technology disks * expand functionality, begin work on printer * disk printer ui * file * fix the rebase * disk console is finito * Update DiskConsoleSystem.cs
This commit is contained in:
53
Content.Client/Research/UI/DiskConsoleBoundUserInterface.cs
Normal file
53
Content.Client/Research/UI/DiskConsoleBoundUserInterface.cs
Normal file
@@ -0,0 +1,53 @@
|
||||
using Content.Shared.Lathe;
|
||||
using Content.Shared.Research;
|
||||
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 LatheServerSelectionMessage());
|
||||
};
|
||||
_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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user