From d71062a64c569d59bc67c950a34454eef7ccaa14 Mon Sep 17 00:00:00 2001 From: Plykiya <58439124+Plykiya@users.noreply.github.com> Date: Sat, 30 Mar 2024 22:37:33 -0700 Subject: [PATCH] Injector UI shows TransferAmount change, Spilling liquid changes Injector mode (#26596) * Injector UI shows TransferAmount change, spill changes mode * Update Content.Shared/Fluids/SharedPuddleSystem.Spillable.cs * Update Content.Shared/Fluids/SharedPuddleSystem.Spillable.cs --------- Co-authored-by: Plykiya Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> --- Content.Client/Chemistry/UI/InjectorStatusControl.cs | 3 +++ Content.Shared/Fluids/SharedPuddleSystem.Spillable.cs | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/Content.Client/Chemistry/UI/InjectorStatusControl.cs b/Content.Client/Chemistry/UI/InjectorStatusControl.cs index 9cb699330c..ba1f97cd1e 100644 --- a/Content.Client/Chemistry/UI/InjectorStatusControl.cs +++ b/Content.Client/Chemistry/UI/InjectorStatusControl.cs @@ -17,6 +17,7 @@ public sealed class InjectorStatusControl : Control private FixedPoint2 PrevVolume; private FixedPoint2 PrevMaxVolume; + private FixedPoint2 PrevTransferAmount; private InjectorToggleMode PrevToggleState; public InjectorStatusControl(Entity parent, SharedSolutionContainerSystem solutionContainers) @@ -37,11 +38,13 @@ public sealed class InjectorStatusControl : Control // only updates the UI if any of the details are different than they previously were if (PrevVolume == solution.Volume && PrevMaxVolume == solution.MaxVolume + && PrevTransferAmount == _parent.Comp.TransferAmount && PrevToggleState == _parent.Comp.ToggleState) return; PrevVolume = solution.Volume; PrevMaxVolume = solution.MaxVolume; + PrevTransferAmount = _parent.Comp.TransferAmount; PrevToggleState = _parent.Comp.ToggleState; // Update current volume and injector state diff --git a/Content.Shared/Fluids/SharedPuddleSystem.Spillable.cs b/Content.Shared/Fluids/SharedPuddleSystem.Spillable.cs index 1e9e742a38..92ea962140 100644 --- a/Content.Shared/Fluids/SharedPuddleSystem.Spillable.cs +++ b/Content.Shared/Fluids/SharedPuddleSystem.Spillable.cs @@ -1,3 +1,4 @@ +using Content.Shared.Chemistry.Components; using Content.Shared.Database; using Content.Shared.DoAfter; using Content.Shared.Examine; @@ -62,6 +63,12 @@ public abstract partial class SharedPuddleSystem { var puddleSolution = _solutionContainerSystem.SplitSolution(soln.Value, solution.Volume); TrySpillAt(Transform(target).Coordinates, puddleSolution, out _); + + if (TryComp(entity, out var injectorComp)) + { + injectorComp.ToggleState = InjectorToggleMode.Draw; + Dirty(entity, injectorComp); + } }; } else -- 2.51.2