allow COMSIG_ATOM_UPDATE_OVERLAY responders to add managed overlays directly (#29091)

This commit is contained in:
warriorstar-orion
2025-04-26 18:12:14 +00:00
committed by GitHub
parent fc9958dac8
commit 9e0f79358a
5 changed files with 11 additions and 30 deletions
+2 -17
View File
@@ -132,25 +132,10 @@
INVOKE_ASYNC(source, TYPE_PROC_REF(/obj/item/, update_slot_icon))
return ..()
/datum/element/decal/proc/apply_overlay(atom/source)
/datum/element/decal/proc/apply_overlay(atom/source, list/overlays)
SIGNAL_HANDLER // COMSIG_ATOM_UPDATE_OVERLAYS
source.add_overlay(pic)
// TODO: Fix this disgusting hack
//
// `COMSIG_ATOM_UPDATE_OVERLAYS` is sent at the end of
// /atom/proc/update_icon's stanza for updating overlays, instead
// somewhere useful, like, during it. /tg/ handles this by sending
// a list of overlays with the signal, allowing receivers to add to
// the list, instead of returning their own.
//
// This is much saner and more flexible, but would require refactoring
// many many uses of update_overlay() across the code base, which is left
// as an exercise for the next poor sap to touch this code (probably me).
if(source.managed_overlays && !islist(source.managed_overlays))
source.managed_overlays = list(source.managed_overlays, pic)
else
LAZYDISTINCTADD(source.managed_overlays, pic)
overlays += pic
/datum/element/decal/proc/clean_react(datum/source, clean_types)
SIGNAL_HANDLER // COMSIG_COMPONENT_CLEAN_ACT
+1 -1
View File
@@ -40,7 +40,7 @@
SIGNAL_HANDLER //COMSIG_ATOM_UPDATE_OVERLAYS
if(rust_overlay)
parent_atom.add_overlay(rust_overlay)
overlays += rust_overlay
/// Because do_after sleeps we register the signal here and defer via an async call
/datum/element/rust/proc/welder_tool_act(atom/source, obj/item/item, mob/user)