2022-08-08 22:10:01 -07:00
|
|
|
using Content.Shared.StationRecords;
|
|
|
|
|
|
|
|
|
|
namespace Content.Client.StationRecords;
|
|
|
|
|
|
|
|
|
|
public sealed class GeneralStationRecordConsoleBoundUserInterface : BoundUserInterface
|
|
|
|
|
{
|
2023-07-08 09:02:17 -07:00
|
|
|
[ViewVariables]
|
2022-08-08 22:10:01 -07:00
|
|
|
private GeneralStationRecordConsoleWindow? _window = default!;
|
|
|
|
|
|
2023-07-08 09:02:17 -07:00
|
|
|
public GeneralStationRecordConsoleBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
|
|
|
|
{
|
|
|
|
|
}
|
2022-08-08 22:10:01 -07:00
|
|
|
|
|
|
|
|
protected override void Open()
|
|
|
|
|
{
|
|
|
|
|
base.Open();
|
|
|
|
|
|
|
|
|
|
_window = new();
|
2024-02-04 23:29:35 +00:00
|
|
|
_window.OnKeySelected += key =>
|
|
|
|
|
SendMessage(new SelectStationRecord(key));
|
|
|
|
|
_window.OnFiltersChanged += (type, filterValue) =>
|
|
|
|
|
SendMessage(new SetStationRecordFilter(type, filterValue));
|
2022-08-08 22:10:01 -07:00
|
|
|
_window.OnClose += Close;
|
|
|
|
|
|
|
|
|
|
_window.OpenCentered();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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();
|
|
|
|
|
}
|
|
|
|
|
}
|