2021-06-09 22:19:39 +02:00
|
|
|
|
using Robust.Client.GameObjects;
|
2021-02-11 01:13:03 -08:00
|
|
|
|
using Robust.Shared.GameObjects;
|
2020-09-23 14:30:31 +02:00
|
|
|
|
using Robust.Shared.ViewVariables;
|
2021-06-09 22:19:39 +02:00
|
|
|
|
using static Content.Shared.Arcade.SharedSpaceVillainArcadeComponent;
|
2020-09-23 14:30:31 +02:00
|
|
|
|
|
2021-06-09 22:19:39 +02:00
|
|
|
|
namespace Content.Client.Arcade.UI
|
2020-09-23 14:30:31 +02:00
|
|
|
|
{
|
2022-02-16 00:23:23 -07:00
|
|
|
|
public sealed class SpaceVillainArcadeBoundUserInterface : BoundUserInterface
|
2020-09-23 14:30:31 +02:00
|
|
|
|
{
|
2021-03-10 14:48:29 +01:00
|
|
|
|
[ViewVariables] private SpaceVillainArcadeMenu? _menu;
|
2020-09-23 14:30:31 +02:00
|
|
|
|
|
|
|
|
|
|
//public SharedSpaceVillainArcadeComponent SpaceVillainArcade;
|
|
|
|
|
|
|
2021-03-10 14:48:29 +01:00
|
|
|
|
public SpaceVillainArcadeBoundUserInterface(ClientUserInterfaceComponent owner, object uiKey) : base(owner, uiKey)
|
2020-09-23 14:30:31 +02:00
|
|
|
|
{
|
2021-03-10 14:48:29 +01:00
|
|
|
|
SendAction(PlayerAction.RequestData);
|
2020-09-23 14:30:31 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
2021-03-10 14:48:29 +01:00
|
|
|
|
public void SendAction(PlayerAction action)
|
2020-09-23 14:30:31 +02:00
|
|
|
|
{
|
2021-03-10 14:48:29 +01:00
|
|
|
|
SendMessage(new SpaceVillainArcadePlayerActionMessage(action));
|
2020-09-23 14:30:31 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override void Open()
|
|
|
|
|
|
{
|
|
|
|
|
|
base.Open();
|
|
|
|
|
|
|
|
|
|
|
|
/*if(!Owner.Owner.TryGetComponent(out SharedSpaceVillainArcadeComponent spaceVillainArcade))
|
|
|
|
|
|
{
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
SpaceVillainArcade = spaceVillainArcade;*/
|
|
|
|
|
|
|
|
|
|
|
|
_menu = new SpaceVillainArcadeMenu(this);
|
|
|
|
|
|
|
|
|
|
|
|
_menu.OnClose += Close;
|
|
|
|
|
|
_menu.OpenCentered();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override void ReceiveMessage(BoundUserInterfaceMessage message)
|
|
|
|
|
|
{
|
2021-03-10 14:48:29 +01:00
|
|
|
|
if (message is SpaceVillainArcadeDataUpdateMessage msg) _menu?.UpdateInfo(msg);
|
2020-09-23 14:30:31 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override void Dispose(bool disposing)
|
|
|
|
|
|
{
|
|
|
|
|
|
base.Dispose(disposing);
|
2020-10-06 10:16:42 +02:00
|
|
|
|
|
2021-03-10 14:48:29 +01:00
|
|
|
|
if (disposing) _menu?.Dispose();
|
2020-09-23 14:30:31 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|