Content update for NetEntities (#18935)
This commit is contained in:
@@ -20,8 +20,11 @@ namespace Content.Client.Kitchen.UI
|
||||
[ViewVariables]
|
||||
private readonly Dictionary<int, ReagentQuantity> _reagents = new();
|
||||
|
||||
private IEntityManager _entManager;
|
||||
|
||||
public MicrowaveBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
_entManager = IoCManager.Resolve<IEntityManager>();
|
||||
}
|
||||
|
||||
protected override void Open()
|
||||
@@ -34,7 +37,7 @@ namespace Content.Client.Kitchen.UI
|
||||
_menu.EjectButton.OnPressed += _ => SendMessage(new MicrowaveEjectMessage());
|
||||
_menu.IngredientsList.OnItemSelected += args =>
|
||||
{
|
||||
SendMessage(new MicrowaveEjectSolidIndexedMessage(_solids[args.ItemIndex]));
|
||||
SendMessage(new MicrowaveEjectSolidIndexedMessage(EntMan.GetNetEntity(_solids[args.ItemIndex])));
|
||||
};
|
||||
|
||||
_menu.OnCookTimeSelected += (args, buttonIndex) =>
|
||||
@@ -57,7 +60,6 @@ namespace Content.Client.Kitchen.UI
|
||||
_menu?.Dispose();
|
||||
}
|
||||
|
||||
|
||||
protected override void UpdateState(BoundUserInterfaceState state)
|
||||
{
|
||||
base.UpdateState(state);
|
||||
@@ -67,7 +69,9 @@ namespace Content.Client.Kitchen.UI
|
||||
}
|
||||
|
||||
_menu?.ToggleBusyDisableOverlayPanel(cState.IsMicrowaveBusy);
|
||||
RefreshContentsDisplay(cState.ContainedSolids);
|
||||
|
||||
// TODO move this to a component state and ensure the net ids.
|
||||
RefreshContentsDisplay(_entManager.GetEntityArray(cState.ContainedSolids));
|
||||
|
||||
if (_menu == null) return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user