| 1234567891011121314151617181920212223242526272829303132333435363738 |
- using Content.Shared.Anomaly;
- using JetBrains.Annotations;
- using Robust.Client.UserInterface;
- namespace Content.Client.Anomaly.Ui;
- [UsedImplicitly]
- public sealed class AnomalyGeneratorBoundUserInterface : BoundUserInterface
- {
- private AnomalyGeneratorWindow? _window;
- public AnomalyGeneratorBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
- {
- }
- protected override void Open()
- {
- base.Open();
- _window = this.CreateWindow<AnomalyGeneratorWindow>();
- _window.SetEntity(Owner);
- _window.OnGenerateButtonPressed += () =>
- {
- SendMessage(new AnomalyGeneratorGenerateButtonPressedEvent());
- };
- }
- protected override void UpdateState(BoundUserInterfaceState state)
- {
- base.UpdateState(state);
- if (state is not AnomalyGeneratorUserInterfaceState msg)
- return;
- _window?.UpdateState(msg);
- }
- }
|