From: Perry Fraser Date: Sat, 21 Jun 2025 09:06:49 +0000 (-0400) Subject: Make gas tank UI a bit more network-happy (#38184) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=a0544fdbf202fbbe8193edd63ef9c4e2043f086c;p=space-station-14.git Make gas tank UI a bit more network-happy (#38184) * fix: network gas tank output pressure * fix: don't overwrite gas tank output pressure during editing --- diff --git a/Content.Client/UserInterface/Systems/Atmos/GasTank/GasTankWindow.cs b/Content.Client/UserInterface/Systems/Atmos/GasTank/GasTankWindow.cs index 638df36504..2b06eb7f8d 100644 --- a/Content.Client/UserInterface/Systems/Atmos/GasTank/GasTankWindow.cs +++ b/Content.Client/UserInterface/Systems/Atmos/GasTank/GasTankWindow.cs @@ -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) diff --git a/Content.Shared/Atmos/Components/GasTankComponent.cs b/Content.Shared/Atmos/Components/GasTankComponent.cs index 805874af33..7ca6098555 100644 --- a/Content.Shared/Atmos/Components/GasTankComponent.cs +++ b/Content.Shared/Atmos/Components/GasTankComponent.cs @@ -44,7 +44,7 @@ public sealed partial class GasTankComponent : Component, IGasMixtureHolder /// /// Distributed pressure. /// - [DataField] + [DataField, AutoNetworkedField] public float OutputPressure = DefaultOutputPressure; /// diff --git a/Content.Shared/Atmos/EntitySystems/SharedGasTankSystem.cs b/Content.Shared/Atmos/EntitySystems/SharedGasTankSystem.cs index 27c3d16f29..8c7ebe8332 100644 --- a/Content.Shared/Atmos/EntitySystems/SharedGasTankSystem.cs +++ b/Content.Shared/Atmos/EntitySystems/SharedGasTankSystem.cs @@ -52,6 +52,7 @@ public abstract class SharedGasTankSystem : EntitySystem ent.Comp.OutputPressure = pressure; Dirty(ent); + UpdateUserInterface(ent); } public virtual void UpdateUserInterface(Entity ent)