From f92d9787a7698cd1d012928847bb084399bbbe2d Mon Sep 17 00:00:00 2001 From: Whatstone <166147148+whatston3@users.noreply.github.com> Date: Tue, 10 Sep 2024 14:47:13 -0400 Subject: [PATCH 01/40] SpawnAfterInteract: QueueDel, not TryQueueDel (#1983) --- .../Engineering/EntitySystems/SpawnAfterInteractSystem.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Content.Server/Engineering/EntitySystems/SpawnAfterInteractSystem.cs b/Content.Server/Engineering/EntitySystems/SpawnAfterInteractSystem.cs index 8391e8faada..6ad9f19bed6 100644 --- a/Content.Server/Engineering/EntitySystems/SpawnAfterInteractSystem.cs +++ b/Content.Server/Engineering/EntitySystems/SpawnAfterInteractSystem.cs @@ -66,7 +66,7 @@ bool IsTileClear() EntityManager.SpawnEntity(component.Prototype, args.ClickLocation.SnapToGrid(grid)); if (component.RemoveOnInteract && stackComp == null) - TryQueueDel(uid); + QueueDel(uid); // Frontier: TryQueueDel Date: Tue, 10 Sep 2024 18:47:47 +0000 Subject: [PATCH 02/40] Automatic Changelog (#1983) --- Resources/Changelog/Changelog.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Resources/Changelog/Changelog.yml b/Resources/Changelog/Changelog.yml index eee1403e7da..5f466475bc5 100644 --- a/Resources/Changelog/Changelog.yml +++ b/Resources/Changelog/Changelog.yml @@ -6812,3 +6812,9 @@ Entries: message: Techfabs no longer display an ERROR when running. id: 5254 time: '2024-09-10T13:57:01.0000000+00:00' +- author: whatston3 + changes: + - type: Fix + message: Turrets are properly consumed on deploying. + id: 5255 + time: '2024-09-10T18:47:13.0000000+00:00' From 61b4d29974e05b5cf366e33cb76489150a6ac8f3 Mon Sep 17 00:00:00 2001 From: Whatstone <166147148+whatston3@users.noreply.github.com> Date: Tue, 10 Sep 2024 14:48:12 -0400 Subject: [PATCH 03/40] Harpies' sound can only be changed by themselves (#1978) --- Content.Server/Instruments/SwappableInstrumentComponent.cs | 7 +++++++ Content.Server/Instruments/SwappableInstrumentSystem.cs | 3 +++ .../Prototypes/DeltaV/Entities/Mobs/Species/harpy.yml | 1 + 3 files changed, 11 insertions(+) diff --git a/Content.Server/Instruments/SwappableInstrumentComponent.cs b/Content.Server/Instruments/SwappableInstrumentComponent.cs index f8b2b97a102..6acf43151d3 100644 --- a/Content.Server/Instruments/SwappableInstrumentComponent.cs +++ b/Content.Server/Instruments/SwappableInstrumentComponent.cs @@ -11,4 +11,11 @@ public sealed partial class SwappableInstrumentComponent : Component /// [DataField("instrumentList", required: true)] public Dictionary InstrumentList = new(); + + // Frontier: harpy instruments + /// + /// When true, only the instrument entity itself can swap its sound. + /// + [DataField] + public bool OnlySetBySelf; } diff --git a/Content.Server/Instruments/SwappableInstrumentSystem.cs b/Content.Server/Instruments/SwappableInstrumentSystem.cs index 9aef875cd65..81b3b2c1002 100644 --- a/Content.Server/Instruments/SwappableInstrumentSystem.cs +++ b/Content.Server/Instruments/SwappableInstrumentSystem.cs @@ -25,6 +25,9 @@ private void AddStyleVerb(EntityUid uid, SwappableInstrumentComponent component, if (!TryComp(uid, out var instrument)) return; + if (component.OnlySetBySelf && uid != args.User) // Frontier: restrict instrument changes + return; // Frontier: restrict instrument changes + var priority = 0; foreach (var entry in component.InstrumentList) { diff --git a/Resources/Prototypes/DeltaV/Entities/Mobs/Species/harpy.yml b/Resources/Prototypes/DeltaV/Entities/Mobs/Species/harpy.yml index 38cdf1cf309..efcb6c88735 100644 --- a/Resources/Prototypes/DeltaV/Entities/Mobs/Species/harpy.yml +++ b/Resources/Prototypes/DeltaV/Entities/Mobs/Species/harpy.yml @@ -22,6 +22,7 @@ "Piano": {1: 0} "Church Organ": {19: 0} "Harp": {46: 0} + onlySetBySelf: true - type: UserInterface interfaces: enum.InstrumentUiKey.Key: From 2afd0ee2b4c2a373f202492953570cad4849d0c0 Mon Sep 17 00:00:00 2001 From: Whatstone <166147148+whatston3@users.noreply.github.com> Date: Tue, 10 Sep 2024 14:48:23 -0400 Subject: [PATCH 04/40] Revise harpy emote sets & noises. (#1984) * Harpy: cull loud/grating/long snds, +clicks/squish * Honk: Volume->volume --- .../DeltaV/SoundCollections/harpy.yml | 81 ++++++++++--------- .../DeltaV/Voice/speech_emote_sounds.yml | 12 ++- .../Prototypes/DeltaV/Voice/speech_emotes.yml | 52 ++++-------- Resources/Prototypes/Voice/speech_emotes.yml | 14 ++++ 4 files changed, 82 insertions(+), 77 deletions(-) diff --git a/Resources/Prototypes/DeltaV/SoundCollections/harpy.yml b/Resources/Prototypes/DeltaV/SoundCollections/harpy.yml index 69dbf744c94..e2b953cec04 100644 --- a/Resources/Prototypes/DeltaV/SoundCollections/harpy.yml +++ b/Resources/Prototypes/DeltaV/SoundCollections/harpy.yml @@ -38,8 +38,8 @@ files: - /Audio/Nyanotrasen/Voice/Felinid/cat_hiss1.ogg - /Audio/Nyanotrasen/Voice/Felinid/cat_hiss2.ogg - - /Audio/Weapons/ebladeon.ogg - - /Audio/Weapons/eblade1.ogg + # - /Audio/Weapons/ebladeon.ogg # Frontier: why + # - /Audio/Weapons/eblade1.ogg # Frontier: why - /Audio/Items/hiss.ogg - /Audio/Items/hypospray.ogg - /Audio/Items/ratchet.ogg @@ -49,7 +49,7 @@ - /Audio/Machines/airlock_ext_open.ogg - /Audio/Machines/airlock_open.ogg - /Audio/Machines/disposalflush.ogg - - /Audio/Machines/printer.ogg + # - /Audio/Machines/printer.ogg # Frontier: why - /Audio/Machines/windoor_open.ogg - /Audio/Effects/spray.ogg - /Audio/Effects/spray2.ogg @@ -103,15 +103,15 @@ id: HarpyPurrs files: - /Audio/Nyanotrasen/Voice/Felinid/cat_purr1.ogg - - /Audio/Mecha/sound_mecha_hydraulic.ogg + # - /Audio/Mecha/sound_mecha_hydraulic.ogg # Frontier: loud - type: soundCollection id: HarpyRings files: - /Audio/Items/desk_bell_ring.ogg - - /Audio/Items/ring.ogg - - /Audio/Machines/ding.ogg - - /Audio/Machines/warning_buzzer.ogg + # - /Audio/Items/ring.ogg # Frontier: loud + # - /Audio/Machines/ding.ogg # Frontier: long + # - /Audio/Machines/warning_buzzer.ogg # Frontier: long - type: soundCollection id: HarpyHonks @@ -131,36 +131,36 @@ - /Audio/Effects/Arcade/player_attack.ogg - /Audio/Effects/Arcade/player_charge.ogg - /Audio/Effects/Arcade/player_heal.ogg - - /Audio/Magic/staff_animation.ogg - - /Audio/Magic/staff_change.ogg - - /Audio/Magic/staff_chaos.ogg - - /Audio/Magic/staff_door.ogg - - /Audio/Magic/staff_healing.ogg + # - /Audio/Magic/staff_animation.ogg # Frontier: loud + # - /Audio/Magic/staff_change.ogg # Frontier: loud + # - /Audio/Magic/staff_chaos.ogg # Frontier: loud + # - /Audio/Magic/staff_door.ogg # Frontier: not a pew + # - /Audio/Magic/staff_healing.ogg # Frontier: not a pew - type: soundCollection id: HarpyBangs files: - /Audio/Weapons/Guns/Gunshots/atreides.ogg - - /Audio/Weapons/Guns/Gunshots/bang.ogg + # - /Audio/Weapons/Guns/Gunshots/bang.ogg # Frontier: loud - /Audio/Weapons/Guns/Gunshots/mk58.ogg - /Audio/Weapons/Guns/Gunshots/pistol.ogg - /Audio/Weapons/Guns/Gunshots/c-20r.ogg - /Audio/Items/snap.ogg - /Audio/Machines/blastdoor.ogg - /Audio/Machines/machine_vend.ogg - - /Audio/Magic/disintegrate.ogg - - /Audio/Magic/fireball.ogg - - /Audio/Magic/forcewall.ogg - - /Audio/Magic/knock.ogg + # - /Audio/Magic/disintegrate.ogg # Frontier: long, LOUD + # - /Audio/Magic/fireball.ogg # Frontier: loud + # - /Audio/Magic/forcewall.ogg # Frontier: loud + # - /Audio/Magic/knock.ogg # Frontier: long - type: soundCollection id: HarpyBeeps files: - - /Audio/Weapons/Guns/EmptyAlarm/smg_empty_alarm.ogg + # - /Audio/Weapons/Guns/EmptyAlarm/smg_empty_alarm.ogg # Frontier: loud, grating - /Audio/Items/beep.ogg - - /Audio/Items/flashlight_pda.ogg + # - /Audio/Items/flashlight_pda.ogg # Frontier: not a beep - /Audio/Items/locator_beep.ogg - - /Audio/Items/toolbox_drop.ogg + # - /Audio/Items/toolbox_drop.ogg # Frontier: not a beep - /Audio/Items/Defib/defib_charge.ogg - /Audio/Items/Defib/defib_ready.ogg - /Audio/Items/Defib/defib_safety_off.ogg @@ -178,16 +178,16 @@ - /Audio/Effects/RingtoneNotes/fsharp.ogg - /Audio/Effects/RingtoneNotes/g.ogg - /Audio/Effects/RingtoneNotes/gsharp.ogg - - /Audio/Effects/Arcade/gameover.ogg - - /Audio/Effects/Arcade/win.ogg + # - /Audio/Effects/Arcade/gameover.ogg # Frontier: annoying + # - /Audio/Effects/Arcade/win.ogg # Frontier: annoying - /Audio/Machines/airlock_deny.ogg - - /Audio/Machines/alarm.ogg + # - /Audio/Machines/alarm.ogg # Frontier: long, grating - /Audio/Machines/beep.ogg - - /Audio/Machines/boltsdown.ogg - - /Audio/Machines/boltsup.ogg + # - /Audio/Machines/boltsdown.ogg # Frontier: not a beep + # - /Audio/Machines/boltsup.ogg # Frontier: not a beep - /Audio/Machines/custom_deny.ogg - /Audio/Machines/high_tech_confirm.ogg - - /Audio/Machines/microwave_done_beep.ogg + # - /Audio/Machines/microwave_done_beep.ogg # Frontier: long - /Audio/Machines/scan_finish.ogg - /Audio/Machines/vending_jingle.ogg @@ -195,9 +195,9 @@ id: HarpyRevs files: - /Audio/Weapons/chainsawwield.ogg - - /Audio/Machines/blender.ogg - - /Audio/Machines/juicer.ogg - - /Audio/Machines/reclaimer_startup.ogg + # - /Audio/Machines/blender.ogg # Frontier: grating + # - /Audio/Machines/juicer.ogg # Frontier: grating + # - /Audio/Machines/reclaimer_startup.ogg # Frontier: grating - type: soundCollection id: HarpyClicks @@ -208,9 +208,9 @@ - /Audio/Items/pistol_cock.ogg - /Audio/Items/pistol_magin.ogg - /Audio/Items/pistol_magout.ogg - - /Audio/Items/rped.ogg - - /Audio/Machines/door_lock_off.ogg - - /Audio/Machines/door_lock_on.ogg + # - /Audio/Items/rped.ogg # Frontier: grating + # - /Audio/Machines/door_lock_off.ogg # Frontier: loud + # - /Audio/Machines/door_lock_on.ogg # Frontier: loud - /Audio/Machines/id_swipe.ogg - /Audio/Machines/machine_switch.ogg - /Audio/Machines/screwdriveropen.ogg @@ -219,10 +219,10 @@ id: HarpyChitter files: - /Audio/Voice/Moth/moth_chitter.ogg - - /Audio/Machines/circuitprinter.ogg - - /Audio/Machines/diagnoser_printing.ogg - - /Audio/Machines/uniformprinter.ogg - - /Audio/Machines/vaccinator_running.ogg + # - /Audio/Machines/circuitprinter.ogg # Frontier: long + # - /Audio/Machines/diagnoser_printing.ogg # Frontier: long + # - /Audio/Machines/uniformprinter.ogg # Frontier: long + # - /Audio/Machines/vaccinator_running.ogg # Frontier: loud, grating, long - type: soundCollection id: HarpySqueak @@ -267,4 +267,11 @@ - /Audio/Effects/Gasp/female_deathgasp_5.ogg - /Audio/Effects/Gasp/deathgasp_1.ogg - /Audio/Effects/Gasp/deathgasp_2.ogg - - /Audio/Effects/Gasp/moth_DeathGasp.ogg \ No newline at end of file + - /Audio/Effects/Gasp/moth_DeathGasp.ogg + +# Frontier +- type: soundCollection + id: HarpySquishes + files: + - /Audio/Voice/Slime/slime_squish.ogg +# End Frontier diff --git a/Resources/Prototypes/DeltaV/Voice/speech_emote_sounds.yml b/Resources/Prototypes/DeltaV/Voice/speech_emote_sounds.yml index 709e7db4fb2..fede51cb568 100644 --- a/Resources/Prototypes/DeltaV/Voice/speech_emote_sounds.yml +++ b/Resources/Prototypes/DeltaV/Voice/speech_emote_sounds.yml @@ -34,12 +34,18 @@ collection: HarpyPews Bang: collection: HarpyBangs + params: # Frontier + volume: -5 # Frontier Beep: collection: HarpyBeeps Rev: collection: HarpyRevs -# Click: -# collection: HarpyClicks + params: # Frontier + volume: -5 # Frontier + Click: + collection: HarpyClicks + Squish: # Frontier + collection: HarpySquishes # Frontier Chitter: collection: HarpyChitter Squeak: @@ -60,6 +66,8 @@ collection: VulpkaninHowls Honk: collection: HarpyHonks + params: # Frontier + volume: -5 # Frontier Weh: collection: Weh Belch: # Frontier diff --git a/Resources/Prototypes/DeltaV/Voice/speech_emotes.yml b/Resources/Prototypes/DeltaV/Voice/speech_emotes.yml index 513ccabe4b6..dc6e4fef6e2 100644 --- a/Resources/Prototypes/DeltaV/Voice/speech_emotes.yml +++ b/Resources/Prototypes/DeltaV/Voice/speech_emotes.yml @@ -13,11 +13,10 @@ - BorgChassis chatMessages: ["rings."] chatTriggers: - - ring. - - rings. - - rings! - - ringing. - - ringed. + - ring + - rings + - ringing + - ringed - type: emote id: Pew @@ -33,9 +32,10 @@ - BorgChassis chatMessages: ["pews."] chatTriggers: - - pew. - - pews. - - pew! + - pew + - pews + - pewing # Frontier: consistency, I suppose + - pewed # Frontier - type: emote id: Bang @@ -51,22 +51,10 @@ - BorgChassis chatMessages: ["bangs."] chatTriggers: - - bangs. - - bang. - - bang! - - banging. - - banged. - -#- type: emote -# id: Beep -# category: Vocal -# chatMessages: [beeps.] -# chatTriggers: -# - beeps. -# - beep. -# - beep! -# - beeping. -# - beeped. + - bang + - bangs + - banging + - banged - type: emote id: Rev @@ -82,23 +70,11 @@ - BorgChassis chatMessages: ["revs."] chatTriggers: - - revs. - - rev. - - rev! + - revs + - rev - revving - revved -#- type: emote -# id: Click -# category: Vocal -# chatMessages: [clicks.] -# chatTriggers: -# - clicks. -# - click. -# - click! -# - clicking. -# - clicked. - - type: emote id: Caw name: Caw diff --git a/Resources/Prototypes/Voice/speech_emotes.yml b/Resources/Prototypes/Voice/speech_emotes.yml index a249218d71c..7a9b6ea107c 100644 --- a/Resources/Prototypes/Voice/speech_emotes.yml +++ b/Resources/Prototypes/Voice/speech_emotes.yml @@ -57,6 +57,7 @@ - chortle - chortles - chortling + - chortled # Frontier - type: emote id: Honk @@ -91,6 +92,7 @@ - sigh - sighs - sighed + - sighing # Frontier - type: emote id: Whistle @@ -108,6 +110,7 @@ - whistle - whistles - whistleblowing + - whistled # Frontier - type: emote id: Crying @@ -128,6 +131,8 @@ - sob - sobs - sobbing + - sobbed # Frontier + - cried # Frontier - type: emote id: Squish @@ -146,6 +151,7 @@ - squish - squishing - squishes + - squished # Frontier - type: emote id: Chitter @@ -164,6 +170,7 @@ - chitter - chitters - chittered + - chittering # Frontier - type: emote id: Squeak @@ -182,6 +189,7 @@ - squeak - squeaks - squeaked + - squeaking # Frontier - type: emote id: Click @@ -199,6 +207,8 @@ chatTriggers: - click - clicks + - clicked # Frontier + - clicking # Frontier # hand emotes - type: emote @@ -257,6 +267,8 @@ chatTriggers: - salute - salutes + - saluted # Frontier + - saluting # Frontier - type: emote id: Gasp @@ -269,6 +281,7 @@ - gasp - gasps - gasped + - gasping # Frontier - type: emote id: DefaultDeathgasp @@ -384,6 +397,7 @@ - buzzes twice - buzzing twice - buzzed twice + - buzzedtwice # Frontier - type: emote id: Ping From df450015c3951f8630a3f0123a561097e1a3c954 Mon Sep 17 00:00:00 2001 From: FrontierATC Date: Tue, 10 Sep 2024 18:48:47 +0000 Subject: [PATCH 05/40] Automatic Changelog (#1978) --- Resources/Changelog/Changelog.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Resources/Changelog/Changelog.yml b/Resources/Changelog/Changelog.yml index 5f466475bc5..85df697a0f1 100644 --- a/Resources/Changelog/Changelog.yml +++ b/Resources/Changelog/Changelog.yml @@ -6818,3 +6818,9 @@ Entries: message: Turrets are properly consumed on deploying. id: 5255 time: '2024-09-10T18:47:13.0000000+00:00' +- author: whatston3 + changes: + - type: Tweak + message: Harpies' instrument sound can only be changed by themselves. + id: 5256 + time: '2024-09-10T18:48:12.0000000+00:00' From 3c58f56577ea53d3844eea9aefe1391cd0a7e4d3 Mon Sep 17 00:00:00 2001 From: FrontierATC Date: Tue, 10 Sep 2024 18:52:12 +0000 Subject: [PATCH 06/40] Automatic Changelog (#1984) --- Resources/Changelog/Changelog.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Resources/Changelog/Changelog.yml b/Resources/Changelog/Changelog.yml index 85df697a0f1..7223b1fcb9c 100644 --- a/Resources/Changelog/Changelog.yml +++ b/Resources/Changelog/Changelog.yml @@ -6824,3 +6824,13 @@ Entries: message: Harpies' instrument sound can only be changed by themselves. id: 5256 time: '2024-09-10T18:48:12.0000000+00:00' +- author: whatston3 + changes: + - type: Remove + message: >- + Loud, grating, long, and irrelevant harpy emote sounds were removed from + collections. + - type: Add + message: The \@clicks and \@squishes are now available for harpies. + id: 5257 + time: '2024-09-10T18:48:23.0000000+00:00' From ee3cea46ff1f9784864aaed26686e14546f0ad2c Mon Sep 17 00:00:00 2001 From: Dvir <39403717+dvir001@users.noreply.github.com> Date: Tue, 10 Sep 2024 22:49:11 +0300 Subject: [PATCH 07/40] Plant analyzer (#1961) * First Taken from: https://github.com/space-wizards/space-station-14/pull/23588/files * Fixing it to run but the UI still not working * Fixup * Update plant_analyzer.yml * Plant analyzer cleanup * seeds.ftl: "speso trees", upstream comment * units, floating point precision, speso seeds * Seed rewrites * Do not activate on empty trays, add lathe recipe * Fix plant analyzer lathe recipe --------- Co-authored-by: Whatstone --- .../UI/PlantAnalyzerBoundUserInterface.cs | 53 ++++ .../PlantAnalyzer/UI/PlantAnalyzerWindow.xaml | 50 ++++ .../UI/PlantAnalyzerWindow.xaml.cs | 218 +++++++++++++++ .../Components/PlantAnalyzerComponent.cs | 33 +++ .../_NF/Botany/Systems/PlantAnalyzerSystem.cs | 262 ++++++++++++++++++ .../PlantAnalyzerDoAfterEvent.cs | 9 + ...lantAnalyzerScannedSeedPlantInformation.cs | 96 +++++++ .../_NF/PlantAnalyzer/PlantAnalyzerUiKey.cs | 9 + .../_NF/botany/components/plantanalyzer.ftl | 53 ++++ Resources/Locale/en-US/_NF/seeds/seeds.ftl | 11 +- .../Entities/Structures/Machines/lathe.yml | 1 + .../Entities/Structures/Machines/lathe.yml | 1 + .../Prototypes/Research/civilianservices.yml | 1 + .../Objects/Devices/plant_analyzer.yml | 65 +++++ .../Objects/Specific/Hydroponics/seeds.yml | 6 +- .../Prototypes/_NF/Recipes/Lathes/botany.yml | 9 + .../Prototypes/_NF/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, 919 insertions(+), 7 deletions(-) create mode 100644 Content.Client/_NF/PlantAnalyzer/UI/PlantAnalyzerBoundUserInterface.cs create mode 100644 Content.Client/_NF/PlantAnalyzer/UI/PlantAnalyzerWindow.xaml create mode 100644 Content.Client/_NF/PlantAnalyzer/UI/PlantAnalyzerWindow.xaml.cs create mode 100644 Content.Server/_NF/Botany/Components/PlantAnalyzerComponent.cs create mode 100644 Content.Server/_NF/Botany/Systems/PlantAnalyzerSystem.cs create mode 100644 Content.Shared/_NF/PlantAnalyzer/PlantAnalyzerDoAfterEvent.cs create mode 100644 Content.Shared/_NF/PlantAnalyzer/PlantAnalyzerScannedSeedPlantInformation.cs create mode 100644 Content.Shared/_NF/PlantAnalyzer/PlantAnalyzerUiKey.cs create mode 100644 Resources/Locale/en-US/_NF/botany/components/plantanalyzer.ftl create mode 100644 Resources/Prototypes/_NF/Entities/Objects/Devices/plant_analyzer.yml create mode 100644 Resources/Prototypes/_NF/Recipes/Lathes/botany.yml create mode 100644 Resources/Textures/_NF/Objects/Devices/plant_analyzer.rsi/icon.png create mode 100644 Resources/Textures/_NF/Objects/Devices/plant_analyzer.rsi/meta.json create mode 100644 Resources/Textures/_NF/Objects/Devices/plant_analyzer.rsi/plantanalyzer.png create mode 100644 Resources/Textures/_NF/Objects/Devices/plant_analyzer.rsi/unlit.png diff --git a/Content.Client/_NF/PlantAnalyzer/UI/PlantAnalyzerBoundUserInterface.cs b/Content.Client/_NF/PlantAnalyzer/UI/PlantAnalyzerBoundUserInterface.cs new file mode 100644 index 00000000000..70a02af09eb --- /dev/null +++ b/Content.Client/_NF/PlantAnalyzer/UI/PlantAnalyzerBoundUserInterface.cs @@ -0,0 +1,53 @@ +using Content.Shared._NF.PlantAnalyzer; +using JetBrains.Annotations; + +namespace Content.Client._NF.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(); + } +} diff --git a/Content.Client/_NF/PlantAnalyzer/UI/PlantAnalyzerWindow.xaml b/Content.Client/_NF/PlantAnalyzer/UI/PlantAnalyzerWindow.xaml new file mode 100644 index 00000000000..48c929ed2a1 --- /dev/null +++ b/Content.Client/_NF/PlantAnalyzer/UI/PlantAnalyzerWindow.xaml @@ -0,0 +1,50 @@ + + + + +