From d489a8bb478a464c0d338df7809ce4091e37ffd0 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Mon, 7 Sep 2020 05:51:21 +0200 Subject: [PATCH] [MIRROR] Set different layers to different piping layers (#686) * Merge pull request #53397 from Dennok/patch-40 Set different layers to different piping layers different layers to different piping layers pipes should be displayed in a fixed order better pipe visuals * Set different layers to different piping layers Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com> --- code/__DEFINES/atmospherics.dm | 1 + code/__DEFINES/layers.dm | 6 +++--- code/modules/atmospherics/machinery/atmosmachinery.dm | 4 ++++ .../atmospherics/machinery/components/components_base.dm | 3 ++- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/code/__DEFINES/atmospherics.dm b/code/__DEFINES/atmospherics.dm index c79b21c61a7..55859477bf5 100644 --- a/code/__DEFINES/atmospherics.dm +++ b/code/__DEFINES/atmospherics.dm @@ -350,6 +350,7 @@ //MULTIPIPES //IF YOU EVER CHANGE THESE CHANGE SPRITES TO MATCH. +//layer = initial(layer) + piping_layer / 1000 in atmospherics/update_icon() to determine order of pipe overlap #define PIPING_LAYER_MIN 1 #define PIPING_LAYER_MAX 5 #define PIPING_LAYER_DEFAULT 3 diff --git a/code/__DEFINES/layers.dm b/code/__DEFINES/layers.dm index 46e8032e055..6beb1828b6d 100644 --- a/code/__DEFINES/layers.dm +++ b/code/__DEFINES/layers.dm @@ -33,12 +33,12 @@ #define ABOVE_NORMAL_TURF_LAYER 2.08 #define LATTICE_LAYER 2.2 #define DISPOSAL_PIPE_LAYER 2.3 -#define GAS_PIPE_HIDDEN_LAYER 2.35 +#define GAS_PIPE_HIDDEN_LAYER 2.35 //layer = initial(layer) + piping_layer / 1000 in atmospherics/update_icon() to determine order of pipe overlap #define WIRE_LAYER 2.4 #define WIRE_BRIDGE_LAYER 2.44 #define WIRE_TERMINAL_LAYER 2.45 -#define GAS_SCRUBBER_LAYER 2.46 -#define GAS_PIPE_VISIBLE_LAYER 2.47 +#define GAS_SCRUBBER_LAYER 2.46 +#define GAS_PIPE_VISIBLE_LAYER 2.47 //layer = initial(layer) + piping_layer / 1000 in atmospherics/update_icon() to determine order of pipe overlap #define GAS_FILTER_LAYER 2.48 #define GAS_PUMP_LAYER 2.49 #define LOW_OBJ_LAYER 2.5 diff --git a/code/modules/atmospherics/machinery/atmosmachinery.dm b/code/modules/atmospherics/machinery/atmosmachinery.dm index 7b265f34612..b8d18479611 100644 --- a/code/modules/atmospherics/machinery/atmosmachinery.dm +++ b/code/modules/atmospherics/machinery/atmosmachinery.dm @@ -126,6 +126,10 @@ piping_layer = (pipe_flags & PIPING_DEFAULT_LAYER_ONLY) ? PIPING_LAYER_DEFAULT : new_layer update_icon() +/obj/machinery/atmospherics/update_icon() + layer = initial(layer) + piping_layer / 1000 + return ..() + /obj/machinery/atmospherics/proc/can_be_node(obj/machinery/atmospherics/target, iteration) return connection_check(target, piping_layer) diff --git a/code/modules/atmospherics/machinery/components/components_base.dm b/code/modules/atmospherics/machinery/components/components_base.dm index 951638d378d..c9b8c06eb20 100644 --- a/code/modules/atmospherics/machinery/components/components_base.dm +++ b/code/modules/atmospherics/machinery/components/components_base.dm @@ -45,7 +45,7 @@ plane = showpipe ? GAME_PLANE : FLOOR_PLANE if(!showpipe) - return + return ..() var/connected = 0 //Direction bitset @@ -62,6 +62,7 @@ if(!shift_underlay_only) PIPING_LAYER_SHIFT(src, piping_layer) + return ..() /obj/machinery/atmospherics/components/proc/get_pipe_underlay(state, dir, color = null) if(color)