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

@@ -2,7 +2,6 @@ using Content.Shared.Store;
using JetBrains.Annotations;
using System.Linq;
using Content.Shared.Store.Components;
using Robust.Client.UserInterface;
using Robust.Shared.Prototypes;
namespace Content.Client.Store.Ui;
@@ -27,10 +26,13 @@ public sealed class StoreBoundUserInterface : BoundUserInterface
protected override void Open()
{
_menu = this.CreateWindow<StoreMenu>();
_menu = new StoreMenu();
if (EntMan.TryGetComponent<StoreComponent>(Owner, out var store))
_menu.Title = Loc.GetString(store.Name);
_menu.OpenCentered();
_menu.OnClose += Close;
_menu.OnListingButtonPressed += (_, listing) =>
{
SendMessage(new StoreBuyListingMessage(listing));
@@ -75,6 +77,15 @@ public sealed class StoreBoundUserInterface : BoundUserInterface
}
}
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
if (!disposing)
return;
_menu?.Close();
_menu?.Dispose();
}
private void UpdateListingsWithSearchFilter()
{
if (_menu == null)