2022-08-08 22:10:01 -07:00
|
|
|
using Content.Shared.StationRecords;
|
|
|
|
|
using Robust.Client.GameObjects;
|
|
|
|
|
|
|
|
|
|
namespace Content.Client.StationRecords;
|
|
|
|
|
|
|
|
|
|
public sealed class GeneralStationRecordConsoleBoundUserInterface : BoundUserInterface
|
|
|
|
|
{
|
|
|
|
|
private GeneralStationRecordConsoleWindow? _window = default!;
|
|
|
|
|
|
2022-08-21 05:38:30 +12:00
|
|
|
public GeneralStationRecordConsoleBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey)
|
2022-08-08 22:10:01 -07:00
|
|
|
{}
|
|
|
|
|
|
|
|
|
|
protected override void Open()
|
|
|
|
|
{
|
|
|
|
|
base.Open();
|
|
|
|
|
|
|
|
|
|
_window = new();
|
|
|
|
|
_window.OnKeySelected += OnKeySelected;
|
|
|
|
|
_window.OnClose += Close;
|
|
|
|
|
|
|
|
|
|
_window.OpenCentered();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void OnKeySelected(StationRecordKey? key)
|
|
|
|
|
{
|
|
|
|
|
SendMessage(new SelectGeneralStationRecord(key));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void UpdateState(BoundUserInterfaceState state)
|
|
|
|
|
{
|
|
|
|
|
base.UpdateState(state);
|
|
|
|
|
|
|
|
|
|
if (state is not GeneralStationRecordConsoleState cast)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_window?.UpdateState(cast);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void Dispose(bool disposing)
|
|
|
|
|
{
|
|
|
|
|
base.Dispose(disposing);
|
|
|
|
|
|
|
|
|
|
_window?.Close();
|
|
|
|
|
}
|
|
|
|
|
}
|