mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-02-06 22:39:04 +00:00
* 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.
17 lines
582 B
Plaintext
17 lines
582 B
Plaintext
//update_icon() may change the onmob icons
|
|
//Very good name, I know
|
|
|
|
/datum/element/update_icon_updates_onmob/Attach(datum/target)
|
|
. = ..()
|
|
if(!istype(target, /obj/item))
|
|
return ELEMENT_INCOMPATIBLE
|
|
RegisterSignal(target, COMSIG_ATOM_UPDATED_ICON, .proc/update_onmob)
|
|
|
|
/datum/element/update_icon_updates_onmob/proc/update_onmob(obj/item/target)
|
|
if(ismob(target.loc))
|
|
var/mob/M = target.loc
|
|
if(M.is_holding(target))
|
|
M.update_inv_hands()
|
|
else
|
|
M.regenerate_icons() //yeah this is shit, but we don't know which update_foo() proc to call instead so we'll call them all
|