From 2c1db3ffdf6f2fea10b5bf891b6e1805f4e8e1dd Mon Sep 17 00:00:00 2001 From: Vigers Ray <60344369+VigersRay@users.noreply.github.com> Date: Sat, 12 Apr 2025 04:05:07 +0300 Subject: [PATCH] =?UTF-8?q?=D0=90=D0=BD=D0=B0=D0=BB=D0=B8=D0=B7=D0=B0?= =?UTF-8?q?=D1=82=D0=BE=D1=80=20=D1=80=D0=B0=D1=81=D1=82=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D0=B9=20(#1755)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Ignaz Kraft --- .../PlantAnalyzerBoundUserInterface.cs | 42 ++++ .../PlantAnalyzer/PlantAnalyzerWindow.xaml | 121 ++++++++++ .../PlantAnalyzer/PlantAnalyzerWindow.xaml.cs | 210 +++++++++++++++++ .../AbstractAnalyzerComponent.cs | 68 ++++++ .../AbstractAnalyzerSystem.cs | 193 ++++++++++++++++ .../Components/PlantAnalyzerComponent.cs | 43 ++++ .../Botany/Systems/BotanySystem.Seed.cs | 27 ++- .../Botany/Systems/PlantAnalyzerSystem.cs | 206 +++++++++++++++++ .../PlantMetabolism/PlantAdjustPests.cs | 2 +- .../PlantMetabolism/PlantAdjustToxins.cs | 2 +- .../PlantMetabolism/PlantAdjustWeeds.cs | 2 +- .../Components/HealthAnalyzerComponent.cs | 60 +---- .../Medical/HealthAnalyzerSystem.cs | 212 +++--------------- .../PlantAnalyzerDoAfterEvent.cs | 9 + .../PlantAnalyzerLocalizationHelper.cs | 61 +++++ .../PlantAnalyzerScannedUserMessage.cs | 115 ++++++++++ .../PlantAnalyzer/PlantAnalyzerUiKey.cs | 9 + .../components/plant-analyzer-component.ftl | 105 +++++++++ .../components/plant-analyzer-component.ftl | 98 ++++++++ .../Catalog/Fills/Lockers/service.yml | 1 + .../VendingMachines/Inventories/nutri.yml | 3 +- .../Entities/Clothing/Belt/belts.yml | 10 +- .../Specific/Hydroponics/plant_analyzer.yml | 53 +++++ .../Entities/Structures/Machines/lathe.yml | 1 + .../Recipes/Lathes/Packs/service.yml | 10 + .../Prototypes/Recipes/Lathes/botany.yml | 5 + .../plant_analyzer.rsi/analyzer.png | Bin 0 -> 8615 bytes .../Hydroponics/plant_analyzer.rsi/icon.png | Bin 0 -> 805 bytes .../Hydroponics/plant_analyzer.rsi/meta.json | 33 +++ 29 files changed, 1445 insertions(+), 256 deletions(-) create mode 100644 Content.Client/Botany/PlantAnalyzer/PlantAnalyzerBoundUserInterface.cs create mode 100644 Content.Client/Botany/PlantAnalyzer/PlantAnalyzerWindow.xaml create mode 100644 Content.Client/Botany/PlantAnalyzer/PlantAnalyzerWindow.xaml.cs create mode 100644 Content.Server/AbstractAnalyzer/AbstractAnalyzerComponent.cs create mode 100644 Content.Server/AbstractAnalyzer/AbstractAnalyzerSystem.cs create mode 100644 Content.Server/Botany/Components/PlantAnalyzerComponent.cs create mode 100644 Content.Server/Botany/Systems/PlantAnalyzerSystem.cs create mode 100644 Content.Shared/Botany/PlantAnalyzer/PlantAnalyzerDoAfterEvent.cs create mode 100644 Content.Shared/Botany/PlantAnalyzer/PlantAnalyzerLocalizationHelper.cs create mode 100644 Content.Shared/Botany/PlantAnalyzer/PlantAnalyzerScannedUserMessage.cs create mode 100644 Content.Shared/Botany/PlantAnalyzer/PlantAnalyzerUiKey.cs create mode 100644 Resources/Locale/en-US/_strings/botany/components/plant-analyzer-component.ftl create mode 100644 Resources/Locale/ru-RU/_strings/botany/components/plant-analyzer-component.ftl create mode 100644 Resources/Prototypes/Entities/Objects/Specific/Hydroponics/plant_analyzer.yml create mode 100644 Resources/Textures/Objects/Specific/Hydroponics/plant_analyzer.rsi/analyzer.png create mode 100644 Resources/Textures/Objects/Specific/Hydroponics/plant_analyzer.rsi/icon.png create mode 100644 Resources/Textures/Objects/Specific/Hydroponics/plant_analyzer.rsi/meta.json diff --git a/Content.Client/Botany/PlantAnalyzer/PlantAnalyzerBoundUserInterface.cs b/Content.Client/Botany/PlantAnalyzer/PlantAnalyzerBoundUserInterface.cs new file mode 100644 index 0000000000..106fb2146e --- /dev/null +++ b/Content.Client/Botany/PlantAnalyzer/PlantAnalyzerBoundUserInterface.cs @@ -0,0 +1,42 @@ +using Content.Shared.Botany.PlantAnalyzer; +using JetBrains.Annotations; +using Robust.Client.UserInterface; + +namespace Content.Client.Botany.PlantAnalyzer; + +[UsedImplicitly] +public sealed class PlantAnalyzerBoundUserInterface : BoundUserInterface +{ + [ViewVariables] + private PlantAnalyzerWindow? _window; + + public PlantAnalyzerBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey) + { + } + + protected override void Open() + { + base.Open(); + _window = this.CreateWindow(); + _window.Title = EntMan.GetComponent(Owner).EntityName; + _window.Print.OnPressed += _ => Print(); + } + + protected override void ReceiveMessage(BoundUserInterfaceMessage message) + { + if (_window == null) + return; + + if (message is not PlantAnalyzerScannedUserMessage cast) + return; + + _window.Populate(cast); + } + + private void Print() + { + SendMessage(new PlantAnalyzerPrintMessage()); + if (_window != null) + _window.Print.Disabled = true; + } +} diff --git a/Content.Client/Botany/PlantAnalyzer/PlantAnalyzerWindow.xaml b/Content.Client/Botany/PlantAnalyzer/PlantAnalyzerWindow.xaml new file mode 100644 index 0000000000..1cf01af521 --- /dev/null +++ b/Content.Client/Botany/PlantAnalyzer/PlantAnalyzerWindow.xaml @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +