* started work * some more work, ui working (somewhat) * stuff * reorganization * some more reorg * conveyors * conveyors working * finalized (dis)connection added linkattempt added feedback text work on conveyors * removed command add rangecheck * fixed inrange check * handling * ui no longer kanser, ship it * adresses reviews * reformats file * reformats file Co-authored-by: Paul <ritter.paul1+git@googlemail.com>
51 lines
1.3 KiB
C#
51 lines
1.3 KiB
C#
using Content.Shared.MachineLinking;
|
|
using JetBrains.Annotations;
|
|
using Robust.Client.GameObjects;
|
|
using Robust.Shared.GameObjects;
|
|
|
|
namespace Content.Client.MachineLinking.UI
|
|
{
|
|
public class SignalPortSelectorBoundUserInterface : BoundUserInterface
|
|
{
|
|
private SignalPortSelectorMenu? _menu;
|
|
|
|
public SignalPortSelectorBoundUserInterface([NotNull] ClientUserInterfaceComponent owner, [NotNull] object uiKey) : base(owner, uiKey)
|
|
{
|
|
}
|
|
|
|
protected override void Open()
|
|
{
|
|
base.Open();
|
|
|
|
_menu = new SignalPortSelectorMenu(this);
|
|
_menu.OnClose += Close;
|
|
_menu.OpenCentered();
|
|
}
|
|
|
|
protected override void UpdateState(BoundUserInterfaceState state)
|
|
{
|
|
base.UpdateState(state);
|
|
switch (state)
|
|
{
|
|
case SignalPortsState data:
|
|
_menu?.UpdateState(data);
|
|
break;
|
|
}
|
|
}
|
|
|
|
public void OnPortSelected(string port)
|
|
{
|
|
SendMessage(new SignalPortSelected(port));
|
|
}
|
|
|
|
protected override void Dispose(bool disposing)
|
|
{
|
|
base.Dispose(disposing);
|
|
if (!disposing)
|
|
return;
|
|
|
|
_menu?.Dispose();
|
|
}
|
|
}
|
|
}
|