diff --git a/Content.Client/Anomaly/Effects/ClientInnerBodySystem.cs b/Content.Client/Anomaly/Effects/ClientInnerBodySystem.cs index 8d7292d468b..15ebc8a993d 100644 --- a/Content.Client/Anomaly/Effects/ClientInnerBodySystem.cs +++ b/Content.Client/Anomaly/Effects/ClientInnerBodySystem.cs @@ -45,7 +45,7 @@ private void OnCompShutdown(Entity ent, ref Component if (!TryComp(ent, out var sprite)) return; - if (sprite.LayerMapTryGet(ent.Comp.LayerMap, out var index)) // imp. added this check to prevent errors on anomalites - not having it was bad code on upstream's part - sprite.LayerSetVisible(index, false); + var index = _sprite.LayerMapGet((ent.Owner, sprite), ent.Comp.LayerMap); + _sprite.LayerSetVisible((ent.Owner, sprite), index, false); } } diff --git a/Content.Client/Atmos/EntitySystems/GasPressureRegulatorSystem.cs b/Content.Client/Atmos/EntitySystems/GasPressureRegulatorSystem.cs deleted file mode 100644 index 6f12297ff02..00000000000 --- a/Content.Client/Atmos/EntitySystems/GasPressureRegulatorSystem.cs +++ /dev/null @@ -1,31 +0,0 @@ -using Content.Shared.Atmos.EntitySystems; -using Content.Shared.Atmos.Piping.Binary.Components; - -namespace Content.Client.Atmos.EntitySystems; - -/// -/// Represents the client system responsible for managing and updating the gas pressure regulator interface. -/// Inherits from the shared system . -/// -public sealed partial class GasPressureRegulatorSystem : SharedGasPressureRegulatorSystem -{ - public override void Initialize() - { - base.Initialize(); - - SubscribeLocalEvent(OnValveUpdate); - } - - private void OnValveUpdate(Entity ent, ref AfterAutoHandleStateEvent args) - { - UpdateUi(ent); - } - - protected override void UpdateUi(Entity ent) - { - if (UserInterfaceSystem.TryGetOpenUi(ent.Owner, GasPressureRegulatorUiKey.Key, out var bui)) - { - bui.Update(); - } - } -} diff --git a/Content.Client/Atmos/UI/GasPressureRegulatorBoundUserInterface.cs b/Content.Client/Atmos/UI/GasPressureRegulatorBoundUserInterface.cs deleted file mode 100644 index 9d66a9985f9..00000000000 --- a/Content.Client/Atmos/UI/GasPressureRegulatorBoundUserInterface.cs +++ /dev/null @@ -1,58 +0,0 @@ -using Content.Shared.Atmos.Piping.Binary.Components; -using Content.Shared.IdentityManagement; -using Content.Shared.Localizations; -using Robust.Client.UserInterface; - -namespace Content.Client.Atmos.UI; - -public sealed class GasPressureRegulatorBoundUserInterface(EntityUid owner, Enum uiKey) - : BoundUserInterface(owner, uiKey) -{ - private GasPressureRegulatorWindow? _window; - - protected override void Open() - { - base.Open(); - - _window = this.CreateWindow(); - - _window.SetEntity(Owner); - - _window.ThresholdPressureChanged += OnThresholdChanged; - - if (EntMan.TryGetComponent(Owner, out GasPressureRegulatorComponent? comp)) - _window.SetThresholdPressureInput(comp.Threshold); - - Update(); - } - - public override void Update() - { - if (_window == null) - return; - - _window.Title = Identity.Name(Owner, EntMan); - - if (!EntMan.TryGetComponent(Owner, out GasPressureRegulatorComponent? comp)) - return; - - _window.SetThresholdPressureLabel(comp.Threshold); - _window.UpdateInfo(comp.InletPressure, comp.OutletPressure, comp.FlowRate); - } - - private void OnThresholdChanged(string newThreshold) - { - var sentThreshold = 0f; - - if (UserInputParser.TryFloat(newThreshold, out var parsedNewThreshold) && parsedNewThreshold >= 0 && - !float.IsInfinity(parsedNewThreshold)) - { - sentThreshold = parsedNewThreshold; - } - - // Autofill to zero if the user inputs an invalid value. - _window?.SetThresholdPressureInput(sentThreshold); - - SendPredictedMessage(new GasPressureRegulatorChangeThresholdMessage(sentThreshold)); - } -} diff --git a/Content.Client/Atmos/UI/GasPressureRegulatorWindow.xaml b/Content.Client/Atmos/UI/GasPressureRegulatorWindow.xaml deleted file mode 100644 index b6a55f769e5..00000000000 --- a/Content.Client/Atmos/UI/GasPressureRegulatorWindow.xaml +++ /dev/null @@ -1,96 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -