]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Make gas tank UI a bit more network-happy (#38184)
authorPerry Fraser <perryprog@users.noreply.github.com>
Sat, 21 Jun 2025 09:06:49 +0000 (05:06 -0400)
committerGitHub <noreply@github.com>
Sat, 21 Jun 2025 09:06:49 +0000 (11:06 +0200)
* fix: network gas tank output pressure

* fix: don't overwrite gas tank output pressure during editing

Content.Client/UserInterface/Systems/Atmos/GasTank/GasTankWindow.cs
Content.Shared/Atmos/Components/GasTankComponent.cs
Content.Shared/Atmos/EntitySystems/SharedGasTankSystem.cs

index 638df36504ce6b4a7778c84b72cbcf570e7b4f6d..2b06eb7f8dc086c621ea6d58321cf8964e8d81d9 100644 (file)
@@ -207,7 +207,9 @@ public sealed class GasTankWindow
         _btnInternals.Disabled = !canConnectInternals;
         _lblInternals.SetMarkup(Loc.GetString("gas-tank-window-internal-text",
             ("status", Loc.GetString(internalsConnected ? "gas-tank-window-internal-connected" : "gas-tank-window-internal-disconnected"))));
-        _spbPressure.Value = outputPressure;
+        if (!_spbPressure.HasKeyboardFocus())
+            // Don't update release pressure if we're currently editing it
+            _spbPressure.Value = outputPressure;
     }
 
     protected override void FrameUpdate(FrameEventArgs args)
index 805874af337fa6e2546b2c16fb32d5957a14ace1..7ca6098555794a2f9d9796e26abb9ab0d2034bfb 100644 (file)
@@ -44,7 +44,7 @@ public sealed partial class GasTankComponent : Component, IGasMixtureHolder
     /// <summary>
     ///     Distributed pressure.
     /// </summary>
-    [DataField]
+    [DataField, AutoNetworkedField]
     public float OutputPressure = DefaultOutputPressure;
 
     /// <summary>
index 27c3d16f29050b0cb213912b4a1919d803b28d0f..8c7ebe833228a2745917c86e03d4f1bbe8d900ab 100644 (file)
@@ -52,6 +52,7 @@ public abstract class SharedGasTankSystem : EntitySystem
 
         ent.Comp.OutputPressure = pressure;
         Dirty(ent);
+        UpdateUserInterface(ent);
     }
 
     public virtual void UpdateUserInterface(Entity<GasTankComponent> ent)