diff --git a/Content.Client/_CP14/Workbench/CP14WorkbenchBoundUserInterface.cs b/Content.Client/_CP14/Workbench/CP14WorkbenchBoundUserInterface.cs index 03ca3bedfd..810aa36901 100644 --- a/Content.Client/_CP14/Workbench/CP14WorkbenchBoundUserInterface.cs +++ b/Content.Client/_CP14/Workbench/CP14WorkbenchBoundUserInterface.cs @@ -12,6 +12,9 @@ public sealed class CP14WorkbenchBoundUserInterface : BoundUserInterface { private CP14WorkbenchWindow? _window; + [ViewVariables] + private string _search = string.Empty; + public CP14WorkbenchBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey) { } @@ -23,6 +26,12 @@ public sealed class CP14WorkbenchBoundUserInterface : BoundUserInterface _window = this.CreateWindow(); _window.OnCraft += entry => SendMessage(new CP14WorkbenchUiCraftMessage(entry.ProtoId)); + + _window.OnTextUpdated += search => + { + _search = search.Trim().ToLowerInvariant(); + _window.UpdateFilter(_search); + }; } protected override void UpdateState(BoundUserInterfaceState state) @@ -32,7 +41,7 @@ public sealed class CP14WorkbenchBoundUserInterface : BoundUserInterface switch (state) { case CP14WorkbenchUiRecipesState recipesState: - _window?.UpdateRecipes(recipesState); + _window?.UpdateRecipes(recipesState, _search); break; } } diff --git a/Content.Client/_CP14/Workbench/CP14WorkbenchRecipeControl.xaml b/Content.Client/_CP14/Workbench/CP14WorkbenchRecipeControl.xaml index fab7715ae6..fb6998a909 100644 --- a/Content.Client/_CP14/Workbench/CP14WorkbenchRecipeControl.xaml +++ b/Content.Client/_CP14/Workbench/CP14WorkbenchRecipeControl.xaml @@ -1,10 +1,20 @@  - - diff --git a/Content.Client/_CP14/Workbench/CP14WorkbenchRecipeControl.xaml.cs b/Content.Client/_CP14/Workbench/CP14WorkbenchRecipeControl.xaml.cs index 747dbff6fe..5fbe8b477d 100644 --- a/Content.Client/_CP14/Workbench/CP14WorkbenchRecipeControl.xaml.cs +++ b/Content.Client/_CP14/Workbench/CP14WorkbenchRecipeControl.xaml.cs @@ -31,7 +31,9 @@ public sealed partial class CP14WorkbenchRecipeControl : Control { var entityName = prototype.Name; Name.Text = count <= 1 ? entityName : $"{entityName} x{count}"; - View.Texture = _sprite.GetPrototypeIcon(prototype).Default; + + View.Visible = false; + EntityView.SetPrototype(prototype); } public CP14WorkbenchRecipeControl(StackPrototype prototype, int count) : this() @@ -43,6 +45,7 @@ public sealed partial class CP14WorkbenchRecipeControl : Control if (icon is null) return; + EntityView.Visible = false; View.Texture = _sprite.Frame0(icon); } } diff --git a/Content.Client/_CP14/Workbench/CP14WorkbenchRequirementControl.xaml b/Content.Client/_CP14/Workbench/CP14WorkbenchRequirementControl.xaml index 3efee3eace..049b95455b 100644 --- a/Content.Client/_CP14/Workbench/CP14WorkbenchRequirementControl.xaml +++ b/Content.Client/_CP14/Workbench/CP14WorkbenchRequirementControl.xaml @@ -1,11 +1,13 @@  diff --git a/Content.Client/_CP14/Workbench/CP14WorkbenchRequirementControl.xaml.cs b/Content.Client/_CP14/Workbench/CP14WorkbenchRequirementControl.xaml.cs index 4563643a3f..7686375fbf 100644 --- a/Content.Client/_CP14/Workbench/CP14WorkbenchRequirementControl.xaml.cs +++ b/Content.Client/_CP14/Workbench/CP14WorkbenchRequirementControl.xaml.cs @@ -59,6 +59,6 @@ public sealed partial class CP14WorkbenchRequirementControl : Control private void UpdateView() { - View.Texture = _sprite.GetPrototypeIcon(_recipePrototype.Result).Default; + View.SetPrototype(_recipePrototype.Result); } } diff --git a/Content.Client/_CP14/Workbench/CP14WorkbenchWindow.xaml b/Content.Client/_CP14/Workbench/CP14WorkbenchWindow.xaml index 86daf28101..d1f45eb2e2 100644 --- a/Content.Client/_CP14/Workbench/CP14WorkbenchWindow.xaml +++ b/Content.Client/_CP14/Workbench/CP14WorkbenchWindow.xaml @@ -2,59 +2,68 @@ xmlns:graphics="clr-namespace:Robust.Client.Graphics;assembly=Robust.Client" xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls" Title="{Loc 'cp14-workbench-ui-title'}" - MinSize="700 600"> - + SetSize="700 500" + MinSize="700 300"> + - + + + + - + + - - - - - - - + + + + + + + - - - - - - + + + + + MaxSize="64 64" + HorizontalAlignment="Left" /> - - - - - - - - -