Files
crystall-punk-14/Content.Client/Cargo/BUI/CargoShuttleConsoleBoundUserInterface.cs

37 lines
1.1 KiB
C#
Raw Permalink Normal View History

2022-06-23 14:36:47 +10:00
using Content.Client.Cargo.UI;
using Content.Shared.Cargo.BUI;
2023-03-23 16:10:49 +11:00
using JetBrains.Annotations;
2022-06-23 14:36:47 +10:00
using Robust.Client.GameObjects;
using Robust.Client.UserInterface;
2022-06-23 14:36:47 +10:00
using Robust.Shared.Prototypes;
namespace Content.Client.Cargo.BUI;
2023-03-23 16:10:49 +11:00
[UsedImplicitly]
2022-06-23 14:36:47 +10:00
public sealed class CargoShuttleConsoleBoundUserInterface : BoundUserInterface
{
[Dependency] private readonly IPrototypeManager _protoManager = default!;
2023-07-08 09:02:17 -07:00
[ViewVariables]
2022-06-23 14:36:47 +10:00
private CargoShuttleMenu? _menu;
2023-07-08 09:02:17 -07:00
public CargoShuttleConsoleBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
{
}
2022-06-23 14:36:47 +10:00
protected override void Open()
{
base.Open();
_menu = this.CreateWindow<CargoShuttleMenu>();
2022-06-23 14:36:47 +10:00
}
protected override void UpdateState(BoundUserInterfaceState state)
{
base.UpdateState(state);
if (state is not CargoShuttleConsoleBoundUserInterfaceState cargoState) return;
_menu?.SetAccountName(cargoState.AccountName);
_menu?.SetShuttleName(cargoState.ShuttleName);
_menu?.SetOrders(EntMan.System<SpriteSystem>(), _protoManager, cargoState.Orders);
2022-06-23 14:36:47 +10:00
}
}