From 2b3f00ed1edcafee052e3fab33451a70f7992fdf Mon Sep 17 00:00:00 2001 From: r4d6 Date: Sat, 18 Jan 2020 22:16:43 -0500 Subject: [PATCH] Fix Freezer overlay bug --- code/modules/atmospherics/machinery/atmosmachinery.dm | 5 +++-- .../machinery/components/binary_devices/dp_vent_pump.dm | 3 +-- .../atmospherics/machinery/components/components_base.dm | 8 ++------ .../machinery/components/trinary_devices/filter.dm | 5 ++--- .../machinery/components/trinary_devices/mixer.dm | 5 ++--- .../machinery/components/unary_devices/passive_vent.dm | 2 +- .../components/unary_devices/portables_connector.dm | 3 +-- .../machinery/components/unary_devices/thermomachine.dm | 2 ++ .../machinery/components/unary_devices/vent_pump.dm | 3 +-- .../machinery/components/unary_devices/vent_scrubber.dm | 3 +-- .../modules/atmospherics/machinery/pipes/layermanifold.dm | 4 ++-- 11 files changed, 18 insertions(+), 25 deletions(-) diff --git a/code/modules/atmospherics/machinery/atmosmachinery.dm b/code/modules/atmospherics/machinery/atmosmachinery.dm index e4e6274662..c533117951 100644 --- a/code/modules/atmospherics/machinery/atmosmachinery.dm +++ b/code/modules/atmospherics/machinery/atmosmachinery.dm @@ -244,19 +244,20 @@ transfer_fingerprints_to(stored) ..() -/obj/machinery/atmospherics/proc/getpipeimage(iconset, iconstate, direction, col=rgb(255,255,255)) +/obj/machinery/atmospherics/proc/getpipeimage(iconset, iconstate, direction, col=rgb(255,255,255), piping_layer=2) //Add identifiers for the iconset if(iconsetids[iconset] == null) iconsetids[iconset] = num2text(iconsetids.len + 1) //Generate a unique identifier for this image combination - var/identifier = iconsetids[iconset] + "_[iconstate]_[direction]_[col]" + var/identifier = iconsetids[iconset] + "_[iconstate]_[direction]_[col]_[piping_layer]" if((!(. = pipeimages[identifier]))) var/image/pipe_overlay pipe_overlay = . = pipeimages[identifier] = image(iconset, iconstate, dir = direction) pipe_overlay.color = col + PIPING_LAYER_SHIFT(pipe_overlay, piping_layer) /obj/machinery/atmospherics/on_construction(obj_color, set_layer) if(can_unwrench) diff --git a/code/modules/atmospherics/machinery/components/binary_devices/dp_vent_pump.dm b/code/modules/atmospherics/machinery/components/binary_devices/dp_vent_pump.dm index c4e9b1f200..9238b8602b 100644 --- a/code/modules/atmospherics/machinery/components/binary_devices/dp_vent_pump.dm +++ b/code/modules/atmospherics/machinery/components/binary_devices/dp_vent_pump.dm @@ -38,8 +38,7 @@ /obj/machinery/atmospherics/components/binary/dp_vent_pump/update_icon_nopipes() cut_overlays() if(showpipe) - var/image/cap = getpipeimage(icon, "dpvent_cap", dir) - PIPING_LAYER_SHIFT(cap, piping_layer) + var/image/cap = getpipeimage(icon, "dpvent_cap", dir, piping_layer = piping_layer) add_overlay(cap) if(!on || !is_operational()) diff --git a/code/modules/atmospherics/machinery/components/components_base.dm b/code/modules/atmospherics/machinery/components/components_base.dm index 1f5cd8b150..ff2a655aac 100644 --- a/code/modules/atmospherics/machinery/components/components_base.dm +++ b/code/modules/atmospherics/machinery/components/components_base.dm @@ -58,13 +58,9 @@ /obj/machinery/atmospherics/components/proc/get_pipe_underlay(state, dir, color = null) if(color) - . = getpipeimage('icons/obj/atmospherics/components/binary_devices.dmi', state, dir, color) + . = getpipeimage('icons/obj/atmospherics/components/binary_devices.dmi', state, dir, color, piping_layer = shift_underlay_only ? piping_layer : 2) else - . = getpipeimage('icons/obj/atmospherics/components/binary_devices.dmi', state, dir) - - if(shift_underlay_only) - var/image/I = . - PIPING_LAYER_SHIFT(I, piping_layer) + . = getpipeimage('icons/obj/atmospherics/components/binary_devices.dmi', state, dir, piping_layer = shift_underlay_only ? piping_layer : 2) // Pipenet stuff; housekeeping diff --git a/code/modules/atmospherics/machinery/components/trinary_devices/filter.dm b/code/modules/atmospherics/machinery/components/trinary_devices/filter.dm index 22249d5fff..2fd1bdc121 100644 --- a/code/modules/atmospherics/machinery/components/trinary_devices/filter.dm +++ b/code/modules/atmospherics/machinery/components/trinary_devices/filter.dm @@ -60,11 +60,10 @@ var/image/cap if(node) - cap = getpipeimage(icon, "cap", direction, node.pipe_color) + cap = getpipeimage(icon, "cap", direction, node.pipe_color, piping_layer = piping_layer) else - cap = getpipeimage(icon, "cap", direction) + cap = getpipeimage(icon, "cap", direction, piping_layer = piping_layer) - PIPING_LAYER_SHIFT(cap, piping_layer) add_overlay(cap) return ..() diff --git a/code/modules/atmospherics/machinery/components/trinary_devices/mixer.dm b/code/modules/atmospherics/machinery/components/trinary_devices/mixer.dm index 60db07bb75..8c7d82d549 100644 --- a/code/modules/atmospherics/machinery/components/trinary_devices/mixer.dm +++ b/code/modules/atmospherics/machinery/components/trinary_devices/mixer.dm @@ -52,11 +52,10 @@ var/image/cap if(node) - cap = getpipeimage(icon, "cap", direction, node.pipe_color) + cap = getpipeimage(icon, "cap", direction, node.pipe_color, piping_layer = piping_layer) else - cap = getpipeimage(icon, "cap", direction) + cap = getpipeimage(icon, "cap", direction, piping_layer = piping_layer) - PIPING_LAYER_SHIFT(cap, piping_layer) add_overlay(cap) return ..() 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 e4c44c45a4..6f8386374e 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/passive_vent.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/passive_vent.dm @@ -13,7 +13,7 @@ /obj/machinery/atmospherics/components/unary/passive_vent/update_icon_nopipes() cut_overlays() if(showpipe) - var/image/cap = getpipeimage(icon, "vent_cap", initialize_directions) + var/image/cap = getpipeimage(icon, "vent_cap", initialize_directions, piping_layer = piping_layer) 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 de89cb0973..81ca14a828 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/portables_connector.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/portables_connector.dm @@ -26,8 +26,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_SHIFT(cap, piping_layer) + var/image/cap = getpipeimage(icon, "connector_cap", initialize_directions, piping_layer = piping_layer) add_overlay(cap) /obj/machinery/atmospherics/components/unary/portables_connector/process_atmos() diff --git a/code/modules/atmospherics/machinery/components/unary_devices/thermomachine.dm b/code/modules/atmospherics/machinery/components/unary_devices/thermomachine.dm index a7a9e13e26..c69c4c47b0 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/thermomachine.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/thermomachine.dm @@ -41,12 +41,14 @@ /obj/machinery/atmospherics/components/unary/thermomachine/update_icon() cut_overlays() + if(panel_open) icon_state = icon_state_open else if(on && is_operational()) icon_state = icon_state_on else icon_state = icon_state_off + add_overlay(getpipeimage(icon, "pipe", dir, , piping_layer)) /obj/machinery/atmospherics/components/unary/thermomachine/update_icon_nopipes() 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 1143412358..3cbf1b4d0e 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/vent_pump.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/vent_pump.dm @@ -50,8 +50,7 @@ /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_SHIFT(cap, piping_layer) + var/image/cap = getpipeimage(icon, "vent_cap", initialize_directions, piping_layer = piping_layer) add_overlay(cap) if(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 ffcaa7cc04..22cd9d7fca 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/vent_scrubber.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/vent_scrubber.dm @@ -68,8 +68,7 @@ /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_SHIFT(cap, piping_layer) + var/image/cap = getpipeimage(icon, "scrub_cap", initialize_directions, piping_layer = piping_layer) add_overlay(cap) if(welded) diff --git a/code/modules/atmospherics/machinery/pipes/layermanifold.dm b/code/modules/atmospherics/machinery/pipes/layermanifold.dm index 39e3313da2..b98098584f 100644 --- a/code/modules/atmospherics/machinery/pipes/layermanifold.dm +++ b/code/modules/atmospherics/machinery/pipes/layermanifold.dm @@ -60,9 +60,9 @@ var/image/I if(p_color) - I = getpipeimage(icon, "pipe", p_dir, p_color) + I = getpipeimage(icon, "pipe", p_dir, p_color, piping_layer = piping_layer) else - I = getpipeimage(icon, "pipe", p_dir) + I = getpipeimage(icon, "pipe", p_dir, piping_layer = piping_layer) I.layer = layer - 0.01 PIPING_LAYER_SHIFT(I, p_layer)