Files
crystall-punk-14/Content.Client/StationRecords/GeneralStationRecordConsoleBoundUserInterface.cs

37 lines
1.1 KiB
C#
Raw Permalink Normal View History

using Content.Shared.StationRecords;
using Robust.Client.UserInterface;
namespace Content.Client.StationRecords;
public sealed class GeneralStationRecordConsoleBoundUserInterface : BoundUserInterface
{
2023-07-08 09:02:17 -07:00
[ViewVariables]
private GeneralStationRecordConsoleWindow? _window = default!;
2023-07-08 09:02:17 -07:00
public GeneralStationRecordConsoleBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
{
}
protected override void Open()
{
base.Open();
_window = this.CreateWindow<GeneralStationRecordConsoleWindow>();
2024-02-04 23:29:35 +00:00
_window.OnKeySelected += key =>
SendMessage(new SelectStationRecord(key));
_window.OnFiltersChanged += (type, filterValue) =>
SendMessage(new SetStationRecordFilter(type, filterValue));
_window.OnDeleted += id => SendMessage(new DeleteStationRecord(id));
}
protected override void UpdateState(BoundUserInterfaceState state)
{
base.UpdateState(state);
if (state is not GeneralStationRecordConsoleState cast)
return;
_window?.UpdateState(cast);
}
}