mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-16 21:17:39 +03:00
🆑 - fix: Fixed the most pressing issue: arcade games not working. Co-authored-by: themias <89101928+themias@users.noreply.github.com> (cherry picked from commit bd5259a088fa059faaacd846526c36bc9c09f4a1)
37 lines
1.0 KiB
C#
37 lines
1.0 KiB
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>();
|
|
_menu.OnPlayerAction += SendAction;
|
|
}
|
|
|
|
protected override void ReceiveMessage(BoundUserInterfaceMessage message)
|
|
{
|
|
if (message is SpaceVillainArcadeDataUpdateMessage msg)
|
|
_menu?.UpdateInfo(msg);
|
|
}
|
|
}
|