2021-02-11 01:13:03 -08:00
|
|
|
|
using Robust.Client.GameObjects;
|
|
|
|
|
|
using Robust.Shared.GameObjects;
|
2021-06-19 13:25:05 +02:00
|
|
|
|
using static Content.Shared.Atmos.Components.SharedGasAnalyzerComponent;
|
2020-08-08 18:24:41 +02:00
|
|
|
|
|
2021-06-19 13:25:05 +02:00
|
|
|
|
namespace Content.Client.Atmos.UI
|
2020-08-08 18:24:41 +02:00
|
|
|
|
{
|
2022-02-16 00:23:23 -07:00
|
|
|
|
public sealed class GasAnalyzerBoundUserInterface : BoundUserInterface
|
2020-08-08 18:24:41 +02:00
|
|
|
|
{
|
|
|
|
|
|
public GasAnalyzerBoundUserInterface(ClientUserInterfaceComponent owner, object uiKey) : base(owner, uiKey)
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2021-03-10 14:48:29 +01:00
|
|
|
|
private GasAnalyzerWindow? _menu;
|
2020-08-08 18:24:41 +02:00
|
|
|
|
|
|
|
|
|
|
protected override void Open()
|
|
|
|
|
|
{
|
|
|
|
|
|
base.Open();
|
|
|
|
|
|
|
2021-03-10 14:48:29 +01:00
|
|
|
|
_menu = new GasAnalyzerWindow(this);
|
2020-08-08 18:24:41 +02:00
|
|
|
|
_menu.OnClose += Close;
|
|
|
|
|
|
_menu.OpenCentered();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override void UpdateState(BoundUserInterfaceState state)
|
|
|
|
|
|
{
|
|
|
|
|
|
base.UpdateState(state);
|
2021-03-10 14:48:29 +01:00
|
|
|
|
|
|
|
|
|
|
_menu?.Populate((GasAnalyzerBoundUserInterfaceState) state);
|
2020-08-08 18:24:41 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void Refresh()
|
|
|
|
|
|
{
|
|
|
|
|
|
SendMessage(new GasAnalyzerRefreshMessage());
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override void Dispose(bool disposing)
|
|
|
|
|
|
{
|
|
|
|
|
|
base.Dispose(disposing);
|
|
|
|
|
|
|
2021-03-10 14:48:29 +01:00
|
|
|
|
if (disposing) _menu?.Dispose();
|
2020-08-08 18:24:41 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|