From 2fc34bface8392c36eba92faa9241c3c9e1c0aae Mon Sep 17 00:00:00 2001 From: Red <96445749+TheShuEd@users.noreply.github.com> Date: Tue, 8 Jul 2025 00:42:34 +0300 Subject: [PATCH] Workbench UI improve (#1508) * grid workbench * categorization * Update CP14WorkbenchWindow.xaml.cs * conditions * categories --- .../Workbench/CP14WorkbenchRecipeControl.xaml | 17 ++-- .../CP14WorkbenchRecipeControl.xaml.cs | 8 -- .../_CP14/Workbench/CP14WorkbenchWindow.xaml | 88 +++++++++-------- .../Workbench/CP14WorkbenchWindow.xaml.cs | 97 ++++++++++++------- .../_CP14/Workbench/CP14WorkbenchSystem.cs | 29 ++++-- .../Workbench/Conditions/MagicInWorkbench.cs | 61 ++++++++++++ .../CP14WorkbenchRecipePrototype.cs | 16 ++- .../Workbench/WorkbenchCraftCondition.cs | 51 ++++++++++ .../en-US/_CP14/workbench/categories.ftl | 6 +- .../en-US/_CP14/workbench/conditions.ftl | 1 + .../ru-RU/_CP14/workbench/categories.ftl | 6 +- .../ru-RU/_CP14/workbench/conditions.ftl | 1 + .../_CP14/Recipes/Workbench/categories.yml | 15 +++ .../_CP14/Recipes/Workbench/furnace.yml | 6 ++ .../_CP14/Recipes/Workbench/sewing_table.yml | 35 +++++++ 15 files changed, 333 insertions(+), 104 deletions(-) create mode 100644 Content.Shared/_CP14/Workbench/Conditions/MagicInWorkbench.cs create mode 100644 Content.Shared/_CP14/Workbench/WorkbenchCraftCondition.cs create mode 100644 Resources/Locale/en-US/_CP14/workbench/conditions.ftl create mode 100644 Resources/Locale/ru-RU/_CP14/workbench/conditions.ftl diff --git a/Content.Client/_CP14/Workbench/CP14WorkbenchRecipeControl.xaml b/Content.Client/_CP14/Workbench/CP14WorkbenchRecipeControl.xaml index 049b95455b..c8ebb4f284 100644 --- a/Content.Client/_CP14/Workbench/CP14WorkbenchRecipeControl.xaml +++ b/Content.Client/_CP14/Workbench/CP14WorkbenchRecipeControl.xaml @@ -1,14 +1,11 @@  - diff --git a/Content.Client/_CP14/Workbench/CP14WorkbenchRecipeControl.xaml.cs b/Content.Client/_CP14/Workbench/CP14WorkbenchRecipeControl.xaml.cs index ec35e29b35..884e5745f3 100644 --- a/Content.Client/_CP14/Workbench/CP14WorkbenchRecipeControl.xaml.cs +++ b/Content.Client/_CP14/Workbench/CP14WorkbenchRecipeControl.xaml.cs @@ -39,7 +39,6 @@ public sealed partial class CP14WorkbenchRecipeControl : Control Button.OnPressed += _ => OnSelect?.Invoke(entry, _recipePrototype); UpdateColor(); - UpdateName(); UpdateView(); } @@ -51,13 +50,6 @@ public sealed partial class CP14WorkbenchRecipeControl : Control Button.ModulateSelfOverride = Color.FromHex("#302622"); } - private void UpdateName() - { - var result = _prototype.Index(_recipePrototype.Result); - var counter = _recipePrototype.ResultCount > 1 ? $" x{_recipePrototype.ResultCount}" : ""; - Name.Text = $"{Loc.GetString(result.Name)} {counter}" ; - } - private void UpdateView() { View.SetPrototype(_recipePrototype.Result); diff --git a/Content.Client/_CP14/Workbench/CP14WorkbenchWindow.xaml b/Content.Client/_CP14/Workbench/CP14WorkbenchWindow.xaml index edaffe0a33..5a92b2283a 100644 --- a/Content.Client/_CP14/Workbench/CP14WorkbenchWindow.xaml +++ b/Content.Client/_CP14/Workbench/CP14WorkbenchWindow.xaml @@ -12,60 +12,62 @@ - + - - + + - - - - - + + + + + + - - - - - + + + + + - - - - + + + + + + + + + +