From ef92dbcee30120c6fbe75843f7453a9c0f8b69ed Mon Sep 17 00:00:00 2001 From: The Sharkening <95130227+StrangeWeirdKitten@users.noreply.github.com> Date: Thu, 25 Jun 2026 13:17:21 -0600 Subject: [PATCH] Fixes hair not changing on protean transformation (#5837) --- .../mob/living/carbon/carbon_update_icons.dm | 2 - .../code/datums/components/transformation.dm | 48 +++++++++++-------- .../species/proteans/protean_ui.dm | 1 + 3 files changed, 30 insertions(+), 21 deletions(-) diff --git a/code/modules/mob/living/carbon/carbon_update_icons.dm b/code/modules/mob/living/carbon/carbon_update_icons.dm index dd401d18b5b..5cb86f616a6 100644 --- a/code/modules/mob/living/carbon/carbon_update_icons.dm +++ b/code/modules/mob/living/carbon/carbon_update_icons.dm @@ -462,8 +462,6 @@ var/head_update = FALSE var/list/new_limbs = list() var/datum/component/transformation/transform = GetComponent(/datum/component/transformation) // BUBBER EDIT START - Transformation component override. - if(transform) - transform.on_transform_limb_icon(src) for(var/body_zone, limb_untyped in transform ? transform.dummy.get_bodyparts_by_zones() : get_bodyparts_by_zones()) // BUBBER EDIT END | ORG: for(var/body_zone, limb_untyped in get_bodyparts_by_zones()) var/obj/item/bodypart/limb = limb_untyped var/obj/item/bodypart/stump_limb_check = get_bodypart(body_zone, TRUE) // BUBBER EDIT START diff --git a/modular_zubbers/code/datums/components/transformation.dm b/modular_zubbers/code/datums/components/transformation.dm index ffcdcc14427..30ac2a8b7aa 100644 --- a/modular_zubbers/code/datums/components/transformation.dm +++ b/modular_zubbers/code/datums/components/transformation.dm @@ -83,15 +83,24 @@ owner.quad_eyes_offset = original.quad_eyes_offset owner.quad_eyes_offset_width = original.quad_eyes_offset_width - var/obj/item/bodypart/head/head = original.get_bodypart(BODY_ZONE_HEAD) - dummy.set_hairstyle(original.hairstyle, FALSE) - dummy.set_haircolor(original.hair_color) - dummy.set_facial_hairstyle(original.facial_hairstyle, FALSE) - dummy.set_facial_haircolor(original.facial_hair_color) - dummy.set_hair_gradient_style(head.gradient_styles[GRADIENT_HAIR_KEY], FALSE) - dummy.set_hair_gradient_color(head.gradient_colors[GRADIENT_FACIAL_HAIR_KEY]) - dummy.set_facial_hair_gradient_style(head.gradient_styles[GRADIENT_FACIAL_HAIR_KEY], FALSE) - dummy.set_facial_hair_gradient_color(head.gradient_colors[GRADIENT_FACIAL_HAIR_KEY]) + cached_features["hair"] += list( + "hair_style" = owner.hairstyle, + "hair_color" = owner.hair_color, + "facial_style" = owner.facial_hairstyle, + "facial_color" = owner.facial_hair_color, + "hair_gradient_style" = owner.get_hair_gradient_style(GRADIENT_HAIR_KEY), + "hair_gradient_color" = owner.get_hair_gradient_color(GRADIENT_HAIR_KEY), + "facial_gradient_style" = owner.get_hair_gradient_style(GRADIENT_FACIAL_HAIR_KEY), + "facial_gradient_color" = owner.get_hair_gradient_color(GRADIENT_FACIAL_HAIR_KEY)) + + owner.set_hairstyle(original.hairstyle, FALSE) + owner.set_haircolor(original.hair_color) + owner.set_facial_hairstyle(original.facial_hairstyle, FALSE) + owner.set_facial_haircolor(original.facial_hair_color) + owner.set_hair_gradient_style(original.get_hair_gradient_style(GRADIENT_HAIR_KEY), FALSE) + owner.set_hair_gradient_color(original.get_hair_gradient_color(GRADIENT_HAIR_KEY)) + owner.set_facial_hair_gradient_style(original.get_hair_gradient_style(GRADIENT_FACIAL_HAIR_KEY), FALSE) + owner.set_facial_hair_gradient_color(original.get_hair_gradient_color(GRADIENT_FACIAL_HAIR_KEY)) owner.regenerate_icons() @@ -123,20 +132,21 @@ owner.quad_eyes_offset = cached_features["quadoffset"] owner.quad_eyes_offset_width = cached_features["quadoffwidth"] + // Reset our hair + var/list/hair = cached_features["hair"] + owner.set_hairstyle(hair["hair_style"], FALSE) + owner.set_haircolor(hair["hair_color"]) + owner.set_facial_hairstyle(hair["facial_style"], FALSE) + owner.set_facial_haircolor(hair["facial_color"]) + owner.set_hair_gradient_style(hair["hair_gradient_style"], FALSE) + owner.set_hair_gradient_color(hair["hair_gradient_color"]) + owner.set_facial_hair_gradient_style(hair["facial_gradient_style"], FALSE) + owner.set_facial_hair_gradient_color(hair["facial_gradient_color"]) + original = null QDEL_NULL(dummy) owner.regenerate_icons() -/// TODO: Digigrade legs and bodyshape -/datum/component/transformation/proc/on_transform_limb_icon(mob/source) // Easy way to properly reflect icon events. - var/mob/living/carbon/human/owner = source - var/list/old_abstractions = dummy.get_equipped_items() - QDEL_LIST(old_abstractions) - for(var/obj/item/item in owner.get_equipped_items()) - if(item.slot_flags & (ITEM_SLOT_ICLOTHING|ITEM_SLOT_OCLOTHING|ITEM_SLOT_HEAD|ITEM_SLOT_BACK)) - var/obj/item/abstraction = new item.type - abstraction.flags_inv = item.flags_inv - abstraction.equip_to_best_slot(dummy) diff --git a/modular_zubbers/code/modules/customization/species/proteans/protean_ui.dm b/modular_zubbers/code/modules/customization/species/proteans/protean_ui.dm index 13a997695f6..2d42c519190 100644 --- a/modular_zubbers/code/modules/customization/species/proteans/protean_ui.dm +++ b/modular_zubbers/code/modules/customization/species/proteans/protean_ui.dm @@ -43,6 +43,7 @@ var/component = species_modsuit.wearer?.GetComponent(/datum/component/transformation) if(component) playsound(owner, 'sound/machines/click.ogg', 25) + UnregisterSignal(species_modsuit, COMSIG_ITEM_PRE_UNEQUIP) qdel(component) else if(species_modsuit.wearer == owner) to_chat(owner, span_notice("You already look like yourself!"))