Remove GalacticMarket component (#7914)

This commit is contained in:
20kdc
2022-05-04 03:51:25 +01:00
committed by GitHub
parent 10847e004f
commit 2e0fcbab5a
9 changed files with 47 additions and 353 deletions

View File

@@ -19,9 +19,6 @@ namespace Content.Client.Cargo
[ViewVariables]
private CargoConsoleOrderMenu? _orderMenu;
[ViewVariables]
public GalacticMarketComponent? Market { get; private set; }
[ViewVariables]
public CargoOrderDatabaseComponent? Orders { get; private set; }
@@ -51,10 +48,8 @@ namespace Content.Client.Cargo
base.Open();
var entMan = IoCManager.Resolve<IEntityManager>();
if (!entMan.TryGetComponent(Owner.Owner, out GalacticMarketComponent? market) ||
!entMan.TryGetComponent(Owner.Owner, out CargoOrderDatabaseComponent? orders)) return;
if (!entMan.TryGetComponent(Owner.Owner, out CargoOrderDatabaseComponent? orders)) return;
Market = market;
Orders = orders;
_menu = new CargoConsoleMenu(this);
@@ -64,8 +59,6 @@ namespace Content.Client.Cargo
_menu.Populate();
Market.OnDatabaseUpdated += _menu.PopulateProducts;
Market.OnDatabaseUpdated += _menu.PopulateCategories;
Orders.OnDatabaseUpdated += _menu.PopulateOrders;
_menu.CallShuttleButton.OnPressed += (_) =>
@@ -121,12 +114,6 @@ namespace Content.Client.Cargo
if (!disposing) return;
if (Market != null && _menu != null)
{
Market.OnDatabaseUpdated -= _menu.PopulateProducts;
Market.OnDatabaseUpdated -= _menu.PopulateCategories;
}
if (Orders != null && _menu != null)
{
Orders.OnDatabaseUpdated -= _menu.PopulateOrders;