diff --git a/code/datums/sprite_accessories.dm b/code/datums/sprite_accessories.dm index 2a5f3acc92d..012211b2421 100644 --- a/code/datums/sprite_accessories.dm +++ b/code/datums/sprite_accessories.dm @@ -85,6 +85,7 @@ ////////////////////// /datum/sprite_accessory/hair icon = 'icons/mob/human/human_face.dmi' // default icon for all hairs + var/y_offset = 0 // Y offset to apply so we can have hair that reaches above the player sprite's visual bounding box // please make sure they're sorted alphabetically and, where needed, categorized // try to capitalize the names please~ @@ -103,6 +104,11 @@ name = "Afro (Large)" icon_state = "hair_bigafro" +/datum/sprite_accessory/hair/afro_huge + name = "Afro (Huge)" + icon_state = "hair_hugeafro" + y_offset = 6 + /datum/sprite_accessory/hair/allthefuzz name = "All The Fuzz" icon_state = "hair_allthefuzz" diff --git a/code/modules/client/preferences/species_features/basic.dm b/code/modules/client/preferences/species_features/basic.dm index 6e34a234e7d..abf4ea0e44e 100644 --- a/code/modules/client/preferences/species_features/basic.dm +++ b/code/modules/client/preferences/species_features/basic.dm @@ -1,4 +1,4 @@ -/proc/generate_icon_with_head_accessory(datum/sprite_accessory/sprite_accessory) +/proc/generate_icon_with_head_accessory(datum/sprite_accessory/sprite_accessory, y_offset = 0) var/static/icon/head_icon if (isnull(head_icon)) head_icon = icon('icons/mob/human/bodyparts_greyscale.dmi', "human_head_m") @@ -7,8 +7,10 @@ var/icon/final_icon = new(head_icon) if (!isnull(sprite_accessory)) ASSERT(istype(sprite_accessory)) - + var/icon/head_accessory_icon = icon(sprite_accessory.icon, sprite_accessory.icon_state) + if(y_offset) + head_accessory_icon.Shift(NORTH, y_offset) head_accessory_icon.Blend(COLOR_DARK_BROWN, ICON_MULTIPLY) final_icon.Blend(head_accessory_icon, ICON_OVERLAY) @@ -138,7 +140,8 @@ return assoc_to_keys_features(GLOB.hairstyles_list) /datum/preference/choiced/hairstyle/icon_for(value) - return generate_icon_with_head_accessory(GLOB.hairstyles_list[value]) + var/datum/sprite_accessory/hair/hairstyle = GLOB.hairstyles_list[value] + return generate_icon_with_head_accessory(hairstyle, hairstyle?.y_offset) /datum/preference/choiced/hairstyle/apply_to_human(mob/living/carbon/human/target, value) target.set_hairstyle(value, update = FALSE) diff --git a/code/modules/clothing/head/wig.dm b/code/modules/clothing/head/wig.dm index b692c1383c5..4d3165f827c 100644 --- a/code/modules/clothing/head/wig.dm +++ b/code/modules/clothing/head/wig.dm @@ -25,7 +25,7 @@ item_flags &= ~EXAMINE_SKIP /obj/item/clothing/head/wig/update_icon_state() - var/datum/sprite_accessory/hair_style = GLOB.hairstyles_list[hairstyle] + var/datum/sprite_accessory/hair/hair_style = GLOB.hairstyles_list[hairstyle] if(hair_style) icon = hair_style.icon icon_state = hair_style.icon_state @@ -37,12 +37,13 @@ if(isinhands) return - var/datum/sprite_accessory/hair = GLOB.hairstyles_list[hairstyle] + var/datum/sprite_accessory/hair/hair = GLOB.hairstyles_list[hairstyle] if(!hair) return var/mutable_appearance/hair_overlay = mutable_appearance(hair.icon, hair.icon_state, layer = -HAIR_LAYER, appearance_flags = RESET_COLOR) hair_overlay.color = color + hair_overlay.pixel_y = hair.y_offset . += hair_overlay // So that the wig actually blocks emissives. diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 7b827b73d8e..b5d683a3d52 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -219,9 +219,8 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER) setDir(2 )//reset the dir to its default so the sprites all properly align up if(ghost_accs == GHOST_ACCS_FULL && (icon_state in GLOB.ghost_forms_with_accessories_list)) //check if this form supports accessories and if the client wants to show them - var/datum/sprite_accessory/S if(facial_hairstyle) - S = GLOB.facial_hairstyles_list[facial_hairstyle] + var/datum/sprite_accessory/S = GLOB.facial_hairstyles_list[facial_hairstyle] if(S) facial_hair_overlay = mutable_appearance(S.icon, "[S.icon_state]", -HAIR_LAYER) if(facial_hair_color) @@ -229,12 +228,13 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER) facial_hair_overlay.alpha = 200 add_overlay(facial_hair_overlay) if(hairstyle) - S = GLOB.hairstyles_list[hairstyle] + var/datum/sprite_accessory/hair/S = GLOB.hairstyles_list[hairstyle] if(S) hair_overlay = mutable_appearance(S.icon, "[S.icon_state]", -HAIR_LAYER) if(hair_color) hair_overlay.color = hair_color hair_overlay.alpha = 200 + hair_overlay.pixel_y = S.y_offset add_overlay(hair_overlay) /* diff --git a/code/modules/mob/living/basic/space_fauna/ghost.dm b/code/modules/mob/living/basic/space_fauna/ghost.dm index 35afaade990..ad79fefc3e6 100644 --- a/code/modules/mob/living/basic/space_fauna/ghost.dm +++ b/code/modules/mob/living/basic/space_fauna/ghost.dm @@ -71,10 +71,11 @@ ghost_facial_hair_color = ghost_hair_color if(!isnull(ghost_hairstyle) && ghost_hairstyle != "Bald") //Bald hairstyle and the Shaved facial hairstyle lack an associated sprite and will not properly generate hair, and just cause runtimes. - var/datum/sprite_accessory/hair_style = GLOB.hairstyles_list[ghost_hairstyle] //We use the hairstyle name to get the sprite accessory, which we copy the icon_state from. + var/datum/sprite_accessory/hair/hair_style = GLOB.hairstyles_list[ghost_hairstyle] //We use the hairstyle name to get the sprite accessory, which we copy the icon_state from. ghost_hair = mutable_appearance('icons/mob/human/human_face.dmi', "[hair_style.icon_state]", -HAIR_LAYER) ghost_hair.alpha = 200 ghost_hair.color = ghost_hair_color + ghost_hair.pixel_y = hair_style.y_offset add_overlay(ghost_hair) if(!isnull(ghost_facial_hairstyle) && ghost_facial_hairstyle != "Shaved") diff --git a/code/modules/surgery/bodyparts/_bodyparts.dm b/code/modules/surgery/bodyparts/_bodyparts.dm index 2e140bdbf26..e0af88845ca 100644 --- a/code/modules/surgery/bodyparts/_bodyparts.dm +++ b/code/modules/surgery/bodyparts/_bodyparts.dm @@ -934,8 +934,8 @@ icon_state = initial(icon_state)//no overlays found, we default back to initial icon. return for(var/image/img as anything in standing) - img.pixel_x = px_x - img.pixel_y = px_y + img.pixel_x += px_x + img.pixel_y += px_y add_overlay(standing) ///Generates an /image for the limb to be used as an overlay diff --git a/code/modules/surgery/bodyparts/head_hair_and_lips.dm b/code/modules/surgery/bodyparts/head_hair_and_lips.dm index 010ed9d1116..42960904b2f 100644 --- a/code/modules/surgery/bodyparts/head_hair_and_lips.dm +++ b/code/modules/surgery/bodyparts/head_hair_and_lips.dm @@ -119,11 +119,12 @@ var/image/hair_overlay if(!(show_debrained && (head_flags & HEAD_DEBRAIN)) && !hair_hidden && hairstyle && (head_flags & HEAD_HAIR)) - sprite_accessory = GLOB.hairstyles_list[hairstyle] - if(sprite_accessory) + var/datum/sprite_accessory/hair/hair_sprite_accessory = GLOB.hairstyles_list[hairstyle] + if(hair_sprite_accessory) //Overlay - hair_overlay = image(sprite_accessory.icon, sprite_accessory.icon_state, -HAIR_LAYER, image_dir) + hair_overlay = image(hair_sprite_accessory.icon, hair_sprite_accessory.icon_state, -HAIR_LAYER, image_dir) hair_overlay.alpha = hair_alpha + hair_overlay.pixel_y = hair_sprite_accessory.y_offset //Emissive blocker if(blocks_emissive != EMISSIVE_BLOCK_NONE) hair_overlay.overlays += emissive_blocker(hair_overlay.icon, hair_overlay.icon_state, location, alpha = hair_alpha) @@ -134,7 +135,7 @@ var/hair_gradient_style = LAZYACCESS(gradient_styles, GRADIENT_HAIR_KEY) if(hair_gradient_style) var/hair_gradient_color = LAZYACCESS(gradient_colors, GRADIENT_HAIR_KEY) - var/image/hair_gradient_overlay = get_gradient_overlay(sprite_accessory.icon, sprite_accessory.icon_state, -HAIR_LAYER, GLOB.hair_gradients_list[hair_gradient_style], hair_gradient_color) + var/image/hair_gradient_overlay = get_gradient_overlay(hair_sprite_accessory.icon, hair_sprite_accessory.icon_state, -HAIR_LAYER, GLOB.hair_gradients_list[hair_gradient_style], hair_gradient_color) . += hair_gradient_overlay if(show_debrained && (head_flags & HEAD_DEBRAIN)) diff --git a/icons/mob/human/human_face.dmi b/icons/mob/human/human_face.dmi index 6530b300aa6..886f0bf793b 100644 Binary files a/icons/mob/human/human_face.dmi and b/icons/mob/human/human_face.dmi differ