Files
tbd-station-14/Content.Client/GameObjects/Components/Arcade/SpaceVillainArcadeBoundUserInterface.cs
Acruid ca4fd649fe Massive Namespace Cleanup (#3120)
* Engine namespace changes.

* Automated remove redundant using statements.

* Simplified Graphics namespace.

* Apparently the container system stores full type names in the map file.😞 This updates those names.

* API Changes to LocalizationManager.LoadCulture.

* Update submodule to v0.3.2
2021-02-11 01:13:03 -08:00

58 lines
1.8 KiB
C#

using Content.Client.Arcade;
using Content.Shared.GameObjects.Components.Arcade;
using JetBrains.Annotations;
using Robust.Client.GameObjects;
using Robust.Shared.GameObjects;
using Robust.Shared.ViewVariables;
namespace Content.Client.GameObjects.Components.Arcade
{
public class SpaceVillainArcadeBoundUserInterface : BoundUserInterface
{
[ViewVariables] private SpaceVillainArcadeMenu _menu;
//public SharedSpaceVillainArcadeComponent SpaceVillainArcade;
public SpaceVillainArcadeBoundUserInterface([NotNull] ClientUserInterfaceComponent owner, [NotNull] object uiKey) : base(owner, uiKey)
{
SendAction(SharedSpaceVillainArcadeComponent.PlayerAction.RequestData);
}
public void SendAction(SharedSpaceVillainArcadeComponent.PlayerAction action)
{
SendMessage(new SharedSpaceVillainArcadeComponent.SpaceVillainArcadePlayerActionMessage(action));
}
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)
{
if(message is SharedSpaceVillainArcadeComponent.SpaceVillainArcadeDataUpdateMessage msg) _menu.UpdateInfo(msg);
}
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
if (!disposing)
return;
_menu?.Dispose();
}
}
}