From 53dc27cb1e16d119ed72f1cc75e1004c57e3a24e Mon Sep 17 00:00:00 2001 From: Dora <27211909+catdotjs@users.noreply.github.com> Date: Thu, 27 Feb 2025 13:19:52 +0200 Subject: [PATCH] Adding sorting to chem master (#34763) * Adding sorting to chem master * Chem Master can now sort based on following categories - Alphabetical - Quantity - Time Added to Machine * Sorting is disabled by default and persist in the machine for everyone * Removed some pointless code from Chem Master's UI * Changed None and Time Added's text to reflect what they do better * Minor adjustments to the code requested by maintainers --- .../UI/ChemMasterBoundUserInterface.cs | 2 + .../Chemistry/UI/ChemMasterWindow.xaml | 1 + .../Chemistry/UI/ChemMasterWindow.xaml.cs | 67 +++++++++++++++---- .../Components/ChemMasterComponent.cs | 3 + .../EntitySystems/ChemMasterSystem.cs | 12 +++- Content.Shared/Chemistry/SharedChemMaster.cs | 17 ++++- .../components/chem-master-component.ftl | 4 ++ 7 files changed, 91 insertions(+), 15 deletions(-) diff --git a/Content.Client/Chemistry/UI/ChemMasterBoundUserInterface.cs b/Content.Client/Chemistry/UI/ChemMasterBoundUserInterface.cs index 3ef7f0ae73..a669a8da4c 100644 --- a/Content.Client/Chemistry/UI/ChemMasterBoundUserInterface.cs +++ b/Content.Client/Chemistry/UI/ChemMasterBoundUserInterface.cs @@ -46,6 +46,8 @@ namespace Content.Client.Chemistry.UI _window.CreateBottleButton.OnPressed += _ => SendMessage( new ChemMasterOutputToBottleMessage( (uint) _window.BottleDosage.Value, _window.LabelLine)); + _window.BufferSortButton.OnPressed += _ => SendMessage( + new ChemMasterSortingTypeCycleMessage()); for (uint i = 0; i < _window.PillTypeButtons.Length; i++) { diff --git a/Content.Client/Chemistry/UI/ChemMasterWindow.xaml b/Content.Client/Chemistry/UI/ChemMasterWindow.xaml index b1f4f5917f..aca316f6b3 100644 --- a/Content.Client/Chemistry/UI/ChemMasterWindow.xaml +++ b/Content.Client/Chemistry/UI/ChemMasterWindow.xaml @@ -34,6 +34,7 @@