Skip to content

Commit

Permalink
[MIRROR] Fixed hair gradients not applying properly on dismembered he…
Browse files Browse the repository at this point in the history
…ads [MDB IGNORE] (#24585) (#292)

* Fixed hair gradients not applying properly on dismembered heads

* Update head_hair_and_lips.dm

---------

Co-authored-by: SkyratBot <[email protected]>
Co-authored-by: Cruix <[email protected]>
Co-authored-by: Giz <[email protected]>
Co-authored-by: Iajret <[email protected]>
  • Loading branch information
5 people authored Oct 25, 2023
1 parent 3b30487 commit d4d1727
Showing 1 changed file with 5 additions and 5 deletions.
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

0 comments on commit d4d1727

Please sign in to comment.