* 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>
37 lines
1.1 KiB
C#
37 lines
1.1 KiB
C#
using System.Collections.Generic;
|
|
using Content.Shared.MachineLinking;
|
|
using Robust.Client.AutoGenerated;
|
|
using Robust.Client.UserInterface.Controls;
|
|
using Robust.Client.UserInterface.CustomControls;
|
|
using Robust.Client.UserInterface.XAML;
|
|
|
|
namespace Content.Client.MachineLinking.UI
|
|
{
|
|
[GenerateTypedNameReferences]
|
|
public partial class SignalPortSelectorMenu : SS14Window
|
|
{
|
|
private SignalPortSelectorBoundUserInterface _bui;
|
|
|
|
public SignalPortSelectorMenu(SignalPortSelectorBoundUserInterface boundUserInterface)
|
|
{
|
|
RobustXamlLoader.Load(this);
|
|
_bui = boundUserInterface;
|
|
}
|
|
|
|
public void UpdateState(SignalPortsState state)
|
|
{
|
|
ButtonContainer.Clear();
|
|
foreach (var port in state.Ports)
|
|
{
|
|
var portBtn = new ItemList.Item(ButtonContainer)
|
|
{
|
|
Text = port.Key,
|
|
Disabled = !port.Value
|
|
};
|
|
portBtn.OnSelected += _ => _bui.OnPortSelected(port.Key);
|
|
ButtonContainer.Add(portBtn);
|
|
}
|
|
}
|
|
}
|
|
}
|