From 2a84fb820a6379aa08a7c79cad575ea14b05cc2c Mon Sep 17 00:00:00 2001 From: chromiumboy Date: Sat, 2 Nov 2024 22:28:58 -0500 Subject: [PATCH 1/7] Initial commit --- .../Components/AtmosMonitorComponent.cs | 14 ++- .../Monitor/Systems/AtmosMonitoringSystem.cs | 29 ++++- .../Components/GasPipeSensorComponent.cs | 6 + .../Specific/Atmospherics/gas_pipe_sensor.yml | 117 ++++++++++++++++++ .../Graphs/utilities/gas_pipe_sensor.yml | 100 +++++++++++++++ .../Recipes/Construction/utilities.yml | 15 +++ .../Atmospherics/gas_pipe_sensor.rsi/base.png | Bin 0 -> 248 bytes .../gas_pipe_sensor.rsi/blank.png | Bin 0 -> 83 bytes .../gas_pipe_sensor.rsi/cavity.png | Bin 0 -> 120 bytes .../Atmospherics/gas_pipe_sensor.rsi/icon.png | Bin 0 -> 523 bytes .../gas_pipe_sensor.rsi/lights.png | Bin 0 -> 183 bytes .../gas_pipe_sensor.rsi/meta.json | 38 ++++++ .../gas_pipe_sensor.rsi/wires.png | Bin 0 -> 166 bytes .../gas_pipe_sensor.rsi/wires_connected.png | Bin 0 -> 160 bytes 14 files changed, 317 insertions(+), 2 deletions(-) create mode 100644 Content.Shared/Atmos/Components/GasPipeSensorComponent.cs create mode 100644 Resources/Prototypes/Entities/Structures/Specific/Atmospherics/gas_pipe_sensor.yml create mode 100644 Resources/Prototypes/Recipes/Construction/Graphs/utilities/gas_pipe_sensor.yml create mode 100644 Resources/Textures/Structures/Specific/Atmospherics/gas_pipe_sensor.rsi/base.png create mode 100644 Resources/Textures/Structures/Specific/Atmospherics/gas_pipe_sensor.rsi/blank.png create mode 100644 Resources/Textures/Structures/Specific/Atmospherics/gas_pipe_sensor.rsi/cavity.png create mode 100644 Resources/Textures/Structures/Specific/Atmospherics/gas_pipe_sensor.rsi/icon.png create mode 100644 Resources/Textures/Structures/Specific/Atmospherics/gas_pipe_sensor.rsi/lights.png create mode 100644 Resources/Textures/Structures/Specific/Atmospherics/gas_pipe_sensor.rsi/meta.json create mode 100644 Resources/Textures/Structures/Specific/Atmospherics/gas_pipe_sensor.rsi/wires.png create mode 100644 Resources/Textures/Structures/Specific/Atmospherics/gas_pipe_sensor.rsi/wires_connected.png diff --git a/Content.Server/Atmos/Monitor/Components/AtmosMonitorComponent.cs b/Content.Server/Atmos/Monitor/Components/AtmosMonitorComponent.cs index cb6d4d1630162b..e771a0a0193ec6 100644 --- a/Content.Server/Atmos/Monitor/Components/AtmosMonitorComponent.cs +++ b/Content.Server/Atmos/Monitor/Components/AtmosMonitorComponent.cs @@ -48,7 +48,9 @@ public sealed partial class AtmosMonitorComponent : Component [DataField("gasThresholds")] public Dictionary? GasThresholds; - // Stores a reference to the gas on the tile this is on. + /// + /// Stores a reference to the gas on the tile this entity is on (or the pipe network it monitors; see ). + /// [ViewVariables] public GasMixture? TileGas; @@ -65,4 +67,14 @@ public sealed partial class AtmosMonitorComponent : Component /// [DataField("registeredDevices")] public HashSet RegisteredDevices = new(); + + /// + /// Specifies whether this device monitors its own internal pipe network rather than the surrounding atmosphere. + /// + /// + /// If 'true', the entity will require a NodeContainerComponent with one or more PipeNodes to function. + /// Note that only the first PipeNode is monitored. + /// + [DataField] + public bool MonitorsPipeNet = false; } diff --git a/Content.Server/Atmos/Monitor/Systems/AtmosMonitoringSystem.cs b/Content.Server/Atmos/Monitor/Systems/AtmosMonitoringSystem.cs index fbe74cbab7f902..419a2c741d9153 100644 --- a/Content.Server/Atmos/Monitor/Systems/AtmosMonitoringSystem.cs +++ b/Content.Server/Atmos/Monitor/Systems/AtmosMonitoringSystem.cs @@ -4,6 +4,8 @@ using Content.Server.Atmos.Piping.EntitySystems; using Content.Server.DeviceNetwork; using Content.Server.DeviceNetwork.Systems; +using Content.Server.NodeContainer; +using Content.Server.NodeContainer.Nodes; using Content.Server.Power.Components; using Content.Server.Power.EntitySystems; using Content.Shared.Atmos; @@ -56,8 +58,15 @@ private void OnAtmosDeviceLeaveAtmosphere(EntityUid uid, AtmosMonitorComponent a private void OnAtmosDeviceEnterAtmosphere(EntityUid uid, AtmosMonitorComponent atmosMonitor, ref AtmosDeviceEnabledEvent args) { + if (atmosMonitor.MonitorsPipeNet) + { + atmosMonitor.TileGas = GetGasPipeAirMixture(uid); + return; + } + atmosMonitor.TileGas = _atmosphereSystem.GetContainingMixture(uid, true); } + private void OnMapInit(EntityUid uid, AtmosMonitorComponent component, MapInitEvent args) { if (component.TemperatureThresholdId != null) @@ -206,7 +215,7 @@ private void OnAtmosUpdate(EntityUid uid, AtmosMonitorComponent component, ref A if (!this.IsPowered(uid, EntityManager)) return; - if (args.Grid == null) + if (args.Grid == null) return; // if we're not monitoring atmos, don't bother @@ -215,9 +224,27 @@ private void OnAtmosUpdate(EntityUid uid, AtmosMonitorComponent component, ref A && component.GasThresholds == null) return; + // If monitoring a pipe network, get its most recent gas mixture + if (component.MonitorsPipeNet) + component.TileGas = GetGasPipeAirMixture(uid); + UpdateState(uid, component.TileGas, component); } + private GasMixture? GetGasPipeAirMixture(EntityUid uid) + { + if (!TryComp(uid, out var nodeContainer)) + return null; + + foreach (var node in nodeContainer.Nodes.Values) + { + if (node is PipeNode { } pipeNode) + return pipeNode.Air; + } + + return null; + } + // Update checks the current air if it exceeds thresholds of // any kind. // diff --git a/Content.Shared/Atmos/Components/GasPipeSensorComponent.cs b/Content.Shared/Atmos/Components/GasPipeSensorComponent.cs new file mode 100644 index 00000000000000..33d33cff18484e --- /dev/null +++ b/Content.Shared/Atmos/Components/GasPipeSensorComponent.cs @@ -0,0 +1,6 @@ +using Robust.Shared.GameStates; + +namespace Content.Shared.Atmos.Components; + +[RegisterComponent, NetworkedComponent] +public sealed partial class GasPipeSensorComponent : Component; diff --git a/Resources/Prototypes/Entities/Structures/Specific/Atmospherics/gas_pipe_sensor.yml b/Resources/Prototypes/Entities/Structures/Specific/Atmospherics/gas_pipe_sensor.yml new file mode 100644 index 00000000000000..2e6ce92eb45091 --- /dev/null +++ b/Resources/Prototypes/Entities/Structures/Specific/Atmospherics/gas_pipe_sensor.yml @@ -0,0 +1,117 @@ +- type: entity + parent: GasPipeBase + id: GasPipeSensorAssembly + name: gas pipe sensor assembly + description: When assembled, this device will report on the characteristics of the gas in the attached pipe network. + components: + - type: Sprite + sprite: Structures/Specific/Atmospherics/gas_pipe_sensor.rsi + drawdepth: BelowFloor + layers: + - sprite: Structures/Piping/Atmospherics/pipe.rsi + map: [ "enum.PipeVisualLayers.Pipe" ] + state: pipeStraight + - map: ["base"] + state: base + - map: [ "enum.ConstructionVisuals.Layer" ] + state: cavity + - type: Appearance + - type: GenericVisualizer + visuals: + enum.ConstructionVisuals.Key: + enum.ConstructionVisuals.Layer: + assembly: { state: cavity } + wiredAssembly: { state: wires } + - type: Construction + graph: GasPipeSensor + node: assembly + - type: NodeContainer + nodes: + pipe: + !type:PipeNode + nodeGroupID: Pipe + pipeDirection: Longitudinal + - type: Tag + tags: + - Unstackable + +- type: entity + parent: [AirSensorBase, GasPipeSensorAssembly] + id: GasPipeSensor + name: gas pipe sensor + description: Reports on the status of the gas in the attached pipe network. + placement: + mode: SnapgridCenter + components: + - type: Sprite + sprite: Structures/Specific/Atmospherics/gas_pipe_sensor.rsi + drawdepth: BelowFloor + layers: + - sprite: Structures/Piping/Atmospherics/pipe.rsi + map: [ "enum.PipeVisualLayers.Pipe" ] + state: pipeStraight + - map: ["base"] + state: base + - map: [ "enum.ConstructionVisuals.Layer" ] + state: blank + - map: [ "enum.PowerDeviceVisualLayers.Powered" ] + state: lights + - type: Appearance + - type: GenericVisualizer + visuals: + enum.ConstructionVisuals.Key: + enum.ConstructionVisuals.Layer: + wiredSensor: { state: wires_connected } + sensor: { state: blank } + enum.PowerDeviceVisuals.Powered: + enum.PowerDeviceVisualLayers.Powered: + False: { state: blank, shader: shaded } + True: { state: lights, shader: unshaded } + - type: GasPipeSensor + - type: AtmosMonitor + monitorsPipeNet: true + - type: ApcPowerReceiver + - type: ExtensionCableReceiver + - type: Construction + graph: GasPipeSensor + node: sensor + +- type: entity + parent: GasPipeSensor + id: GasPipeSensorDistribution + suffix: Distribution + components: + - type: Label + currentLabel: Distribution loop + +- type: entity + parent: GasPipeSensor + id: GasPipeSensorWaste + suffix: Waste + components: + - type: Label + currentLabel: Waste loop + +- type: entity + parent: GasPipeSensor + id: GasPipeSensorMixedAir + suffix: Mixed air + components: + - type: Label + currentLabel: Mixed air + +- type: entity + parent: GasPipeSensor + id: GasPipeSensorTEGHot + suffix: TEG hot + components: + - type: Label + currentLabel: TEG hot loop + +- type: entity + parent: GasPipeSensor + id: GasPipeSensorTEGCold + suffix: TEG cold + components: + - type: Label + currentLabel: TEG cold loop \ No newline at end of file diff --git a/Resources/Prototypes/Recipes/Construction/Graphs/utilities/gas_pipe_sensor.yml b/Resources/Prototypes/Recipes/Construction/Graphs/utilities/gas_pipe_sensor.yml new file mode 100644 index 00000000000000..09085fe37b535c --- /dev/null +++ b/Resources/Prototypes/Recipes/Construction/Graphs/utilities/gas_pipe_sensor.yml @@ -0,0 +1,100 @@ +- type: constructionGraph + id: GasPipeSensor + start: start + graph: + - node: start + edges: + - to: assembly + steps: + - material: Steel + amount: 2 + doAfter: 1 + + - node: assembly + entity: GasPipeSensorAssembly + actions: + - !type:AppearanceChange {} + edges: + - to: start + completed: + - !type:SpawnPrototype + prototype: SheetSteel1 + amount: 2 + - !type:DeleteEntity {} + conditions: + - !type:EntityAnchored + anchored: false + steps: + - tool: Screwing + doAfter: 2 + + - to: wiredAssembly + conditions: + - !type:EntityAnchored {} + steps: + - material: Cable + amount: 2 + doAfter: 1 + + - node: wiredAssembly + actions: + - !type:AppearanceChange {} + edges: + - to: assembly + completed: + - !type:GivePrototype + prototype: CableApcStack1 + amount: 2 + conditions: + - !type:EntityAnchored + anchored: false + steps: + - tool: Cutting + doAfter: 1 + + - to: sensor + completed: + - !type:SetAnchor + value: false + conditions: + - !type:EntityAnchored {} + steps: + - tool: Screwing + doAfter: 2 + + - node: wiredSensor + actions: + - !type:AppearanceChange {} + edges: + - to: assembly + completed: + - !type:GivePrototype + prototype: CableApcStack1 + amount: 2 + conditions: + - !type:EntityAnchored + anchored: false + steps: + - tool: Cutting + doAfter: 1 + + - to: sensor + conditions: + - !type:EntityAnchored {} + steps: + - tool: Screwing + doAfter: 2 + + - node: sensor + entity: GasPipeSensor + actions: + - !type:AppearanceChange {} + - !type:SetAnchor {} + edges: + - to: wiredSensor + conditions: + - !type:EntityAnchored + anchored: false + steps: + - tool: Screwing + doAfter: 2 \ No newline at end of file diff --git a/Resources/Prototypes/Recipes/Construction/utilities.yml b/Resources/Prototypes/Recipes/Construction/utilities.yml index 5dc0168fd36ca3..31625dc04483be 100644 --- a/Resources/Prototypes/Recipes/Construction/utilities.yml +++ b/Resources/Prototypes/Recipes/Construction/utilities.yml @@ -366,6 +366,21 @@ objectType: Structure canRotate: true +- type: construction + name: gas pipe sensor + id: GasPipeSensor + graph: GasPipeSensor + startNode: start + targetNode: sensor + category: construction-category-structures + description: Reports on the status of the gas within the attached pipe network. + icon: + sprite: Structures/Specific/Atmospherics/gas_pipe_sensor.rsi + state: icon + placementMode: SnapgridCenter + objectType: Structure + canRotate: true + # ATMOS PIPES - type: construction name: gas pipe half diff --git a/Resources/Textures/Structures/Specific/Atmospherics/gas_pipe_sensor.rsi/base.png b/Resources/Textures/Structures/Specific/Atmospherics/gas_pipe_sensor.rsi/base.png new file mode 100644 index 0000000000000000000000000000000000000000..4a9a8f6f2069490a67965a5fdf60019008341678 GIT binary patch literal 248 zcmVuMTL$ yH{Ahdj(Z-x$LRe>F*Ot^?|}CAhG7_n0RRt>*hN^}z=Wm%0000B?Wc})uc*XMaS cfSB*u1QZw;r+*K>4&*R+y85}Sb4q9e0KdKysQ>@~ literal 0 HcmV?d00001 diff --git a/Resources/Textures/Structures/Specific/Atmospherics/gas_pipe_sensor.rsi/cavity.png b/Resources/Textures/Structures/Specific/Atmospherics/gas_pipe_sensor.rsi/cavity.png new file mode 100644 index 0000000000000000000000000000000000000000..8ea62e617a8bb2914432e134e75b92d9ae70c149 GIT binary patch literal 120 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdzdrud~kch)?FDVKEC0qhG2-^sz zKX+l{TM#RK@KAkW`i+|n91ILE{IuQQ?R&4I^yPL#<~N>*nM>Cl6lP$!Wj#5ZgZ1qv R1{4QFfKyZoFJf(g^&|8Oe4&~^=#%085CT*bCFYwkP}FRIzbjfqyss? zpdlL<4S}TSs#$0PPK2?mwfilrdG-JGzrWvm;1E(u8%2=?h@!|!DJ_n%=bG5-^#E+U z-6l`?u8Bej`u#q6!vZQgw}nfl`X&pTC|7{h2V0V`LDZ zlqzNz$spiibPd46Kj-%^YJB=M{2Kjur9hr=BJh?1o4CKbd$$3d2t3Z`TLT^*9li1f zkO|zW4}@X3t@AXFnZ_|nDZ(&xD#3^Lfvm50Qs5~`yhf|V_tR5;4~LvxT+li=a01WO ziZ^4ql!c^TucNi5*=&}x4`{6sLSU^ehrmYm)oNAVMg+V$jte2M0nTecX9B+Ovs^Bz z)oSH>z!2ZKR*f5CV>W;7aki^U=rfxil~y+@Q(CfWc1 N002ovPDHLkV1lGg_D%o* literal 0 HcmV?d00001 diff --git a/Resources/Textures/Structures/Specific/Atmospherics/gas_pipe_sensor.rsi/lights.png b/Resources/Textures/Structures/Specific/Atmospherics/gas_pipe_sensor.rsi/lights.png new file mode 100644 index 0000000000000000000000000000000000000000..6108d2b99492134bbeeb0d5f7bfc64256627e5a9 GIT binary patch literal 183 zcmeAS@N?(olHy`uVBq!ia0vp^4nVBH!3HE3&8=$zQgxm#jv*QM-d^6w+n^xQ^6+xR zZ7W7;i<#UTnTvNc3g6hpAm-(ybA_$*L;YE9(VgWAj0~@?P7z9(SmoK=x6?D~tYLmB z>r}}@+Ozt(GlWeZ8tW>w%+r6KFP`wJcJ+mCKeqi<;XaYk>y-ao(j#%xIsa=vqu#UY d11$!EKR5Zp#g)Ie6~!okxSpB$vqs`nw;s Q1X|4C>FVdQ&MBb@0Fh@uBme*a literal 0 HcmV?d00001 diff --git a/Resources/Textures/Structures/Specific/Atmospherics/gas_pipe_sensor.rsi/wires_connected.png b/Resources/Textures/Structures/Specific/Atmospherics/gas_pipe_sensor.rsi/wires_connected.png new file mode 100644 index 0000000000000000000000000000000000000000..58f2dbfb5d065140c9d2b71e157d15e54642964c GIT binary patch literal 160 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=ffJbWaz@kch)?FYo3&V8Fw2A-GC3 zZ);EcC%=1#_m+D;WYp{BR9wpKd}6Pg!Ugt520=l=pVrZurz}6u&0c$R+uF(2+y|cc zZ9etn+}iZl#T6{?cieg%p=)z|L;9U{%sLFp9-F=PPVP979vki>{~+5}`ajT022WQ% Jmvv4FO#l&)J)!^r literal 0 HcmV?d00001 From bdeabe1d6b0acee43fc377540a7805fc0d4d4589 Mon Sep 17 00:00:00 2001 From: chromiumboy Date: Mon, 4 Nov 2024 12:58:30 -0600 Subject: [PATCH 2/7] Monitored pipe node is now referenced by name --- .../Monitor/Components/AtmosMonitorComponent.cs | 7 ++++++- .../Atmos/Monitor/Systems/AtmosMonitoringSystem.cs | 12 ++++++------ .../Specific/Atmospherics/gas_pipe_sensor.yml | 2 +- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/Content.Server/Atmos/Monitor/Components/AtmosMonitorComponent.cs b/Content.Server/Atmos/Monitor/Components/AtmosMonitorComponent.cs index e771a0a0193ec6..830479561dea0a 100644 --- a/Content.Server/Atmos/Monitor/Components/AtmosMonitorComponent.cs +++ b/Content.Server/Atmos/Monitor/Components/AtmosMonitorComponent.cs @@ -73,8 +73,13 @@ public sealed partial class AtmosMonitorComponent : Component /// /// /// If 'true', the entity will require a NodeContainerComponent with one or more PipeNodes to function. - /// Note that only the first PipeNode is monitored. /// [DataField] public bool MonitorsPipeNet = false; + + /// + /// Specifies the name of the pipe node that this device is monitoring. + /// + [DataField] + public string NodeNameMonitoredPipe = "monitored"; } diff --git a/Content.Server/Atmos/Monitor/Systems/AtmosMonitoringSystem.cs b/Content.Server/Atmos/Monitor/Systems/AtmosMonitoringSystem.cs index 419a2c741d9153..36311c6d6ae54e 100644 --- a/Content.Server/Atmos/Monitor/Systems/AtmosMonitoringSystem.cs +++ b/Content.Server/Atmos/Monitor/Systems/AtmosMonitoringSystem.cs @@ -60,7 +60,7 @@ private void OnAtmosDeviceEnterAtmosphere(EntityUid uid, AtmosMonitorComponent a { if (atmosMonitor.MonitorsPipeNet) { - atmosMonitor.TileGas = GetGasPipeAirMixture(uid); + atmosMonitor.TileGas = GetGasPipeAirMixture(uid, atmosMonitor); return; } @@ -226,20 +226,20 @@ private void OnAtmosUpdate(EntityUid uid, AtmosMonitorComponent component, ref A // If monitoring a pipe network, get its most recent gas mixture if (component.MonitorsPipeNet) - component.TileGas = GetGasPipeAirMixture(uid); + component.TileGas = GetGasPipeAirMixture(uid, component); UpdateState(uid, component.TileGas, component); } - private GasMixture? GetGasPipeAirMixture(EntityUid uid) + private GasMixture? GetGasPipeAirMixture(EntityUid uid, AtmosMonitorComponent component) { if (!TryComp(uid, out var nodeContainer)) return null; - foreach (var node in nodeContainer.Nodes.Values) + if (nodeContainer.Nodes.TryGetValue(component.NodeNameMonitoredPipe, out var node) && + node is PipeNode { } pipeNode) { - if (node is PipeNode { } pipeNode) - return pipeNode.Air; + return pipeNode.Air; } return null; diff --git a/Resources/Prototypes/Entities/Structures/Specific/Atmospherics/gas_pipe_sensor.yml b/Resources/Prototypes/Entities/Structures/Specific/Atmospherics/gas_pipe_sensor.yml index 2e6ce92eb45091..8362b6744d5ada 100644 --- a/Resources/Prototypes/Entities/Structures/Specific/Atmospherics/gas_pipe_sensor.yml +++ b/Resources/Prototypes/Entities/Structures/Specific/Atmospherics/gas_pipe_sensor.yml @@ -27,7 +27,7 @@ node: assembly - type: NodeContainer nodes: - pipe: + monitored: !type:PipeNode nodeGroupID: Pipe pipeDirection: Longitudinal From b1c02b30645a8623e5609c78a9a5158a99b83e14 Mon Sep 17 00:00:00 2001 From: chromiumboy Date: Sat, 9 Nov 2024 00:47:53 -0600 Subject: [PATCH 3/7] Review changes --- .../Monitor/Systems/AtmosMonitoringSystem.cs | 10 +- .../Components/GasPipeSensorComponent.cs | 6 - .../Locale/en-US/atmos/gas-pipe-sensor.ftl | 5 + .../Atmospherics/gas_pipe_sensor.yml | 24 +-- .../Graphs/utilities/gas_pipe_sensor.yml | 178 +++++++++--------- .../Recipes/Construction/utilities.yml | 2 +- .../Atmospherics/gas_pipe_sensor.rsi/base.png | Bin .../gas_pipe_sensor.rsi/blank.png | Bin .../gas_pipe_sensor.rsi/cavity.png | Bin .../Atmospherics/gas_pipe_sensor.rsi/icon.png | Bin .../gas_pipe_sensor.rsi/lights.png | Bin .../gas_pipe_sensor.rsi/meta.json | 4 +- .../gas_pipe_sensor.rsi/wires.png | Bin .../gas_pipe_sensor.rsi/wires_connected.png | Bin 14 files changed, 112 insertions(+), 117 deletions(-) delete mode 100644 Content.Shared/Atmos/Components/GasPipeSensorComponent.cs create mode 100644 Resources/Locale/en-US/atmos/gas-pipe-sensor.ftl rename Resources/Prototypes/Entities/Structures/{Specific => Piping}/Atmospherics/gas_pipe_sensor.yml (84%) rename Resources/Textures/Structures/{Specific => Piping}/Atmospherics/gas_pipe_sensor.rsi/base.png (100%) rename Resources/Textures/Structures/{Specific => Piping}/Atmospherics/gas_pipe_sensor.rsi/blank.png (100%) rename Resources/Textures/Structures/{Specific => Piping}/Atmospherics/gas_pipe_sensor.rsi/cavity.png (100%) rename Resources/Textures/Structures/{Specific => Piping}/Atmospherics/gas_pipe_sensor.rsi/icon.png (100%) rename Resources/Textures/Structures/{Specific => Piping}/Atmospherics/gas_pipe_sensor.rsi/lights.png (100%) rename Resources/Textures/Structures/{Specific => Piping}/Atmospherics/gas_pipe_sensor.rsi/meta.json (94%) rename Resources/Textures/Structures/{Specific => Piping}/Atmospherics/gas_pipe_sensor.rsi/wires.png (100%) rename Resources/Textures/Structures/{Specific => Piping}/Atmospherics/gas_pipe_sensor.rsi/wires_connected.png (100%) diff --git a/Content.Server/Atmos/Monitor/Systems/AtmosMonitoringSystem.cs b/Content.Server/Atmos/Monitor/Systems/AtmosMonitoringSystem.cs index 36311c6d6ae54e..b9cde9fa5d4ae5 100644 --- a/Content.Server/Atmos/Monitor/Systems/AtmosMonitoringSystem.cs +++ b/Content.Server/Atmos/Monitor/Systems/AtmosMonitoringSystem.cs @@ -5,6 +5,7 @@ using Content.Server.DeviceNetwork; using Content.Server.DeviceNetwork.Systems; using Content.Server.NodeContainer; +using Content.Server.NodeContainer.EntitySystems; using Content.Server.NodeContainer.Nodes; using Content.Server.Power.Components; using Content.Server.Power.EntitySystems; @@ -27,6 +28,7 @@ public sealed class AtmosMonitorSystem : EntitySystem [Dependency] private readonly AtmosDeviceSystem _atmosDeviceSystem = default!; [Dependency] private readonly DeviceNetworkSystem _deviceNetSystem = default!; [Dependency] private readonly IPrototypeManager _prototypeManager = default!; + [Dependency] private readonly NodeContainerSystem _nodeContainerSystem = default!; // Commands public const string AtmosMonitorSetThresholdCmd = "atmos_monitor_set_threshold"; @@ -233,14 +235,8 @@ private void OnAtmosUpdate(EntityUid uid, AtmosMonitorComponent component, ref A private GasMixture? GetGasPipeAirMixture(EntityUid uid, AtmosMonitorComponent component) { - if (!TryComp(uid, out var nodeContainer)) - return null; - - if (nodeContainer.Nodes.TryGetValue(component.NodeNameMonitoredPipe, out var node) && - node is PipeNode { } pipeNode) - { + if (_nodeContainerSystem.TryGetNode(uid, component.NodeNameMonitoredPipe, out var pipeNode)) return pipeNode.Air; - } return null; } diff --git a/Content.Shared/Atmos/Components/GasPipeSensorComponent.cs b/Content.Shared/Atmos/Components/GasPipeSensorComponent.cs deleted file mode 100644 index 33d33cff18484e..00000000000000 --- a/Content.Shared/Atmos/Components/GasPipeSensorComponent.cs +++ /dev/null @@ -1,6 +0,0 @@ -using Robust.Shared.GameStates; - -namespace Content.Shared.Atmos.Components; - -[RegisterComponent, NetworkedComponent] -public sealed partial class GasPipeSensorComponent : Component; diff --git a/Resources/Locale/en-US/atmos/gas-pipe-sensor.ftl b/Resources/Locale/en-US/atmos/gas-pipe-sensor.ftl new file mode 100644 index 00000000000000..8c3b8962e32780 --- /dev/null +++ b/Resources/Locale/en-US/atmos/gas-pipe-sensor.ftl @@ -0,0 +1,5 @@ +gas-pipe-sensor-distribution-loop = Distribution loop +gas-pipe-sensor-waste-loop = Waste loop +gas-pipe-sensor-mixed-air = Mixed air +gas-pipe-sensor-teg-hot-loop = TEG hot loop +gas-pipe-sensor-teg-cold-loop = TEG cold loop diff --git a/Resources/Prototypes/Entities/Structures/Specific/Atmospherics/gas_pipe_sensor.yml b/Resources/Prototypes/Entities/Structures/Piping/Atmospherics/gas_pipe_sensor.yml similarity index 84% rename from Resources/Prototypes/Entities/Structures/Specific/Atmospherics/gas_pipe_sensor.yml rename to Resources/Prototypes/Entities/Structures/Piping/Atmospherics/gas_pipe_sensor.yml index 8362b6744d5ada..755548aa461abf 100644 --- a/Resources/Prototypes/Entities/Structures/Specific/Atmospherics/gas_pipe_sensor.yml +++ b/Resources/Prototypes/Entities/Structures/Piping/Atmospherics/gas_pipe_sensor.yml @@ -5,7 +5,7 @@ description: When assembled, this device will report on the characteristics of the gas in the attached pipe network. components: - type: Sprite - sprite: Structures/Specific/Atmospherics/gas_pipe_sensor.rsi + sprite: Structures/Piping/Atmospherics/gas_pipe_sensor.rsi drawdepth: BelowFloor layers: - sprite: Structures/Piping/Atmospherics/pipe.rsi @@ -33,7 +33,7 @@ pipeDirection: Longitudinal - type: Tag tags: - - Unstackable + - Unstackable - type: entity parent: [AirSensorBase, GasPipeSensorAssembly] @@ -44,7 +44,7 @@ mode: SnapgridCenter components: - type: Sprite - sprite: Structures/Specific/Atmospherics/gas_pipe_sensor.rsi + sprite: Structures/Piping/Atmospherics/gas_pipe_sensor.rsi drawdepth: BelowFloor layers: - sprite: Structures/Piping/Atmospherics/pipe.rsi @@ -55,7 +55,8 @@ - map: [ "enum.ConstructionVisuals.Layer" ] state: blank - map: [ "enum.PowerDeviceVisualLayers.Powered" ] - state: lights + state: lights + shader: unshaded - type: Appearance - type: GenericVisualizer visuals: @@ -65,9 +66,8 @@ sensor: { state: blank } enum.PowerDeviceVisuals.Powered: enum.PowerDeviceVisualLayers.Powered: - False: { state: blank, shader: shaded } - True: { state: lights, shader: unshaded } - - type: GasPipeSensor + False: { state: blank } + True: { state: lights } - type: AtmosMonitor monitorsPipeNet: true - type: ApcPowerReceiver @@ -82,7 +82,7 @@ suffix: Distribution components: - type: Label - currentLabel: Distribution loop + currentLabel: gas-pipe-sensor-distribution-loop - type: entity parent: GasPipeSensor @@ -90,7 +90,7 @@ suffix: Waste components: - type: Label - currentLabel: Waste loop + currentLabel: gas-pipe-sensor-waste-loop - type: entity parent: GasPipeSensor @@ -98,7 +98,7 @@ suffix: Mixed air components: - type: Label - currentLabel: Mixed air + currentLabel: gas-pipe-sensor-mixed-air - type: entity parent: GasPipeSensor @@ -106,7 +106,7 @@ suffix: TEG hot components: - type: Label - currentLabel: TEG hot loop + currentLabel: gas-pipe-sensor-teg-hot-loop - type: entity parent: GasPipeSensor @@ -114,4 +114,4 @@ suffix: TEG cold components: - type: Label - currentLabel: TEG cold loop \ No newline at end of file + currentLabel: gas-pipe-sensor-teg-cold-loop \ No newline at end of file diff --git a/Resources/Prototypes/Recipes/Construction/Graphs/utilities/gas_pipe_sensor.yml b/Resources/Prototypes/Recipes/Construction/Graphs/utilities/gas_pipe_sensor.yml index 09085fe37b535c..049ab5ab37c770 100644 --- a/Resources/Prototypes/Recipes/Construction/Graphs/utilities/gas_pipe_sensor.yml +++ b/Resources/Prototypes/Recipes/Construction/Graphs/utilities/gas_pipe_sensor.yml @@ -2,99 +2,99 @@ id: GasPipeSensor start: start graph: - - node: start - edges: - - to: assembly - steps: - - material: Steel - amount: 2 - doAfter: 1 + - node: start + edges: + - to: assembly + steps: + - material: Steel + amount: 2 + doAfter: 1 - - node: assembly - entity: GasPipeSensorAssembly - actions: - - !type:AppearanceChange {} - edges: - - to: start - completed: - - !type:SpawnPrototype - prototype: SheetSteel1 - amount: 2 - - !type:DeleteEntity {} - conditions: - - !type:EntityAnchored - anchored: false - steps: - - tool: Screwing - doAfter: 2 + - node: assembly + entity: GasPipeSensorAssembly + actions: + - !type:AppearanceChange + edges: + - to: start + completed: + - !type:SpawnPrototype + prototype: SheetSteel1 + amount: 2 + - !type:DeleteEntity + conditions: + - !type:EntityAnchored + anchored: false + steps: + - tool: Screwing + doAfter: 2 - - to: wiredAssembly - conditions: - - !type:EntityAnchored {} - steps: - - material: Cable - amount: 2 - doAfter: 1 + - to: wiredAssembly + conditions: + - !type:EntityAnchored + steps: + - material: Cable + amount: 2 + doAfter: 1 - - node: wiredAssembly - actions: - - !type:AppearanceChange {} - edges: - - to: assembly - completed: - - !type:GivePrototype - prototype: CableApcStack1 - amount: 2 - conditions: - - !type:EntityAnchored - anchored: false - steps: - - tool: Cutting - doAfter: 1 + - node: wiredAssembly + actions: + - !type:AppearanceChange + edges: + - to: assembly + completed: + - !type:GivePrototype + prototype: CableApcStack1 + amount: 2 + conditions: + - !type:EntityAnchored + anchored: false + steps: + - tool: Cutting + doAfter: 1 - - to: sensor - completed: - - !type:SetAnchor - value: false - conditions: - - !type:EntityAnchored {} - steps: - - tool: Screwing - doAfter: 2 + - to: sensor + completed: + - !type:SetAnchor + value: false + conditions: + - !type:EntityAnchored + steps: + - tool: Screwing + doAfter: 2 - - node: wiredSensor - actions: - - !type:AppearanceChange {} - edges: - - to: assembly - completed: - - !type:GivePrototype - prototype: CableApcStack1 - amount: 2 - conditions: - - !type:EntityAnchored - anchored: false - steps: - - tool: Cutting - doAfter: 1 + - node: wiredSensor + actions: + - !type:AppearanceChange + edges: + - to: assembly + completed: + - !type:GivePrototype + prototype: CableApcStack1 + amount: 2 + conditions: + - !type:EntityAnchored + anchored: false + steps: + - tool: Cutting + doAfter: 1 - - to: sensor - conditions: - - !type:EntityAnchored {} - steps: - - tool: Screwing - doAfter: 2 + - to: sensor + conditions: + - !type:EntityAnchored + steps: + - tool: Screwing + doAfter: 2 - - node: sensor - entity: GasPipeSensor - actions: - - !type:AppearanceChange {} - - !type:SetAnchor {} - edges: - - to: wiredSensor - conditions: - - !type:EntityAnchored - anchored: false - steps: - - tool: Screwing - doAfter: 2 \ No newline at end of file + - node: sensor + entity: GasPipeSensor + actions: + - !type:AppearanceChange + - !type:SetAnchor + edges: + - to: wiredSensor + conditions: + - !type:EntityAnchored + anchored: false + steps: + - tool: Screwing + doAfter: 2 \ No newline at end of file diff --git a/Resources/Prototypes/Recipes/Construction/utilities.yml b/Resources/Prototypes/Recipes/Construction/utilities.yml index 31625dc04483be..2dec0e4a7d5ab7 100644 --- a/Resources/Prototypes/Recipes/Construction/utilities.yml +++ b/Resources/Prototypes/Recipes/Construction/utilities.yml @@ -375,7 +375,7 @@ category: construction-category-structures description: Reports on the status of the gas within the attached pipe network. icon: - sprite: Structures/Specific/Atmospherics/gas_pipe_sensor.rsi + sprite: Structures/Piping/Atmospherics/gas_pipe_sensor.rsi state: icon placementMode: SnapgridCenter objectType: Structure diff --git a/Resources/Textures/Structures/Specific/Atmospherics/gas_pipe_sensor.rsi/base.png b/Resources/Textures/Structures/Piping/Atmospherics/gas_pipe_sensor.rsi/base.png similarity index 100% rename from Resources/Textures/Structures/Specific/Atmospherics/gas_pipe_sensor.rsi/base.png rename to Resources/Textures/Structures/Piping/Atmospherics/gas_pipe_sensor.rsi/base.png diff --git a/Resources/Textures/Structures/Specific/Atmospherics/gas_pipe_sensor.rsi/blank.png b/Resources/Textures/Structures/Piping/Atmospherics/gas_pipe_sensor.rsi/blank.png similarity index 100% rename from Resources/Textures/Structures/Specific/Atmospherics/gas_pipe_sensor.rsi/blank.png rename to Resources/Textures/Structures/Piping/Atmospherics/gas_pipe_sensor.rsi/blank.png diff --git a/Resources/Textures/Structures/Specific/Atmospherics/gas_pipe_sensor.rsi/cavity.png b/Resources/Textures/Structures/Piping/Atmospherics/gas_pipe_sensor.rsi/cavity.png similarity index 100% rename from Resources/Textures/Structures/Specific/Atmospherics/gas_pipe_sensor.rsi/cavity.png rename to Resources/Textures/Structures/Piping/Atmospherics/gas_pipe_sensor.rsi/cavity.png diff --git a/Resources/Textures/Structures/Specific/Atmospherics/gas_pipe_sensor.rsi/icon.png b/Resources/Textures/Structures/Piping/Atmospherics/gas_pipe_sensor.rsi/icon.png similarity index 100% rename from Resources/Textures/Structures/Specific/Atmospherics/gas_pipe_sensor.rsi/icon.png rename to Resources/Textures/Structures/Piping/Atmospherics/gas_pipe_sensor.rsi/icon.png diff --git a/Resources/Textures/Structures/Specific/Atmospherics/gas_pipe_sensor.rsi/lights.png b/Resources/Textures/Structures/Piping/Atmospherics/gas_pipe_sensor.rsi/lights.png similarity index 100% rename from Resources/Textures/Structures/Specific/Atmospherics/gas_pipe_sensor.rsi/lights.png rename to Resources/Textures/Structures/Piping/Atmospherics/gas_pipe_sensor.rsi/lights.png diff --git a/Resources/Textures/Structures/Specific/Atmospherics/gas_pipe_sensor.rsi/meta.json b/Resources/Textures/Structures/Piping/Atmospherics/gas_pipe_sensor.rsi/meta.json similarity index 94% rename from Resources/Textures/Structures/Specific/Atmospherics/gas_pipe_sensor.rsi/meta.json rename to Resources/Textures/Structures/Piping/Atmospherics/gas_pipe_sensor.rsi/meta.json index b4470ed1f58004..7a7d75b8ccc67c 100644 --- a/Resources/Textures/Structures/Specific/Atmospherics/gas_pipe_sensor.rsi/meta.json +++ b/Resources/Textures/Structures/Piping/Atmospherics/gas_pipe_sensor.rsi/meta.json @@ -1,6 +1,6 @@ { "version": 1, - "license": "CC0-1.0", + "license": "CC-BY-SA-3.0", "copyright": "Created by chromiumboy (github) for SS14, based on the digital valve from /tg/", "size": { "x": 32, @@ -10,7 +10,7 @@ { "name": "icon" }, - { + { "name": "base" }, { diff --git a/Resources/Textures/Structures/Specific/Atmospherics/gas_pipe_sensor.rsi/wires.png b/Resources/Textures/Structures/Piping/Atmospherics/gas_pipe_sensor.rsi/wires.png similarity index 100% rename from Resources/Textures/Structures/Specific/Atmospherics/gas_pipe_sensor.rsi/wires.png rename to Resources/Textures/Structures/Piping/Atmospherics/gas_pipe_sensor.rsi/wires.png diff --git a/Resources/Textures/Structures/Specific/Atmospherics/gas_pipe_sensor.rsi/wires_connected.png b/Resources/Textures/Structures/Piping/Atmospherics/gas_pipe_sensor.rsi/wires_connected.png similarity index 100% rename from Resources/Textures/Structures/Specific/Atmospherics/gas_pipe_sensor.rsi/wires_connected.png rename to Resources/Textures/Structures/Piping/Atmospherics/gas_pipe_sensor.rsi/wires_connected.png From 92d89fcd761c8e1cf795ff735efbfd00b7c34e62 Mon Sep 17 00:00:00 2001 From: chromiumboy Date: Sat, 9 Nov 2024 21:53:57 -0600 Subject: [PATCH 4/7] Simplified construction --- .../Piping/Atmospherics/gas_pipe_sensor.yml | 57 +++---------- .../Graphs/utilities/gas_pipe_sensor.yml | 79 +----------------- .../gas_pipe_sensor.rsi/cavity.png | Bin 120 -> 0 bytes .../gas_pipe_sensor.rsi/meta.json | 11 +-- .../gas_pipe_sensor.rsi/wires.png | Bin 166 -> 0 bytes .../gas_pipe_sensor.rsi/wires_connected.png | Bin 160 -> 0 bytes 6 files changed, 17 insertions(+), 130 deletions(-) delete mode 100644 Resources/Textures/Structures/Piping/Atmospherics/gas_pipe_sensor.rsi/cavity.png delete mode 100644 Resources/Textures/Structures/Piping/Atmospherics/gas_pipe_sensor.rsi/wires.png delete mode 100644 Resources/Textures/Structures/Piping/Atmospherics/gas_pipe_sensor.rsi/wires_connected.png diff --git a/Resources/Prototypes/Entities/Structures/Piping/Atmospherics/gas_pipe_sensor.yml b/Resources/Prototypes/Entities/Structures/Piping/Atmospherics/gas_pipe_sensor.yml index 755548aa461abf..08015abe7d6595 100644 --- a/Resources/Prototypes/Entities/Structures/Piping/Atmospherics/gas_pipe_sensor.yml +++ b/Resources/Prototypes/Entities/Structures/Piping/Atmospherics/gas_pipe_sensor.yml @@ -1,42 +1,5 @@ - type: entity - parent: GasPipeBase - id: GasPipeSensorAssembly - name: gas pipe sensor assembly - description: When assembled, this device will report on the characteristics of the gas in the attached pipe network. - components: - - type: Sprite - sprite: Structures/Piping/Atmospherics/gas_pipe_sensor.rsi - drawdepth: BelowFloor - layers: - - sprite: Structures/Piping/Atmospherics/pipe.rsi - map: [ "enum.PipeVisualLayers.Pipe" ] - state: pipeStraight - - map: ["base"] - state: base - - map: [ "enum.ConstructionVisuals.Layer" ] - state: cavity - - type: Appearance - - type: GenericVisualizer - visuals: - enum.ConstructionVisuals.Key: - enum.ConstructionVisuals.Layer: - assembly: { state: cavity } - wiredAssembly: { state: wires } - - type: Construction - graph: GasPipeSensor - node: assembly - - type: NodeContainer - nodes: - monitored: - !type:PipeNode - nodeGroupID: Pipe - pipeDirection: Longitudinal - - type: Tag - tags: - - Unstackable - -- type: entity - parent: [AirSensorBase, GasPipeSensorAssembly] + parent: [AirSensorBase, GasPipeBase] id: GasPipeSensor name: gas pipe sensor description: Reports on the status of the gas in the attached pipe network. @@ -52,18 +15,12 @@ state: pipeStraight - map: ["base"] state: base - - map: [ "enum.ConstructionVisuals.Layer" ] - state: blank - map: [ "enum.PowerDeviceVisualLayers.Powered" ] state: lights shader: unshaded - type: Appearance - type: GenericVisualizer visuals: - enum.ConstructionVisuals.Key: - enum.ConstructionVisuals.Layer: - wiredSensor: { state: wires_connected } - sensor: { state: blank } enum.PowerDeviceVisuals.Powered: enum.PowerDeviceVisualLayers.Powered: False: { state: blank } @@ -74,7 +31,17 @@ - type: ExtensionCableReceiver - type: Construction graph: GasPipeSensor - node: sensor + node: sensor + - type: NodeContainer + nodes: + monitored: + !type:PipeNode + nodeGroupID: Pipe + pipeDirection: Longitudinal + - type: Tag + tags: + - AirSensor + - Unstackable - type: entity parent: GasPipeSensor diff --git a/Resources/Prototypes/Recipes/Construction/Graphs/utilities/gas_pipe_sensor.yml b/Resources/Prototypes/Recipes/Construction/Graphs/utilities/gas_pipe_sensor.yml index 049ab5ab37c770..c2060d4781a740 100644 --- a/Resources/Prototypes/Recipes/Construction/Graphs/utilities/gas_pipe_sensor.yml +++ b/Resources/Prototypes/Recipes/Construction/Graphs/utilities/gas_pipe_sensor.yml @@ -4,16 +4,16 @@ graph: - node: start edges: - - to: assembly + - to: sensor steps: - material: Steel amount: 2 doAfter: 1 - - node: assembly - entity: GasPipeSensorAssembly + - node: sensor + entity: GasPipeSensor actions: - - !type:AppearanceChange + - !type:SetAnchor edges: - to: start completed: @@ -21,77 +21,6 @@ prototype: SheetSteel1 amount: 2 - !type:DeleteEntity - conditions: - - !type:EntityAnchored - anchored: false - steps: - - tool: Screwing - doAfter: 2 - - - to: wiredAssembly - conditions: - - !type:EntityAnchored - steps: - - material: Cable - amount: 2 - doAfter: 1 - - - node: wiredAssembly - actions: - - !type:AppearanceChange - edges: - - to: assembly - completed: - - !type:GivePrototype - prototype: CableApcStack1 - amount: 2 - conditions: - - !type:EntityAnchored - anchored: false - steps: - - tool: Cutting - doAfter: 1 - - - to: sensor - completed: - - !type:SetAnchor - value: false - conditions: - - !type:EntityAnchored - steps: - - tool: Screwing - doAfter: 2 - - - node: wiredSensor - actions: - - !type:AppearanceChange - edges: - - to: assembly - completed: - - !type:GivePrototype - prototype: CableApcStack1 - amount: 2 - conditions: - - !type:EntityAnchored - anchored: false - steps: - - tool: Cutting - doAfter: 1 - - - to: sensor - conditions: - - !type:EntityAnchored - steps: - - tool: Screwing - doAfter: 2 - - - node: sensor - entity: GasPipeSensor - actions: - - !type:AppearanceChange - - !type:SetAnchor - edges: - - to: wiredSensor conditions: - !type:EntityAnchored anchored: false diff --git a/Resources/Textures/Structures/Piping/Atmospherics/gas_pipe_sensor.rsi/cavity.png b/Resources/Textures/Structures/Piping/Atmospherics/gas_pipe_sensor.rsi/cavity.png deleted file mode 100644 index 8ea62e617a8bb2914432e134e75b92d9ae70c149..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 120 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdzdrud~kch)?FDVKEC0qhG2-^sz zKX+l{TM#RK@KAkW`i+|n91ILE{IuQQ?R&4I^yPL#<~N>*nM>Cl6lP$!Wj#5ZgZ1qv R1{B$vqs`nw;s Q1X|4C>FVdQ&MBb@0Fh@uBme*a diff --git a/Resources/Textures/Structures/Piping/Atmospherics/gas_pipe_sensor.rsi/wires_connected.png b/Resources/Textures/Structures/Piping/Atmospherics/gas_pipe_sensor.rsi/wires_connected.png deleted file mode 100644 index 58f2dbfb5d065140c9d2b71e157d15e54642964c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 160 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=ffJbWaz@kch)?FYo3&V8Fw2A-GC3 zZ);EcC%=1#_m+D;WYp{BR9wpKd}6Pg!Ugt520=l=pVrZurz}6u&0c$R+uF(2+y|cc zZ9etn+}iZl#T6{?cieg%p=)z|L;9U{%sLFp9-F=PPVP979vki>{~+5}`ajT022WQ% Jmvv4FO#l&)J)!^r From 0ae993ae34bee75977b197362cb9d5825ca97373 Mon Sep 17 00:00:00 2001 From: chromiumboy Date: Sat, 9 Nov 2024 22:01:54 -0600 Subject: [PATCH 5/7] Tweaked deconstruction to match other binary atmos devices --- .../Recipes/Construction/Graphs/utilities/gas_pipe_sensor.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Resources/Prototypes/Recipes/Construction/Graphs/utilities/gas_pipe_sensor.yml b/Resources/Prototypes/Recipes/Construction/Graphs/utilities/gas_pipe_sensor.yml index c2060d4781a740..bda6d036e9b9e7 100644 --- a/Resources/Prototypes/Recipes/Construction/Graphs/utilities/gas_pipe_sensor.yml +++ b/Resources/Prototypes/Recipes/Construction/Graphs/utilities/gas_pipe_sensor.yml @@ -25,5 +25,5 @@ - !type:EntityAnchored anchored: false steps: - - tool: Screwing - doAfter: 2 \ No newline at end of file + - tool: Welding + doAfter: 1 \ No newline at end of file From 84180a4a91d43413f528b84d0f8cd1ee700a7464 Mon Sep 17 00:00:00 2001 From: chromiumboy Date: Mon, 11 Nov 2024 19:48:51 -0600 Subject: [PATCH 6/7] Helper function removal --- .../Monitor/Systems/AtmosMonitoringSystem.cs | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/Content.Server/Atmos/Monitor/Systems/AtmosMonitoringSystem.cs b/Content.Server/Atmos/Monitor/Systems/AtmosMonitoringSystem.cs index b9cde9fa5d4ae5..17a24b1b0cb6b1 100644 --- a/Content.Server/Atmos/Monitor/Systems/AtmosMonitoringSystem.cs +++ b/Content.Server/Atmos/Monitor/Systems/AtmosMonitoringSystem.cs @@ -60,9 +60,9 @@ private void OnAtmosDeviceLeaveAtmosphere(EntityUid uid, AtmosMonitorComponent a private void OnAtmosDeviceEnterAtmosphere(EntityUid uid, AtmosMonitorComponent atmosMonitor, ref AtmosDeviceEnabledEvent args) { - if (atmosMonitor.MonitorsPipeNet) + if (atmosMonitor.MonitorsPipeNet && _nodeContainerSystem.TryGetNode(uid, atmosMonitor.NodeNameMonitoredPipe, out var pipeNode)) { - atmosMonitor.TileGas = GetGasPipeAirMixture(uid, atmosMonitor); + atmosMonitor.TileGas = pipeNode.Air; return; } @@ -227,20 +227,12 @@ private void OnAtmosUpdate(EntityUid uid, AtmosMonitorComponent component, ref A return; // If monitoring a pipe network, get its most recent gas mixture - if (component.MonitorsPipeNet) - component.TileGas = GetGasPipeAirMixture(uid, component); + if (component.MonitorsPipeNet && _nodeContainerSystem.TryGetNode(uid, component.NodeNameMonitoredPipe, out var pipeNode)) + component.TileGas = pipeNode.Air; UpdateState(uid, component.TileGas, component); } - private GasMixture? GetGasPipeAirMixture(EntityUid uid, AtmosMonitorComponent component) - { - if (_nodeContainerSystem.TryGetNode(uid, component.NodeNameMonitoredPipe, out var pipeNode)) - return pipeNode.Air; - - return null; - } - // Update checks the current air if it exceeds thresholds of // any kind. // From e104b6d9227934c58ff2cab924ee196213ad12d4 Mon Sep 17 00:00:00 2001 From: chromiumboy Date: Mon, 11 Nov 2024 20:21:30 -0600 Subject: [PATCH 7/7] Updated attribution --- .../Piping/Atmospherics/gas_pipe_sensor.rsi/meta.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Resources/Textures/Structures/Piping/Atmospherics/gas_pipe_sensor.rsi/meta.json b/Resources/Textures/Structures/Piping/Atmospherics/gas_pipe_sensor.rsi/meta.json index 2e4d7e4efa585c..878c7817a2b387 100644 --- a/Resources/Textures/Structures/Piping/Atmospherics/gas_pipe_sensor.rsi/meta.json +++ b/Resources/Textures/Structures/Piping/Atmospherics/gas_pipe_sensor.rsi/meta.json @@ -1,7 +1,7 @@ { "version": 1, "license": "CC-BY-SA-3.0", - "copyright": "Created by chromiumboy (github) for SS14, based on the digital valve from /tg/", + "copyright": "Created by chromiumboy (github) for SS14, based on the digital valve from /tg/, taken from https://github.com/tgstation/tgstation at commit 57cd1d59ca019dd0e7811ac451f295f818e573da.", "size": { "x": 32, "y": 32