Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MIRROR] Fixed hair gradients not applying properly on dismembered heads #292

Merged
merged 2 commits into from
Oct 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions code/modules/surgery/bodyparts/head_hair_and_lips.dm
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
var/facial_hair_gradient_style = LAZYACCESS(gradient_styles, GRADIENT_FACIAL_HAIR_KEY)
if(facial_hair_gradient_style)
var/facial_hair_gradient_color = LAZYACCESS(gradient_colors, GRADIENT_FACIAL_HAIR_KEY)
var/image/facial_hair_gradient_overlay = get_gradient_overlay(sprite_accessory.icon, sprite_accessory.icon_state, -HAIR_LAYER, GLOB.facial_hair_gradients_list[facial_hair_gradient_style], facial_hair_gradient_color)
var/image/facial_hair_gradient_overlay = get_gradient_overlay(sprite_accessory.icon, sprite_accessory.icon_state, -HAIR_LAYER, GLOB.facial_hair_gradients_list[facial_hair_gradient_style], facial_hair_gradient_color, image_dir)
. += facial_hair_gradient_overlay

var/image/hair_overlay
Expand All @@ -140,7 +140,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(hair_sprite_accessory.icon, hair_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, image_dir)
hair_gradient_overlay.pixel_y = hair_sprite_accessory.y_offset
// SKYRAT ADD - Species hair offset
if(LAZYFIND(owner?.dna?.species?.offset_features, OFFSET_HAIR))
Expand Down Expand Up @@ -209,12 +209,12 @@
return eyeless_overlay

/// Returns an appropriate hair/facial hair gradient overlay
/obj/item/bodypart/head/proc/get_gradient_overlay(file, icon, layer, datum/sprite_accessory/gradient, grad_color)
/obj/item/bodypart/head/proc/get_gradient_overlay(file, icon, layer, datum/sprite_accessory/gradient, grad_color, image_dir)
RETURN_TYPE(/mutable_appearance)

var/mutable_appearance/gradient_overlay = mutable_appearance(layer = layer)
var/icon/temp = icon(gradient.icon, gradient.icon_state)
var/icon/temp_hair = icon(file, icon)
var/icon/temp = icon(gradient.icon, gradient.icon_state, image_dir)
var/icon/temp_hair = icon(file, icon, image_dir)
temp.Blend(temp_hair, ICON_ADD)
gradient_overlay.icon = temp
gradient_overlay.color = grad_color
Expand Down
Loading