From 16e845a81b11eee694a21901c665f120e5c8aac9 Mon Sep 17 00:00:00 2001 From: Charlie <69320440+hal9000PR@users.noreply.github.com> Date: Sun, 23 Oct 2022 15:48:09 +0100 Subject: [PATCH] Fixes parallax being visible in the "fog of war" (#19474) * the most genius solution to a stupid problem * help me * perfect hatred --- code/_onclick/hud/parallax.dm | 13 +++++++++++-- code/_onclick/hud/plane_master.dm | 10 +++++++++- code/datums/weather/weather.dm | 2 +- code/modules/mob/dead/observer/observer.dm | 5 ++++- code/modules/mob/living/simple_animal/bot/bot.dm | 2 +- 5 files changed, 26 insertions(+), 6 deletions(-) diff --git a/code/_onclick/hud/parallax.dm b/code/_onclick/hud/parallax.dm index 813059af7a8..f2f1a6b8448 100644 --- a/code/_onclick/hud/parallax.dm +++ b/code/_onclick/hud/parallax.dm @@ -15,7 +15,13 @@ var/client/C = mymob.client if(!apply_parallax_pref()) return - + // this is needed so it blends properly with the space plane and blackness plane. + var/obj/screen/plane_master/space/S = plane_masters["[PLANE_SPACE]"] + S.color = list(1, 1, 1, 1, + 1, 1, 1, 1, + 1, 1, 1, 1, + 1, 1, 1, 1,) + S.appearance_flags |= NO_CLIENT_COLOR if(!length(C.parallax_layers_cached)) C.parallax_layers_cached = list() C.parallax_layers_cached += new /obj/screen/parallax_layer/layer_1(null, C.view) @@ -36,12 +42,15 @@ var/client/C = mymob.client C.screen -= (C.parallax_layers_cached + C.parallax_static_layers_tail) C.parallax_layers = null + var/obj/screen/plane_master/space/S = plane_masters["[PLANE_SPACE]"] + S.color = null + S.appearance_flags &= ~NO_CLIENT_COLOR /datum/hud/proc/apply_parallax_pref() var/client/C = mymob.client if(C.prefs) var/pref = C.prefs.parallax - if (isnull(pref)) + if(isnull(pref)) pref = PARALLAX_HIGH switch(C.prefs.parallax) if (PARALLAX_INSANE) diff --git a/code/_onclick/hud/plane_master.dm b/code/_onclick/hud/plane_master.dm index 2d650fb2e72..95bee94f6a9 100644 --- a/code/_onclick/hud/plane_master.dm +++ b/code/_onclick/hud/plane_master.dm @@ -85,4 +85,12 @@ name = "parallax plane master" plane = PLANE_SPACE_PARALLAX appearance_flags = PLANE_MASTER - blend_mode = BLEND_OVERLAY + blend_mode = BLEND_MULTIPLY + +/obj/screen/plane_master/blackness + name = "blackness plane master" + plane = BLACKNESS_PLANE + mouse_opacity = MOUSE_OPACITY_TRANSPARENT + color = list(null, null, null, "#0000", "#000f") + blend_mode = BLEND_ADD + appearance_flags = PLANE_MASTER | NO_CLIENT_COLOR | PIXEL_SCALE diff --git a/code/datums/weather/weather.dm b/code/datums/weather/weather.dm index a4295f8aeba..df5b0598799 100644 --- a/code/datums/weather/weather.dm +++ b/code/datums/weather/weather.dm @@ -28,7 +28,7 @@ var/impacted_z_levels // The list of z-levels that this weather is actively affecting var/overlay_layer = AREA_LAYER //Since it's above everything else, this is the layer used by default. TURF_LAYER is below mobs and walls if you need to use that. - var/overlay_plane = BLACKNESS_PLANE + var/overlay_plane = FLOOR_PLANE var/aesthetic = FALSE //If the weather has no purpose other than looks var/immunity_type = "storm" //Used by mobs to prevent them from being affected by the weather diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 80b4e1fe0b7..ba107e4acf0 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -11,6 +11,7 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER) icon = 'icons/mob/mob.dmi' icon_state = "ghost" layer = GHOST_LAYER + plane = GAME_PLANE stat = DEAD density = FALSE alpha = 127 @@ -90,6 +91,7 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER) toggle_all_huds_on(body) RegisterSignal(src, COMSIG_MOB_HUD_CREATED, .proc/set_ghost_darkness_level) //something something don't call this until we have a HUD ..() + plane = GAME_PLANE /mob/dead/observer/Destroy() toggle_all_huds_off() @@ -146,7 +148,8 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER) MA.icon = initial(icon) MA.icon_state = initial(icon_state) MA.underlays = COPY.underlays - + MA.layer = GHOST_LAYER + MA.plane = GAME_PLANE . = MA /mob/dead/CanPass(atom/movable/mover, turf/target, height=0) diff --git a/code/modules/mob/living/simple_animal/bot/bot.dm b/code/modules/mob/living/simple_animal/bot/bot.dm index f3a92ab8ea3..8c03d7239da 100644 --- a/code/modules/mob/living/simple_animal/bot/bot.dm +++ b/code/modules/mob/living/simple_animal/bot/bot.dm @@ -1075,7 +1075,7 @@ Pass a positive integer as an argument to override a bot's default speed. MA.icon = path_image_icon MA.icon_state = path_image_icon_state MA.layer = ABOVE_OPEN_TURF_LAYER - MA.plane = 0 + MA.plane = FLOOR_PLANE MA.appearance_flags = RESET_COLOR|RESET_TRANSFORM MA.color = path_image_color MA.dir = direction