* Remove some BUI boilerplate - The disposals overrides got removed due to the helper method handling it. - Replace window creation with CreateWindow helper. - Fixed some stinky code which would cause exceptions. * More * moar * weh * done * More BUIs * More updates * weh * moar * look who it is * weh * merge * weh * fixes
36 lines
1000 B
C#
36 lines
1000 B
C#
using Robust.Client.GameObjects;
|
|
using Robust.Client.UserInterface;
|
|
using Robust.Shared.GameObjects;
|
|
using Robust.Shared.ViewVariables;
|
|
using static Content.Shared.Arcade.SharedSpaceVillainArcadeComponent;
|
|
|
|
namespace Content.Client.Arcade.UI;
|
|
|
|
public sealed class SpaceVillainArcadeBoundUserInterface : BoundUserInterface
|
|
{
|
|
[ViewVariables] private SpaceVillainArcadeMenu? _menu;
|
|
|
|
public SpaceVillainArcadeBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
|
{
|
|
SendAction(PlayerAction.RequestData);
|
|
}
|
|
|
|
public void SendAction(PlayerAction action)
|
|
{
|
|
SendMessage(new SpaceVillainArcadePlayerActionMessage(action));
|
|
}
|
|
|
|
protected override void Open()
|
|
{
|
|
base.Open();
|
|
|
|
_menu = this.CreateWindow<SpaceVillainArcadeMenu>();
|
|
}
|
|
|
|
protected override void ReceiveMessage(BoundUserInterfaceMessage message)
|
|
{
|
|
if (message is SpaceVillainArcadeDataUpdateMessage msg)
|
|
_menu?.UpdateInfo(msg);
|
|
}
|
|
}
|