]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Injector UI shows TransferAmount change, Spilling liquid changes Injector mode (...
authorPlykiya <58439124+Plykiya@users.noreply.github.com>
Sun, 31 Mar 2024 05:37:33 +0000 (22:37 -0700)
committerGitHub <noreply@github.com>
Sun, 31 Mar 2024 05:37:33 +0000 (16:37 +1100)
* 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 <plykiya@protonmail.com>
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Content.Client/Chemistry/UI/InjectorStatusControl.cs
Content.Shared/Fluids/SharedPuddleSystem.Spillable.cs

index 9cb699330c233155248de7bbe9f539f078c9263f..ba1f97cd1e43d376c0faf00c740f7577d9e8d701 100644 (file)
@@ -17,6 +17,7 @@ public sealed class InjectorStatusControl : Control
 
     private FixedPoint2 PrevVolume;
     private FixedPoint2 PrevMaxVolume;
+    private FixedPoint2 PrevTransferAmount;
     private InjectorToggleMode PrevToggleState;
 
     public InjectorStatusControl(Entity<InjectorComponent> 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
index 1e9e742a38fada7699b8d2ceaa5853b3913a9fe1..92ea96214013015708b7f2ef25ebefe54db48c9d 100644 (file)
@@ -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<InjectorComponent>(entity, out var injectorComp))
+                {
+                    injectorComp.ToggleState = InjectorToggleMode.Draw;
+                    Dirty(entity, injectorComp);
+                }
             };
         }
         else