From 01a90030e7902338fb5147b1128f2ec8eee265f6 Mon Sep 17 00:00:00 2001 From: Kugamo Date: Sat, 23 Jul 2022 14:55:16 -0500 Subject: [PATCH] Fix photographing gradients (#18436) * Wahoo BLEND_INSET_OVERLAY doesnt actually change the alpha values of the icon overlayed, only how the show up on the thing overlayed onto. So the code in photography when taking the icons saved in the list of things overlayed of people itd show up as a box (since the icon wasnt being trimmed) * now works for multidirectional gradients!! WHOOPS * blah forgot to shift the actual gradient and not just the color, bruh * better organization * even better organization less proc calls B) * farie82 suggestions Co-authored-by: Farie82 Co-authored-by: Farie82 --- .../mob/living/carbon/human/update_icons.dm | 18 +++++++++++------- icons/mob/hair_gradients.dmi | Bin 1663 -> 1691 bytes 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index ad6e83e48ac..59c3abee990 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -385,13 +385,17 @@ GLOBAL_LIST_EMPTY(damage_icon_parts) // Gradient var/datum/sprite_accessory/hair_gradient/gradient = GLOB.hair_gradients_list[O.h_grad_style] if(gradient) - var/mutable_appearance/img_gradient = mutable_appearance(gradient.icon, gradient.icon_state) - img_gradient.alpha = O.h_grad_alpha - img_gradient.color = COLOR_MATRIX_OVERLAY(O.h_grad_colour) - img_gradient.pixel_x = O.h_grad_offset_x - img_gradient.pixel_y = O.h_grad_offset_y - img_gradient.blend_mode = BLEND_INSET_OVERLAY - MA.overlays += img_gradient + var/icon/icn_alpha_mask = icon(gradient.icon, gradient.icon_state) + var/icon/icn_gradient = icon(gradient.icon, "full") + var/list/icn_color = ReadRGB(O.h_grad_colour) + icn_gradient.MapColors(rgb(icn_color[1], 0, 0), rgb(0, icn_color[2], 0), rgb(0, 0, icn_color[3])) + icn_gradient.ChangeOpacity(O.h_grad_alpha / 255) + icn_gradient.AddAlphaMask(icn_alpha_mask) + icn_gradient.Shift(EAST, O.h_grad_offset_x) + icn_gradient.Shift(NORTH, O.h_grad_offset_y) + icn_gradient.AddAlphaMask(icon(hair.icon, "[hair.icon_state]_s")) + + MA.overlays += icn_gradient // Secondary style if(hair.secondary_theme) diff --git a/icons/mob/hair_gradients.dmi b/icons/mob/hair_gradients.dmi index d457ebf7d143801a2d255d646a465a0db6d3f91f..4491b323eb8d6329ffd3cd683a557a8c5fb71d2f 100644 GIT binary patch literal 1691 zcma)7Yfush5C#sFAQLY$O&LL~e556soS~_xAeiP^ijkD(n>w+=)HIXxRZbQ?gd#;L zHSH`g(zMKc;FC-xD=N+MO3lMZ+2I2tkLu6;xSQ_B?zi)OyE{8OJF~d~{zP5q8Yln& z&?WhJ1!_>BF&0EyA9S5Tp zmr@rgb5GzbED+c%eaC3>%MZ+udQ6WcwLuw-SRWz0@C3lkT+;_kz)o&Tqptih6a~fWC~?K^-#CWgqgQCS=*cX|xOw;!+V$T@Q2QZkTKLniuy2JWdmCJhVm+GlYD^pB z);5%R&ei$%qRFFnNqs1?H3!CfMFt0b*1Gkr8;;R)*TnXlsQt0Z6%*Qqe^XLY< zJsqmS(PX~2S@ow43nyipZ6QXq1FpjQ2?%AeQB-4KPONY_z4OJW*e+%5xVLiXmK{MJ z#^>rTCVKsK&pME>*kL0*><0rCy@UJB^sxEo>+3g!pI+yj@-(8=5?4Bxt0IsZ=~lrF zlW}*4EwNW;-&$_DDweg4op`C4a{lZJ9sMK6N9>0Wm-~wilnae2pDjsa_FR|#HcN_| zh~4yNDOgW`MnBc|VE(|qT|{{`@^vm(-`cGgS7mr@imR}^(2={VXWm5ikurH#rV5Q1 z+CwiGETXmsrLgBQPtMv)N6~5q-P@h+oKxAcN3Y${FWof(QI^l){>=XHs>l$0y}pDf zclGNxAdUpc)JUUyNMwkIdsPN2Obgfy1!b%PgKZ#?U^x8xzYEklWX*oE)k1J)2~)nH zW=IZGvd{uEMfdWu{G_OR>$QREx|rzs(Dr(eejhtEI;R{nwE7h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