using Content.Shared.Ame.Components; using JetBrains.Annotations; using Robust.Client.UserInterface; namespace Content.Client.Ame.UI { [UsedImplicitly] public sealed class AmeControllerBoundUserInterface : BoundUserInterface { private AmeWindow? _window; public AmeControllerBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey) { } protected override void Open() { base.Open(); _window = this.CreateWindow(); _window.OnAmeButton += ButtonPressed; } /// /// Update the ui each time new state data is sent from the server. /// /// /// Data of the that this ui represents. /// Sent from the server. /// protected override void UpdateState(BoundUserInterfaceState state) { base.UpdateState(state); var castState = (AmeControllerBoundUserInterfaceState) state; _window?.UpdateState(castState); //Update window state } public void ButtonPressed(UiButton button) { SendMessage(new UiButtonPressedMessage(button)); } } }