Skip to content

Commit

Permalink
[MIRROR] [NO GBP] Fixed hair gradients on hair with Y offsets [MDB IG…
Browse files Browse the repository at this point in the history
…NORE] (#24580)

* [NO GBP] Fixed hair gradients on hair with Y offsets

* Update head_hair_and_lips.dm

* Update head_hair_and_lips.dm

* These offsets should be additive

---------

Co-authored-by: Cruix <[email protected]>
Co-authored-by: Bloop <[email protected]>
  • Loading branch information
3 people authored and FFMirrorBot committed Oct 25, 2023
1 parent 9979993 commit 2bf72bd
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions code/modules/surgery/bodyparts/head_hair_and_lips.dm
Original file line number Diff line number Diff line change
Expand Up @@ -125,28 +125,28 @@
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
// SKYRAT ADD - Species hair offset
if(LAZYFIND(owner?.dna?.species?.offset_features, OFFSET_HAIR))
hair_overlay.pixel_x += owner.dna.species.offset_features[OFFSET_HAIR][INDEX_X]
hair_overlay.pixel_y += owner.dna.species.offset_features[OFFSET_HAIR][INDEX_Y]
// SKYRAT ADD END
//Emissive blocker
if(blocks_emissive != EMISSIVE_BLOCK_NONE)
hair_overlay.overlays += emissive_blocker(hair_overlay.icon, hair_overlay.icon_state, location, alpha = hair_alpha)
//Offsets
// SKYRAT ADD - Hair offset
if(LAZYFIND(owner?.dna?.species?.offset_features, OFFSET_HAIR))
hair_overlay.pixel_x = owner.dna.species.offset_features[OFFSET_HAIR][INDEX_X]
hair_overlay.pixel_y = owner.dna.species.offset_features[OFFSET_HAIR][INDEX_Y]
// SKYRAT ADD END
worn_face_offset?.apply_offset(hair_overlay)
. += hair_overlay
//Gradients
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)
// SKYRAT ADD - Hair offset
hair_gradient_overlay.pixel_y = hair_sprite_accessory.y_offset
// SKYRAT ADD - Species hair offset
if(LAZYFIND(owner?.dna?.species?.offset_features, OFFSET_HAIR))
hair_gradient_overlay.pixel_x = owner.dna.species.offset_features[OFFSET_HAIR][INDEX_X]
hair_gradient_overlay.pixel_y = owner.dna.species.offset_features[OFFSET_HAIR][INDEX_Y]
hair_gradient_overlay.pixel_x += owner.dna.species.offset_features[OFFSET_HAIR][INDEX_X]
hair_gradient_overlay.pixel_y += owner.dna.species.offset_features[OFFSET_HAIR][INDEX_Y]
// SKYRAT ADD END

. += hair_gradient_overlay

if(show_debrained && (head_flags & HEAD_DEBRAIN))
Expand Down

0 comments on commit 2bf72bd

Please sign in to comment.