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

@@ -1,6 +1,4 @@
using Content.Shared.Research.Components;
using Robust.Client.GameObjects;
using Robust.Client.UserInterface;
namespace Content.Client.Research.UI
{
@@ -17,9 +15,10 @@ namespace Content.Client.Research.UI
protected override void Open()
{
base.Open();
_menu = this.CreateWindow<ResearchClientServerSelectionMenu>();
_menu.OnServerSelected += SelectServer;
_menu.OnServerDeselected += DeselectServer;
_menu = new ResearchClientServerSelectionMenu(this);
_menu.OnClose += Close;
_menu.OpenCentered();
}
public void SelectServer(int serverId)
@@ -38,5 +37,12 @@ namespace Content.Client.Research.UI
if (state is not ResearchClientBoundInterfaceState rState) return;
_menu?.Populate(rState.ServerCount, rState.ServerNames, rState.ServerIds, rState.SelectedServerId);
}
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
if (!disposing) return;
_menu?.Dispose();
}
}
}