2023-08-12 17:39:58 -04:00
|
|
|
using Content.Client.UserInterface.Controls;
|
|
|
|
|
using Content.Shared.Silicons.Laws.Components;
|
|
|
|
|
using Robust.Client.AutoGenerated;
|
|
|
|
|
using Robust.Client.UserInterface.XAML;
|
|
|
|
|
|
|
|
|
|
namespace Content.Client.Silicons.Laws.Ui;
|
|
|
|
|
|
|
|
|
|
[GenerateTypedNameReferences]
|
|
|
|
|
public sealed partial class SiliconLawMenu : FancyWindow
|
|
|
|
|
{
|
|
|
|
|
public SiliconLawMenu()
|
|
|
|
|
{
|
|
|
|
|
RobustXamlLoader.Load(this);
|
|
|
|
|
IoCManager.InjectDependencies(this);
|
|
|
|
|
}
|
|
|
|
|
|
2023-08-24 21:56:01 -05:00
|
|
|
public void Update(EntityUid uid, SiliconLawBuiState state)
|
2023-08-12 17:39:58 -04:00
|
|
|
{
|
|
|
|
|
state.Laws.Sort();
|
2023-08-13 03:09:30 -04:00
|
|
|
LawDisplayContainer.Children.Clear();
|
2023-08-24 21:56:01 -05:00
|
|
|
|
2023-08-12 17:39:58 -04:00
|
|
|
foreach (var law in state.Laws)
|
|
|
|
|
{
|
2023-08-24 21:56:01 -05:00
|
|
|
var control = new LawDisplay(uid, law, state.RadioChannels);
|
2023-08-12 17:39:58 -04:00
|
|
|
|
|
|
|
|
LawDisplayContainer.AddChild(control);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|