From b7ca04b4769bb35bbc0d5aa7e038b8d55a05a235 Mon Sep 17 00:00:00 2001 From: Git-Nivrak <59925169+Git-Nivrak@users.noreply.github.com> Date: Fri, 23 Aug 2024 15:44:24 +0300 Subject: [PATCH 1/3] Update atoms_movable.dm --- code/game/atoms_movable.dm | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index 52a35b715b1a..2d26524811d4 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -97,28 +97,6 @@ if(light_system == DIRECTIONAL_LIGHT) AddComponent(/datum/component/overlay_lighting, is_directional = TRUE) -/* - -///Updates this movables emissive overlay -/atom/movable/proc/update_emissive_block() - if(!blocks_emissive) - return - else if (blocks_emissive == EMISSIVE_BLOCK_GENERIC) - var/mutable_appearance/gen_emissive_blocker = emissive_blocker(icon, icon_state, alpha = src.alpha, appearance_flags = src.appearance_flags) - gen_emissive_blocker.dir = dir - if(blocks_emissive == EMISSIVE_BLOCK_UNIQUE) - if(!em_block) - render_target = ref(src) - em_block = new(src, render_target) - return em_block - -/atom/movable/update_overlays() - . = ..() - - . += update_emissive_block() - -*/ - /atom/movable/vv_get_dropdown() . = ..() VV_DROPDOWN_OPTION(VV_HK_EDIT_PARTICLES, "Edit Particles") From a9d22851deef95d304eb1a369c59def60092f96b Mon Sep 17 00:00:00 2001 From: Git-Nivrak <59925169+Git-Nivrak@users.noreply.github.com> Date: Fri, 23 Aug 2024 15:43:38 +0300 Subject: [PATCH 2/3] fix --- code/game/atoms_movable.dm | 25 ++++++++++++++----- .../mob/new_player/preferences_setup.dm | 4 +++ 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index 2d26524811d4..2dc5a14654e6 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -31,6 +31,9 @@ ///Highest-intensity light affecting us, which determines our visibility. var/affecting_dynamic_lumi = 0 + /// Holds a reference to the emissive blocker overlay + var/emissive_overlay + //=========================================================================== /atom/movable/Destroy(force) for(var/atom/movable/I in contents) @@ -79,23 +82,33 @@ /atom/movable/Initialize(mapload, ...) . = ..() + + update_emissive_block() + + if(opacity) + AddElement(/datum/element/light_blocking) + if(light_system == MOVABLE_LIGHT) + AddComponent(/datum/component/overlay_lighting) + if(light_system == DIRECTIONAL_LIGHT) + AddComponent(/datum/component/overlay_lighting, is_directional = TRUE) + +/atom/movable/proc/update_emissive_block() + if(emissive_overlay) + overlays -= emissive_overlay + switch(blocks_emissive) if(EMISSIVE_BLOCK_GENERIC) var/mutable_appearance/gen_emissive_blocker = mutable_appearance(icon, icon_state, plane = EMISSIVE_PLANE, alpha = src.alpha) gen_emissive_blocker.color = GLOB.em_block_color gen_emissive_blocker.dir = dir gen_emissive_blocker.appearance_flags |= appearance_flags + emissive_overlay = gen_emissive_blocker overlays += gen_emissive_blocker if(EMISSIVE_BLOCK_UNIQUE) render_target = ref(src) em_block = new(src, render_target) + emissive_overlay = em_block overlays += list(em_block) - if(opacity) - AddElement(/datum/element/light_blocking) - if(light_system == MOVABLE_LIGHT) - AddComponent(/datum/component/overlay_lighting) - if(light_system == DIRECTIONAL_LIGHT) - AddComponent(/datum/component/overlay_lighting, is_directional = TRUE) /atom/movable/vv_get_dropdown() . = ..() diff --git a/code/modules/mob/new_player/preferences_setup.dm b/code/modules/mob/new_player/preferences_setup.dm index 4c2c83d18257..c11d07d64a23 100644 --- a/code/modules/mob/new_player/preferences_setup.dm +++ b/code/modules/mob/new_player/preferences_setup.dm @@ -188,6 +188,10 @@ var/J = job_pref_to_gear_preset() if(isnull(preview_dummy)) preview_dummy = new() + + preview_dummy.blocks_emissive = FALSE + preview_dummy.update_emissive_block() + clear_equipment() if(refresh_limb_status) for(var/obj/limb/L in preview_dummy.limbs) From 5f34601df6c153121be436a5159aff4921c63933 Mon Sep 17 00:00:00 2001 From: Git-Nivrak <59925169+Git-Nivrak@users.noreply.github.com> Date: Fri, 23 Aug 2024 17:08:44 +0300 Subject: [PATCH 3/3] Update atoms_movable.dm --- code/game/atoms_movable.dm | 1 + 1 file changed, 1 insertion(+) diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index 2dc5a14654e6..be68dddff10f 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -42,6 +42,7 @@ pulledby.stop_pulling() QDEL_NULL(launch_metadata) QDEL_NULL(em_block) + QDEL_NULL(emissive_overlay) if(loc) loc.on_stored_atom_del(src) //things that container need to do when a movable atom inside it is deleted