diff --git a/code/__DEFINES/atmospherics.dm b/code/__DEFINES/atmospherics.dm index 55859477bf5..255df74d7f3 100644 --- a/code/__DEFINES/atmospherics.dm +++ b/code/__DEFINES/atmospherics.dm @@ -376,6 +376,14 @@ T.pixel_y = (PipingLayer - PIPING_LAYER_DEFAULT) * PIPING_LAYER_P_Y;\ } +#define PIPING_FORWARD_SHIFT(T, PipingLayer, more_shift) \ + if(T.dir & (NORTH|SOUTH)) { \ + T.pixel_y += more_shift * (PipingLayer - PIPING_LAYER_DEFAULT);\ + } \ + if(T.dir & (EAST|WEST)) { \ + T.pixel_x += more_shift * (PipingLayer - PIPING_LAYER_DEFAULT);\ + } + #define PIPING_LAYER_DOUBLE_SHIFT(T, PipingLayer) \ T.pixel_x = (PipingLayer - PIPING_LAYER_DEFAULT) * PIPING_LAYER_P_X;\ T.pixel_y = (PipingLayer - PIPING_LAYER_DEFAULT) * PIPING_LAYER_P_Y; diff --git a/code/modules/atmospherics/machinery/atmosmachinery.dm b/code/modules/atmospherics/machinery/atmosmachinery.dm index b8d18479611..3b0ed272f3b 100644 --- a/code/modules/atmospherics/machinery/atmosmachinery.dm +++ b/code/modules/atmospherics/machinery/atmosmachinery.dm @@ -249,7 +249,7 @@ transfer_fingerprints_to(stored) ..() -/obj/machinery/atmospherics/proc/getpipeimage(iconset, iconstate, direction, col=rgb(255,255,255), piping_layer=3) +/obj/machinery/atmospherics/proc/getpipeimage(iconset, iconstate, direction, col=rgb(255,255,255), piping_layer=3, trinary = FALSE) //Add identifiers for the iconset if(iconsetids[iconset] == null) @@ -263,6 +263,8 @@ pipe_overlay = . = pipeimages[identifier] = image(iconset, iconstate, dir = direction) pipe_overlay.color = col PIPING_LAYER_SHIFT(pipe_overlay, piping_layer) + if(trinary == TRUE && (piping_layer == 1 || piping_layer == 5)) + PIPING_FORWARD_SHIFT(pipe_overlay, piping_layer, 2) /obj/machinery/atmospherics/on_construction(obj_color, set_layer) if(can_unwrench) diff --git a/code/modules/atmospherics/machinery/components/binary_devices/binary_devices.dm b/code/modules/atmospherics/machinery/components/binary_devices/binary_devices.dm index fe50cfdce73..a7565958b42 100644 --- a/code/modules/atmospherics/machinery/components/binary_devices/binary_devices.dm +++ b/code/modules/atmospherics/machinery/components/binary_devices/binary_devices.dm @@ -15,3 +15,11 @@ /obj/machinery/atmospherics/components/binary/getNodeConnects() return list(turn(dir, 180), dir) + +///Used by binary devices to set what the offset will be for each layer +/obj/machinery/atmospherics/components/binary/proc/set_overlay_offset(var/pipe_layer) + switch(pipe_layer) + if(1, 3, 5) + return 1 + if(2, 4) + return 2 diff --git a/code/modules/atmospherics/machinery/components/binary_devices/passive_gate.dm b/code/modules/atmospherics/machinery/components/binary_devices/passive_gate.dm index 8766d7b6fc9..a2b22738b7d 100644 --- a/code/modules/atmospherics/machinery/components/binary_devices/passive_gate.dm +++ b/code/modules/atmospherics/machinery/components/binary_devices/passive_gate.dm @@ -47,9 +47,9 @@ Passive gate is similar to the regular pump except: /obj/machinery/atmospherics/components/binary/passive_gate/update_icon_nopipes() cut_overlays() - icon_state = "passgate_off" + icon_state = "passgate_off-[set_overlay_offset(piping_layer)]" if(on) - add_overlay(getpipeimage(icon, "passgate_on")) + add_overlay(getpipeimage(icon, "passgate_on-[set_overlay_offset(piping_layer)]")) /obj/machinery/atmospherics/components/binary/passive_gate/process_atmos() ..() diff --git a/code/modules/atmospherics/machinery/components/binary_devices/pressure_valve.dm b/code/modules/atmospherics/machinery/components/binary_devices/pressure_valve.dm index ed7bc3d7c30..8e6379e3b7f 100644 --- a/code/modules/atmospherics/machinery/components/binary_devices/pressure_valve.dm +++ b/code/modules/atmospherics/machinery/components/binary_devices/pressure_valve.dm @@ -42,11 +42,11 @@ /obj/machinery/atmospherics/components/binary/pressure_valve/update_icon_nopipes() if(on && is_operational && is_gas_flowing) - icon_state = "pvalve_flow" + icon_state = "pvalve_flow-[set_overlay_offset(piping_layer)]" else if(on && is_operational && !is_gas_flowing) - icon_state = "pvalve_on" + icon_state = "pvalve_on-[set_overlay_offset(piping_layer)]" else - icon_state = "pvalve_off" + icon_state = "pvalve_off-[set_overlay_offset(piping_layer)]" /obj/machinery/atmospherics/components/binary/pressure_valve/process_atmos() diff --git a/code/modules/atmospherics/machinery/components/binary_devices/pump.dm b/code/modules/atmospherics/machinery/components/binary_devices/pump.dm index f1897ceafee..60334328671 100644 --- a/code/modules/atmospherics/machinery/components/binary_devices/pump.dm +++ b/code/modules/atmospherics/machinery/components/binary_devices/pump.dm @@ -48,7 +48,7 @@ return ..() /obj/machinery/atmospherics/components/binary/pump/update_icon_nopipes() - icon_state = (on && is_operational) ? "pump_on" : "pump_off" + icon_state = (on && is_operational) ? "pump_on-[set_overlay_offset(piping_layer)]" : "pump_off-[set_overlay_offset(piping_layer)]" /obj/machinery/atmospherics/components/binary/pump/process_atmos() // ..() diff --git a/code/modules/atmospherics/machinery/components/binary_devices/valve.dm b/code/modules/atmospherics/machinery/components/binary_devices/valve.dm index 24d65ff5e92..0631fac4856 100644 --- a/code/modules/atmospherics/machinery/components/binary_devices/valve.dm +++ b/code/modules/atmospherics/machinery/components/binary_devices/valve.dm @@ -27,8 +27,8 @@ It's like a regular ol' straight pipe, but you can turn it on and off. /obj/machinery/atmospherics/components/binary/valve/update_icon_nopipes(animation = FALSE) normalize_cardinal_directions() if(animation) - flick("[valve_type]valve_[on][!on]", src) - icon_state = "[valve_type]valve_[on ? "on" : "off"]" + flick("[valve_type]valve_[on][!on]-[set_overlay_offset(piping_layer)]", src) + icon_state = "[valve_type]valve_[on ? "on" : "off"]-[set_overlay_offset(piping_layer)]" /obj/machinery/atmospherics/components/binary/valve/proc/toggle() if(on) @@ -69,7 +69,7 @@ It's like a regular ol' straight pipe, but you can turn it on and off. /obj/machinery/atmospherics/components/binary/valve/digital/update_icon_nopipes(animation) if(!is_operational) normalize_cardinal_directions() - icon_state = "dvalve_nopower" + icon_state = "dvalve_nopower-[set_overlay_offset(piping_layer)]" return ..() diff --git a/code/modules/atmospherics/machinery/components/binary_devices/volume_pump.dm b/code/modules/atmospherics/machinery/components/binary_devices/volume_pump.dm index cd4eb670853..31de8b18e94 100644 --- a/code/modules/atmospherics/machinery/components/binary_devices/volume_pump.dm +++ b/code/modules/atmospherics/machinery/components/binary_devices/volume_pump.dm @@ -47,7 +47,7 @@ return ..() /obj/machinery/atmospherics/components/binary/volume_pump/update_icon_nopipes() - icon_state = on && is_operational ? "volpump_on" : "volpump_off" + icon_state = on && is_operational ? "volpump_on-[set_overlay_offset(piping_layer)]" : "volpump_off-[set_overlay_offset(piping_layer)]" /obj/machinery/atmospherics/components/binary/volume_pump/process_atmos() // ..() diff --git a/code/modules/atmospherics/machinery/components/trinary_devices/filter.dm b/code/modules/atmospherics/machinery/components/trinary_devices/filter.dm index 6f729f9e41d..2539aa83fbf 100644 --- a/code/modules/atmospherics/machinery/components/trinary_devices/filter.dm +++ b/code/modules/atmospherics/machinery/components/trinary_devices/filter.dm @@ -47,9 +47,9 @@ var/image/cap if(node) - cap = getpipeimage(icon, "cap", direction, node.pipe_color, piping_layer = piping_layer) + cap = getpipeimage(icon, "cap", direction, node.pipe_color, piping_layer = piping_layer, trinary = TRUE) else - cap = getpipeimage(icon, "cap", direction, piping_layer = piping_layer) + cap = getpipeimage(icon, "cap", direction, piping_layer = piping_layer, trinary = TRUE) add_overlay(cap) @@ -57,7 +57,7 @@ /obj/machinery/atmospherics/components/trinary/filter/update_icon_nopipes() var/on_state = on && nodes[1] && nodes[2] && nodes[3] && is_operational - icon_state = "filter_[on_state ? "on" : "off"][flipped ? "_f" : ""]" + icon_state = "filter_[on_state ? "on" : "off"]-[set_overlay_offset(piping_layer)][flipped ? "_f" : ""]" /obj/machinery/atmospherics/components/trinary/filter/process_atmos() ..() diff --git a/code/modules/atmospherics/machinery/components/trinary_devices/mixer.dm b/code/modules/atmospherics/machinery/components/trinary_devices/mixer.dm index 14dedc59aaa..fc3b04c0c47 100644 --- a/code/modules/atmospherics/machinery/components/trinary_devices/mixer.dm +++ b/code/modules/atmospherics/machinery/components/trinary_devices/mixer.dm @@ -39,9 +39,9 @@ var/image/cap if(node) - cap = getpipeimage(icon, "cap", direction, node.pipe_color, piping_layer = piping_layer) + cap = getpipeimage(icon, "cap", direction, node.pipe_color, piping_layer = piping_layer, trinary = TRUE) else - cap = getpipeimage(icon, "cap", direction, piping_layer = piping_layer) + cap = getpipeimage(icon, "cap", direction, piping_layer = piping_layer, trinary = TRUE) add_overlay(cap) @@ -49,7 +49,7 @@ /obj/machinery/atmospherics/components/trinary/mixer/update_icon_nopipes() var/on_state = on && nodes[1] && nodes[2] && nodes[3] && is_operational - icon_state = "mixer_[on_state ? "on" : "off"][flipped ? "_f" : ""]" + icon_state = "mixer_[on_state ? "on" : "off"]-[set_overlay_offset(piping_layer)][flipped ? "_f" : ""]" /obj/machinery/atmospherics/components/trinary/mixer/New() ..() diff --git a/code/modules/atmospherics/machinery/components/trinary_devices/trinary_devices.dm b/code/modules/atmospherics/machinery/components/trinary_devices/trinary_devices.dm index b448c212567..13fcd05d0ae 100644 --- a/code/modules/atmospherics/machinery/components/trinary_devices/trinary_devices.dm +++ b/code/modules/atmospherics/machinery/components/trinary_devices/trinary_devices.dm @@ -46,3 +46,12 @@ Housekeeping and pipe network stuff node3_connect = turn(node3_connect, 180) return list(node1_connect, node2_connect, node3_connect) + +/obj/machinery/atmospherics/components/trinary/proc/set_overlay_offset(var/pipe_layer) + switch(pipe_layer) + if(1) + return 1 + if(5) + return 5 + else + return 0 diff --git a/code/modules/atmospherics/machinery/components/unary_devices/passive_vent.dm b/code/modules/atmospherics/machinery/components/unary_devices/passive_vent.dm index 521756447dc..e5f1819ae68 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/passive_vent.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/passive_vent.dm @@ -7,13 +7,14 @@ can_unwrench = TRUE hide = TRUE layer = GAS_SCRUBBER_LAYER + shift_underlay_only = FALSE pipe_state = "pvent" /obj/machinery/atmospherics/components/unary/passive_vent/update_icon_nopipes() cut_overlays() if(showpipe) - var/image/cap = getpipeimage(icon, "vent_cap", initialize_directions, piping_layer = piping_layer) + var/image/cap = getpipeimage(icon, "vent_cap", initialize_directions) add_overlay(cap) icon_state = "passive_vent" diff --git a/code/modules/atmospherics/machinery/components/unary_devices/portables_connector.dm b/code/modules/atmospherics/machinery/components/unary_devices/portables_connector.dm index 3bd7f845e70..e3906b0a46b 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/portables_connector.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/portables_connector.dm @@ -9,6 +9,7 @@ use_power = NO_POWER_USE layer = GAS_FILTER_LAYER hide = TRUE + shift_underlay_only = FALSE pipe_flags = PIPING_ONE_PER_TURF pipe_state = "connector" @@ -28,7 +29,7 @@ /obj/machinery/atmospherics/components/unary/portables_connector/update_icon_nopipes() icon_state = "connector" if(showpipe) - var/image/cap = getpipeimage(icon, "connector_cap", initialize_directions, piping_layer = piping_layer) + var/image/cap = getpipeimage(icon, "connector_cap", initialize_directions) add_overlay(cap) /obj/machinery/atmospherics/components/unary/portables_connector/process_atmos() diff --git a/code/modules/atmospherics/machinery/components/unary_devices/vent_pump.dm b/code/modules/atmospherics/machinery/components/unary_devices/vent_pump.dm index 98597520494..4cc764a05af 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/vent_pump.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/vent_pump.dm @@ -16,6 +16,7 @@ welded = FALSE layer = GAS_SCRUBBER_LAYER hide = TRUE + shift_underlay_only = FALSE var/id_tag = null var/pump_direction = RELEASING @@ -52,8 +53,10 @@ /obj/machinery/atmospherics/components/unary/vent_pump/update_icon_nopipes() cut_overlays() if(showpipe) - var/image/cap = getpipeimage(icon, "vent_cap", initialize_directions, piping_layer = piping_layer) + var/image/cap = getpipeimage(icon, "vent_cap", initialize_directions) add_overlay(cap) + else + PIPING_LAYER_SHIFT(src, PIPING_LAYER_DEFAULT) if(welded) icon_state = "vent_welded" diff --git a/code/modules/atmospherics/machinery/components/unary_devices/vent_scrubber.dm b/code/modules/atmospherics/machinery/components/unary_devices/vent_scrubber.dm index 1520ef19ac1..ba0d0822893 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/vent_scrubber.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/vent_scrubber.dm @@ -13,6 +13,7 @@ welded = FALSE layer = GAS_SCRUBBER_LAYER hide = TRUE + shift_underlay_only = FALSE var/id_tag = null var/scrubbing = SCRUBBING //0 = siphoning, 1 = scrubbing @@ -69,8 +70,10 @@ /obj/machinery/atmospherics/components/unary/vent_scrubber/update_icon_nopipes() cut_overlays() if(showpipe) - var/image/cap = getpipeimage(icon, "scrub_cap", initialize_directions, piping_layer = piping_layer) + var/image/cap = getpipeimage(icon, "scrub_cap", initialize_directions) add_overlay(cap) + else + PIPING_LAYER_SHIFT(src, PIPING_LAYER_DEFAULT) if(welded) icon_state = "scrub_welded" diff --git a/icons/obj/atmospherics/components/binary_devices.dmi b/icons/obj/atmospherics/components/binary_devices.dmi index 9231371de14..f7c9c33901f 100644 Binary files a/icons/obj/atmospherics/components/binary_devices.dmi and b/icons/obj/atmospherics/components/binary_devices.dmi differ diff --git a/icons/obj/atmospherics/components/trinary_devices.dmi b/icons/obj/atmospherics/components/trinary_devices.dmi index be08e71aa8a..0d159b88f02 100644 Binary files a/icons/obj/atmospherics/components/trinary_devices.dmi and b/icons/obj/atmospherics/components/trinary_devices.dmi differ diff --git a/icons/obj/atmospherics/pipes/manifold.dmi b/icons/obj/atmospherics/pipes/manifold.dmi index 76f66351966..f96874dc059 100644 Binary files a/icons/obj/atmospherics/pipes/manifold.dmi and b/icons/obj/atmospherics/pipes/manifold.dmi differ