2023-01-17 00:05:20 -05:00
|
|
|
using Content.Shared.Anomaly;
|
|
|
|
|
using JetBrains.Annotations;
|
2024-07-21 14:48:13 +10:00
|
|
|
using Robust.Client.UserInterface;
|
2023-01-17 00:05:20 -05:00
|
|
|
|
2023-07-08 09:02:17 -07:00
|
|
|
namespace Content.Client.Anomaly.Ui;
|
2023-01-17 00:05:20 -05:00
|
|
|
|
|
|
|
|
[UsedImplicitly]
|
|
|
|
|
public sealed class AnomalyGeneratorBoundUserInterface : BoundUserInterface
|
|
|
|
|
{
|
|
|
|
|
private AnomalyGeneratorWindow? _window;
|
|
|
|
|
|
2023-07-08 09:02:17 -07:00
|
|
|
public AnomalyGeneratorBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
2023-01-17 00:05:20 -05:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void Open()
|
|
|
|
|
{
|
|
|
|
|
base.Open();
|
|
|
|
|
|
2024-07-21 14:48:13 +10:00
|
|
|
_window = this.CreateWindow<AnomalyGeneratorWindow>();
|
|
|
|
|
_window.SetEntity(Owner);
|
2023-01-17 00:05:20 -05:00
|
|
|
|
|
|
|
|
_window.OnGenerateButtonPressed += () =>
|
|
|
|
|
{
|
|
|
|
|
SendMessage(new AnomalyGeneratorGenerateButtonPressedEvent());
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void UpdateState(BoundUserInterfaceState state)
|
|
|
|
|
{
|
|
|
|
|
base.UpdateState(state);
|
|
|
|
|
|
|
|
|
|
if (state is not AnomalyGeneratorUserInterfaceState msg)
|
|
|
|
|
return;
|
|
|
|
|
_window?.UpdateState(msg);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|