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 @@ + + + + +