Revert "Remove some BUI boilerplate" (#30214)

Revert "Remove some BUI boilerplate (#28399)"

This reverts commit cbf329a82d.
This commit is contained in:
Nemanja
2024-07-20 20:42:27 -04:00
committed by GitHub
parent 6d664c9157
commit cb0ba66be3
137 changed files with 1755 additions and 1096 deletions

View File

@@ -9,20 +9,17 @@ namespace Content.Client.NetworkConfigurator;
[GenerateTypedNameReferences]
public sealed partial class NetworkConfiguratorListMenu : FancyWindow
{
public event Action<string>? OnRemoveAddress;
public NetworkConfiguratorListMenu()
private readonly NetworkConfiguratorBoundUserInterface _ui;
public NetworkConfiguratorListMenu(NetworkConfiguratorBoundUserInterface ui)
{
RobustXamlLoader.Load(this);
DeviceList.OnRemoveAddress += args =>
{
OnRemoveAddress?.Invoke(args);
};
_ui = ui;
}
public void UpdateState(NetworkConfiguratorUserInterfaceState state)
{
DeviceCountLabel.Text = Loc.GetString("network-configurator-ui-count-label", ("count", state.DeviceList.Count));
DeviceList.UpdateState(state.DeviceList, true);
DeviceList.UpdateState(_ui, state.DeviceList);
}
}