Fixes problems with multiple sources of alpha on humans (#25884)

* lets gooooo

* this too

* comments

* update code

* im so good

* tested, it works now

* Update code/game/dna/mutations/mutation_powers.dm

Co-authored-by: BiancaWilkson <42818125+BiancaWilkson@users.noreply.github.com>
Signed-off-by: Contrabang <91113370+Contrabang@users.noreply.github.com>

---------

Signed-off-by: Contrabang <91113370+Contrabang@users.noreply.github.com>
Co-authored-by: BiancaWilkson <42818125+BiancaWilkson@users.noreply.github.com>
This commit is contained in:
Contrabang
2024-09-26 14:06:44 -04:00
committed by GitHub
parent 5e3dad1289
commit ee6f73973e
11 changed files with 118 additions and 30 deletions
+8 -1
View File
@@ -292,13 +292,20 @@
RegisterSignal(user, COMSIG_CARBON_REGENERATE_ICONS, PROC_REF(reapply_hide))
mob_overlay = mutable_appearance(icon, icon_state, user.layer, user.plane, 255, appearance_flags = RESET_COLOR | RESET_TRANSFORM | RESET_ALPHA | KEEP_APART)
user.add_overlay(mob_overlay)
user.alpha = 0
if(ishuman(user))
var/mob/living/carbon/human/H = user
H.set_alpha_tracking(0, src)
else
user.alpha = 0
/// User has either dropped the plant, or plant is being destroyed, restore user to normal.
/obj/item/kirbyplants/proc/unhide_user(mob/living/carbon/user)
UnregisterSignal(user, COMSIG_CARBON_REGENERATE_ICONS)
user.cut_overlay(mob_overlay)
user.alpha = initial(user.alpha)
if(ishuman(user))
var/mob/living/carbon/human/H = user
H.set_alpha_tracking(ALPHA_VISIBLE, src)
QDEL_NULL(mob_overlay)
/// Icon operation has occured, time to make sure we're showing a plant again if we need to be.