Files
Bubberstation/code/datums/elements/update_icon_blocker.dm
MrPerson e22560a346 update_icon() improvements (#48669)
* update_icon() improvements

Fixes some update_icon() calls to properly call parent and use update_overlays() and update_icon_state().

The rest of obj/item fuck it

* Suggested fixes, also passes the linter

* I always forget . = ..() is faster than return ..() FOR SOME FUCKING REASON

* Actually this is better

* Signilzes datum/action to update its icon when its connected item does.
2020-01-11 23:46:43 -05:00

11 lines
425 B
Plaintext

//Prevents calling anything in update_icon() like update_icon_state() or update_overlays()
/datum/element/update_icon_blocker/Attach(datum/target)
. = ..()
if(!istype(target, /atom))
return ELEMENT_INCOMPATIBLE
RegisterSignal(target, COMSIG_ATOM_UPDATE_ICON, .proc/block_update_icon)
/datum/element/update_icon_blocker/proc/block_update_icon()
return COMSIG_ATOM_NO_UPDATE_ICON_STATE | COMSIG_ATOM_NO_UPDATE_OVERLAYS