mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-24 12:37:26 +01:00
allow COMSIG_ATOM_UPDATE_OVERLAY responders to add managed overlays directly (#29091)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user