diff --git a/Content.Client/Nyanotrasen/Kitchen/Components/DeepFriedComponent.cs b/Content.Client/Nyanotrasen/Kitchen/Components/DeepFriedComponent.cs new file mode 100644 index 00000000000..a1252cf43ed --- /dev/null +++ b/Content.Client/Nyanotrasen/Kitchen/Components/DeepFriedComponent.cs @@ -0,0 +1,10 @@ +using Content.Shared.Kitchen.Components; + +namespace Content.Client.Kitchen.Components +{ + [RegisterComponent] + //Unnecessary item: [ComponentReference(typeof(SharedDeepFriedComponent))] + public sealed partial class DeepFriedComponent : SharedDeepFriedComponent + { + } +} diff --git a/Content.Client/Nyanotrasen/Kitchen/Components/DeepFryerComponent.cs b/Content.Client/Nyanotrasen/Kitchen/Components/DeepFryerComponent.cs new file mode 100644 index 00000000000..4123eb341ca --- /dev/null +++ b/Content.Client/Nyanotrasen/Kitchen/Components/DeepFryerComponent.cs @@ -0,0 +1,10 @@ +using Content.Shared.Kitchen.Components; + +namespace Content.Client.Kitchen.Components +{ + [RegisterComponent] + // Unnecessary line: [ComponentReference(typeof(SharedDeepFryerComponent))] + public sealed partial class DeepFryerComponent : SharedDeepFryerComponent + { + } +} diff --git a/Content.Client/Nyanotrasen/Kitchen/UI/DeepFryerBoundUserInterface.cs b/Content.Client/Nyanotrasen/Kitchen/UI/DeepFryerBoundUserInterface.cs new file mode 100644 index 00000000000..8db884328e4 --- /dev/null +++ b/Content.Client/Nyanotrasen/Kitchen/UI/DeepFryerBoundUserInterface.cs @@ -0,0 +1,64 @@ +using Robust.Client.GameObjects; +using Content.Shared.Kitchen.UI; + +namespace Content.Client.Nyanotrasen.Kitchen.UI +{ + public sealed class DeepFryerBoundUserInterface : BoundUserInterface + { + private DeepFryerWindow? _window; + + private NetEntity[] _entities = default!; + + public DeepFryerBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey) + { + base.Open(); + _window = new DeepFryerWindow(); + _window.OnClose += Close; + _window.ItemList.OnItemSelected += args => + { + SendMessage(new DeepFryerRemoveItemMessage(_entities[args.ItemIndex])); + }; + _window.InsertItem.OnPressed += _ => + { + SendMessage(new DeepFryerInsertItemMessage()); + }; + _window.ScoopVat.OnPressed += _ => + { + SendMessage(new DeepFryerScoopVatMessage()); + }; + _window.ClearSlag.OnPressed += args => + { + SendMessage(new DeepFryerClearSlagMessage()); + }; + _window.RemoveAllItems.OnPressed += _ => + { + SendMessage(new DeepFryerRemoveAllItemsMessage()); + }; + _window.OpenCentered(); + } + + protected override void UpdateState(BoundUserInterfaceState state) + { + base.UpdateState(state); + + if (_window == null) + return; + + if (state is not DeepFryerBoundUserInterfaceState cast) + return; + + _entities = cast.ContainedEntities; + _window.UpdateState(cast); + } + + protected override void Dispose(bool disposing) + { + base.Dispose(disposing); + + if (!disposing) + return; + + _window?.Dispose(); + } + } +} diff --git a/Content.Client/Nyanotrasen/Kitchen/UI/DeepFryerWindow.xaml b/Content.Client/Nyanotrasen/Kitchen/UI/DeepFryerWindow.xaml new file mode 100644 index 00000000000..6ada0b95baf --- /dev/null +++ b/Content.Client/Nyanotrasen/Kitchen/UI/DeepFryerWindow.xaml @@ -0,0 +1,67 @@ + + + + + +