From 5cda653509394dae78d10896686d89185904519c Mon Sep 17 00:00:00 2001 From: Kill_Me_I_Noobs <118206719+Vonsant@users.noreply.github.com> Date: Sun, 1 Dec 2024 14:44:19 +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=81=D0=B5=D0=BC=D1=8F=D0=BD=20=D0=B8=20?= =?UTF-8?q?=D1=80=D0=B0=D1=81=D1=82=D0=B5=D0=BD=D0=B8=D0=B9=20(#102)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * AnalPlant * LittleFixes * LittleFixes2 --- .../UI/PlantAnalyzerBoundUserInterface.cs | 53 ++++ .../PlantAnalyzer/UI/PlantAnalyzerWindow.xaml | 50 ++++ .../UI/PlantAnalyzerWindow.xaml.cs | 203 ++++++++++++++ .../Components/PlantAnalyzerComponent.cs | 33 +++ .../Botany/Systems/PlantAnalyzerSystem.cs | 259 ++++++++++++++++++ .../PlantAnalyzerDoAfterEvent.cs | 9 + ...lantAnalyzerScannedSeedPlantInformation.cs | 93 +++++++ .../PlantAnalyzer/PlantAnalyzerUiKey.cs | 9 + .../plantanalyzer/plantanalyzer.ftl | 53 ++++ .../plantanalyzer/plantanalyzer.ftl | 53 ++++ .../objects/devices/plant_analyzer.ftl | 10 + .../VendingMachines/Inventories/nutri.yml | 1 + .../Entities/Structures/Machines/lathe.yml | 1 + .../Prototypes/Research/civilianservices.yml | 1 + .../Objects/Devices/plant_analyzer.yml | 65 +++++ .../_CorvaxNext/Recipes/Lathes/botany.yml | 9 + .../_CorvaxNext/Recipes/Lathes/devices.yml | 9 + .../Devices/plant_analyzer.rsi/icon.png | Bin 0 -> 2189 bytes .../Devices/plant_analyzer.rsi/meta.json | 40 +++ .../plant_analyzer.rsi/plantanalyzer.png | Bin 0 -> 364 bytes .../Devices/plant_analyzer.rsi/unlit.png | Bin 0 -> 1181 bytes 21 files changed, 951 insertions(+) create mode 100644 Content.Client/_CorvaxNext/PlantAnalyzer/UI/PlantAnalyzerBoundUserInterface.cs create mode 100644 Content.Client/_CorvaxNext/PlantAnalyzer/UI/PlantAnalyzerWindow.xaml create mode 100644 Content.Client/_CorvaxNext/PlantAnalyzer/UI/PlantAnalyzerWindow.xaml.cs create mode 100644 Content.Server/_CorvaxNext/Botany/Components/PlantAnalyzerComponent.cs create mode 100644 Content.Server/_CorvaxNext/Botany/Systems/PlantAnalyzerSystem.cs create mode 100644 Content.Shared/_CorvaxNext/PlantAnalyzer/PlantAnalyzerDoAfterEvent.cs create mode 100644 Content.Shared/_CorvaxNext/PlantAnalyzer/PlantAnalyzerScannedSeedPlantInformation.cs create mode 100644 Content.Shared/_CorvaxNext/PlantAnalyzer/PlantAnalyzerUiKey.cs create mode 100644 Resources/Locale/en-US/_corvaxnext/plantanalyzer/plantanalyzer.ftl create mode 100644 Resources/Locale/ru-RU/_CorvaxNext/plantanalyzer/plantanalyzer.ftl create mode 100644 Resources/Locale/ru-RU/ss14-ru/prototypes/_corvaxnext/entities/objects/devices/plant_analyzer.ftl create mode 100644 Resources/Prototypes/_CorvaxNext/Entities/Objects/Devices/plant_analyzer.yml create mode 100644 Resources/Prototypes/_CorvaxNext/Recipes/Lathes/botany.yml create mode 100644 Resources/Prototypes/_CorvaxNext/Recipes/Lathes/devices.yml create mode 100644 Resources/Textures/_CorvaxNext/Objects/Devices/plant_analyzer.rsi/icon.png create mode 100644 Resources/Textures/_CorvaxNext/Objects/Devices/plant_analyzer.rsi/meta.json create mode 100644 Resources/Textures/_CorvaxNext/Objects/Devices/plant_analyzer.rsi/plantanalyzer.png create mode 100644 Resources/Textures/_CorvaxNext/Objects/Devices/plant_analyzer.rsi/unlit.png diff --git a/Content.Client/_CorvaxNext/PlantAnalyzer/UI/PlantAnalyzerBoundUserInterface.cs b/Content.Client/_CorvaxNext/PlantAnalyzer/UI/PlantAnalyzerBoundUserInterface.cs new file mode 100644 index 00000000000..8c8d571e7a7 --- /dev/null +++ b/Content.Client/_CorvaxNext/PlantAnalyzer/UI/PlantAnalyzerBoundUserInterface.cs @@ -0,0 +1,53 @@ +using Content.Shared._CorvaxNext.PlantAnalyzer; +using JetBrains.Annotations; + +namespace Content.Client._CorvaxNext.PlantAnalyzer.UI; + +[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 = new PlantAnalyzerWindow(this) + { + Title = Loc.GetString("plant-analyzer-interface-title"), + }; + _window.OnClose += Close; + _window.OpenCenteredLeft(); + } + + protected override void ReceiveMessage(BoundUserInterfaceMessage message) + { + if (_window == null) + return; + + if (message is not PlantAnalyzerScannedSeedPlantInformation cast) + return; + _window.Populate(cast); + } + + public void AdvPressed(bool scanMode) + { + SendMessage(new PlantAnalyzerSetMode(scanMode)); + } + + protected override void Dispose(bool disposing) + { + base.Dispose(disposing); + if (!disposing) + return; + + if (_window != null) + _window.OnClose -= Close; + + _window?.Dispose(); + } +} \ No newline at end of file diff --git a/Content.Client/_CorvaxNext/PlantAnalyzer/UI/PlantAnalyzerWindow.xaml b/Content.Client/_CorvaxNext/PlantAnalyzer/UI/PlantAnalyzerWindow.xaml new file mode 100644 index 00000000000..5405a858d89 --- /dev/null +++ b/Content.Client/_CorvaxNext/PlantAnalyzer/UI/PlantAnalyzerWindow.xaml @@ -0,0 +1,50 @@ + + + + +