diff --git a/Content.Server/Atmos/Piping/Binary/EntitySystems/GasPressurePumpSystem.cs b/Content.Server/Atmos/Piping/Binary/EntitySystems/GasPressurePumpSystem.cs index 41a0e8e47c..89baa911d1 100644 --- a/Content.Server/Atmos/Piping/Binary/EntitySystems/GasPressurePumpSystem.cs +++ b/Content.Server/Atmos/Piping/Binary/EntitySystems/GasPressurePumpSystem.cs @@ -4,9 +4,11 @@ using Content.Server.NodeContainer; using Content.Server.NodeContainer.Nodes; using Content.Shared.Atmos; using Content.Shared.Atmos.Piping; +using Content.Shared.Examine; using JetBrains.Annotations; using Robust.Server.GameObjects; using Robust.Shared.GameObjects; +using Robust.Shared.Localization; using Robust.Shared.Maths; namespace Content.Server.Atmos.Piping.Binary.EntitySystems @@ -20,6 +22,19 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems SubscribeLocalEvent(OnPumpUpdated); SubscribeLocalEvent(OnPumpLeaveAtmosphere); + SubscribeLocalEvent(OnExamined); + } + + private void OnExamined(EntityUid uid, GasPressurePumpComponent pump, ExaminedEvent args) + { + if (!pump.Owner.Transform.Anchored || !args.IsInDetailsRange) // Not anchored? Out of range? No status. + return; + + if (Loc.TryGetString("gas-pressure-pump-system-examined", out var str, + ("statusColor", "lightblue"), // TODO: change with pressure? + ("pressure", pump.TargetPressure) + )) + args.PushMarkup(str); } private void OnPumpUpdated(EntityUid uid, GasPressurePumpComponent pump, AtmosDeviceUpdateEvent args) diff --git a/Content.Server/Atmos/Piping/Binary/EntitySystems/GasValveSystem.cs b/Content.Server/Atmos/Piping/Binary/EntitySystems/GasValveSystem.cs index 9f6b6a9912..84745a6a6f 100644 --- a/Content.Server/Atmos/Piping/Binary/EntitySystems/GasValveSystem.cs +++ b/Content.Server/Atmos/Piping/Binary/EntitySystems/GasValveSystem.cs @@ -3,11 +3,13 @@ using Content.Server.NodeContainer; using Content.Server.NodeContainer.Nodes; using Content.Shared.ActionBlocker; using Content.Shared.Atmos.Piping; +using Content.Shared.Examine; using Content.Shared.Interaction; using Content.Shared.Interaction.Helpers; using JetBrains.Annotations; using Robust.Server.GameObjects; using Robust.Shared.GameObjects; +using Robust.Shared.Localization; namespace Content.Server.Atmos.Piping.Binary.EntitySystems { @@ -20,6 +22,19 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems SubscribeLocalEvent(OnStartup); SubscribeLocalEvent(OnActivate); + SubscribeLocalEvent(OnExamined); + } + + private void OnExamined(EntityUid uid, GasValveComponent valve, ExaminedEvent args) + { + if (!valve.Owner.Transform.Anchored || !args.IsInDetailsRange) // Not anchored? Out of range? No status. + return; + + if (Loc.TryGetString("gas-valve-system-examined", out var str, + ("statusColor", valve.Open ? "green" : "orange"), + ("open", valve.Open) + )) + args.PushMarkup(str); } private void OnStartup(EntityUid uid, GasValveComponent component, ComponentStartup args) diff --git a/Content.Server/Atmos/Piping/Binary/EntitySystems/GasVolumePumpSystem.cs b/Content.Server/Atmos/Piping/Binary/EntitySystems/GasVolumePumpSystem.cs index d431e9c962..75b4d9162f 100644 --- a/Content.Server/Atmos/Piping/Binary/EntitySystems/GasVolumePumpSystem.cs +++ b/Content.Server/Atmos/Piping/Binary/EntitySystems/GasVolumePumpSystem.cs @@ -3,9 +3,11 @@ using Content.Server.Atmos.Piping.Binary.Components; using Content.Server.Atmos.Piping.Components; using Content.Server.NodeContainer; using Content.Server.NodeContainer.Nodes; +using Content.Shared.Examine; using JetBrains.Annotations; using Robust.Shared.GameObjects; using Robust.Shared.IoC; +using Robust.Shared.Localization; using Robust.Shared.Timing; namespace Content.Server.Atmos.Piping.Binary.EntitySystems @@ -21,6 +23,19 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems base.Initialize(); SubscribeLocalEvent(OnVolumePumpUpdated); + SubscribeLocalEvent(OnExamined); + } + + private void OnExamined(EntityUid uid, GasVolumePumpComponent pump, ExaminedEvent args) + { + if (!pump.Owner.Transform.Anchored || !args.IsInDetailsRange) // Not anchored? Out of range? No status. + return; + + if (Loc.TryGetString("gas-volume-pump-system-examined", out var str, + ("statusColor", "lightblue"), // TODO: change with volume? + ("rate", pump.TransferRate) + )) + args.PushMarkup(str); } private void OnVolumePumpUpdated(EntityUid uid, GasVolumePumpComponent pump, AtmosDeviceUpdateEvent args) diff --git a/Resources/Locale/en-US/atmos/gas-pressure-pump-system.ftl b/Resources/Locale/en-US/atmos/gas-pressure-pump-system.ftl new file mode 100644 index 0000000000..a408e00d81 --- /dev/null +++ b/Resources/Locale/en-US/atmos/gas-pressure-pump-system.ftl @@ -0,0 +1,2 @@ +# Examine Text +gas-pressure-pump-system-examined = The pump is set to [color={$statusColor}]{PRESSURE($pressure)}[/color]. diff --git a/Resources/Locale/en-US/atmos/gas-valve-system.ftl b/Resources/Locale/en-US/atmos/gas-valve-system.ftl new file mode 100644 index 0000000000..824e3414b7 --- /dev/null +++ b/Resources/Locale/en-US/atmos/gas-valve-system.ftl @@ -0,0 +1,5 @@ +# Examine Text +gas-valve-system-examined = The valve is [color={$statusColor}]{$open -> + [true] open + *[false] closed +}[/color]. diff --git a/Resources/Locale/en-US/atmos/gas-volume-pump-system.ftl b/Resources/Locale/en-US/atmos/gas-volume-pump-system.ftl new file mode 100644 index 0000000000..4a2179ad82 --- /dev/null +++ b/Resources/Locale/en-US/atmos/gas-volume-pump-system.ftl @@ -0,0 +1,2 @@ +# Examine Text +gas-volume-pump-system-examined = The pump is set to [color={$statusColor}]{$rate} liters/sec[/color].