Cleaner BoundUserInterfaces (#17736)

This commit is contained in:
TemporalOroboros
2023-07-08 09:02:17 -07:00
committed by GitHub
parent 55b4fb1649
commit 3ac4cf85db
137 changed files with 1069 additions and 972 deletions

View File

@@ -11,9 +11,10 @@ namespace Content.Client.VendingMachines
[ViewVariables]
private VendingMachineMenu? _menu;
[ViewVariables]
private List<VendingMachineInventoryEntry> _cachedInventory = new();
public VendingMachineBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey)
public VendingMachineBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
{
}
@@ -21,12 +22,11 @@ namespace Content.Client.VendingMachines
{
base.Open();
var entMan = IoCManager.Resolve<IEntityManager>();
var vendingMachineSys = entMan.System<VendingMachineSystem>();
var vendingMachineSys = EntMan.System<VendingMachineSystem>();
_cachedInventory = vendingMachineSys.GetAllInventory(Owner.Owner);
_cachedInventory = vendingMachineSys.GetAllInventory(Owner);
_menu = new VendingMachineMenu {Title = entMan.GetComponent<MetaDataComponent>(Owner.Owner).EntityName};
_menu = new VendingMachineMenu { Title = EntMan.GetComponent<MetaDataComponent>(Owner).EntityName };
_menu.OnClose += Close;
_menu.OnItemSelected += OnItemSelected;