Files
crystall-punk-14/Content.Client/GameObjects/Components/Kitchen/MicrowaveBoundUserInterface.cs

49 lines
1.4 KiB
C#
Raw Normal View History

using Robust.Client.GameObjects.Components.UserInterface;
2020-05-01 23:34:04 -05:00
using Content.Shared.Kitchen;
using Robust.Shared.GameObjects.Components.UserInterface;
namespace Content.Client.GameObjects.Components.Kitchen
{
public class MicrowaveBoundUserInterface : BoundUserInterface
{
2020-05-01 23:34:04 -05:00
private MicrowaveMenu _menu;
public MicrowaveBoundUserInterface(ClientUserInterfaceComponent owner, object uiKey) : base(owner,uiKey)
{
}
2020-05-01 23:34:04 -05:00
protected override void Open()
{
base.Open();
_menu = new MicrowaveMenu(this);
_menu.OpenCentered();
_menu.OnClose += Close;
}
protected override void UpdateState(BoundUserInterfaceState state)
{
base.UpdateState(state);
2020-05-03 01:34:00 -05:00
if (!(state is MicrowaveUpdateUserInterfaceState cstate))
2020-05-01 23:34:04 -05:00
return;
2020-05-03 01:34:00 -05:00
_menu.RefreshContentsDisplay(cstate.ReagentsReagents, cstate.ContainedSolids);
2020-05-01 23:34:04 -05:00
}
public void Cook()
{
SendMessage(new SharedMicrowaveComponent.MicrowaveStartCookMessage());
}
public void Eject()
{
SendMessage(new SharedMicrowaveComponent.MicrowaveEjectMessage());
}
2020-05-03 01:34:00 -05:00
public void EjectSolidWithIndex(int index)
{
SendMessage(new SharedMicrowaveComponent.MicrowaveEjectSolidIndexedMessage(index));
}
}
}