2019-11-25 00:11:47 +01:00
|
|
|
using Content.Client.Instruments;
|
2021-02-11 01:13:03 -08:00
|
|
|
using Robust.Client.GameObjects;
|
2019-11-25 00:11:47 +01:00
|
|
|
using Robust.Shared.ViewVariables;
|
|
|
|
|
|
|
|
|
|
namespace Content.Client.GameObjects.Components.Instruments
|
|
|
|
|
{
|
|
|
|
|
public class InstrumentBoundUserInterface : BoundUserInterface
|
|
|
|
|
{
|
|
|
|
|
[ViewVariables]
|
|
|
|
|
private InstrumentMenu _instrumentMenu;
|
|
|
|
|
|
|
|
|
|
public InstrumentComponent Instrument { get; set; }
|
|
|
|
|
|
|
|
|
|
public InstrumentBoundUserInterface(ClientUserInterfaceComponent owner, object uiKey) : base(owner, uiKey)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void Open()
|
|
|
|
|
{
|
|
|
|
|
if (!Owner.Owner.TryGetComponent<InstrumentComponent>(out var instrument)) return;
|
|
|
|
|
|
|
|
|
|
Instrument = instrument;
|
|
|
|
|
_instrumentMenu = new InstrumentMenu(this);
|
|
|
|
|
_instrumentMenu.OnClose += Close;
|
|
|
|
|
|
|
|
|
|
_instrumentMenu.OpenCentered();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void Dispose(bool disposing)
|
|
|
|
|
{
|
|
|
|
|
base.Dispose(disposing);
|
|
|
|
|
if (!disposing) return;
|
|
|
|
|
_instrumentMenu?.Dispose();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|