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
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -44,7 +44,7 @@ public sealed partial class GasTankComponent : Component, IGasMixtureHolder
|
||||
/// <summary>
|
||||
/// Distributed pressure.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
[DataField, AutoNetworkedField]
|
||||
public float OutputPressure = DefaultOutputPressure;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -52,6 +52,7 @@ public abstract class SharedGasTankSystem : EntitySystem
|
||||
|
||||
ent.Comp.OutputPressure = pressure;
|
||||
Dirty(ent);
|
||||
UpdateUserInterface(ent);
|
||||
}
|
||||
|
||||
public virtual void UpdateUserInterface(Entity<GasTankComponent> ent)
|
||||
|
||||
Reference in New Issue
Block a user