From a32444dae73a3f35e1aec7a03acf95c66c91429b Mon Sep 17 00:00:00 2001 From: lukevale Date: Thu, 25 Mar 2021 14:57:06 -0500 Subject: [PATCH 1/4] gradient part 2, the fix --- code/modules/client/preferences_savefile.dm | 2 +- code/modules/mob/living/carbon/human/species.dm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/code/modules/client/preferences_savefile.dm b/code/modules/client/preferences_savefile.dm index 776951b4..56b3c7e3 100644 --- a/code/modules/client/preferences_savefile.dm +++ b/code/modules/client/preferences_savefile.dm @@ -482,7 +482,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car else hair_style = sanitize_inlist(hair_style, GLOB.hair_styles_female_list) facial_hair_style = sanitize_inlist(facial_hair_style, GLOB.facial_hair_styles_female_list) - grad_style = sanitize_inlist(grad_style, GLOB.hair_gradients) + grad_style = sanitize_inlist(grad_style, GLOB.hair_gradients, "None") underwear = sanitize_inlist(underwear, GLOB.underwear_list) undie_color = sanitize_hexcolor(undie_color, 3, 0, initial(undie_color)) undershirt = sanitize_inlist(undershirt, GLOB.undershirt_list) diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index b5949de3..766300e5 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -476,7 +476,7 @@ GLOBAL_LIST_EMPTY(roundstart_races) else grad_f_color = "#" + H.grad_color grad_s.Blend(grad_f_color, ICON_ADD) - hair_overlay.filters = filter(type="layer", icon = grad_s, blend_mode = BLEND_INSET_OVERLAY) + hair_overlay.filters = filter(type="layer", icon = grad_s, blend_mode = BLEND_MULTIPLY) if(hair_overlay.icon) standing += hair_overlay From c5d8bb5fb30d676b419514930cb981766c2ffeac Mon Sep 17 00:00:00 2001 From: lukevale Date: Thu, 25 Mar 2021 14:59:57 -0500 Subject: [PATCH 2/4] Revert "Revert "Hair_gradients part one."" This reverts commit 90c1e4193e3934467f3424089dce46688ddb1dc4. --- code/__HELPERS/global_lists.dm | 20 ++++++++++++++++++ code/modules/client/preferences.dm | 19 +++++++++++++++++ code/modules/client/preferences_savefile.dm | 6 ++++++ .../mob/living/carbon/human/human_defines.dm | 3 +++ .../mob/living/carbon/human/species.dm | 11 ++++++++++ icons/mob/hair_gradients.dmi | Bin 0 -> 2078 bytes 6 files changed, 59 insertions(+) create mode 100644 icons/mob/hair_gradients.dmi diff --git a/code/__HELPERS/global_lists.dm b/code/__HELPERS/global_lists.dm index c4e53366..cab2c536 100644 --- a/code/__HELPERS/global_lists.dm +++ b/code/__HELPERS/global_lists.dm @@ -88,6 +88,22 @@ init_subtypes(/datum/crafting_recipe, GLOB.crafting_recipes) + //gradients +GLOBAL_LIST_INIT(hair_gradients, list( + "None" = "none", + "Fade (Up)" = "fadeup", + "Fade (Down)" = "fadedown", + "Fade Low (Up)" = "fadeup_low", + "Bottom Flat" = "bottomflat", + "Fade Low (Down)" = "fadedown_low", + "Vertical Split" = "vsplit", + "Reflected" = "reflected", + "Reflected (Inverted)" = "reflected_inverse", + "Reflected High" = "reflected_high", + "Reflected High (Inverted)" = "reflected_inverse_high", + "Wavy" = "wavy" + )) + //creates every subtype of prototype (excluding prototype) and adds it to list L. //if no list/L is provided, one is created. /proc/init_subtypes(prototype, list/L) @@ -105,3 +121,7 @@ for(var/path in subtypesof(prototype)) L+= path return L + + +//hair gradient list. Since it shouldn't need to have a seperate datum list.sanitize_inlist + diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index 1e447659..9ec0d7ef 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -92,6 +92,8 @@ GLOBAL_LIST_EMPTY(preferences_datums) var/hair_color = "000" //Hair color var/facial_hair_style = "Shaved" //Face hair type var/facial_hair_color = "000" //Facial hair color + var/grad_style = "None" //Hair Gradient style + var/grad_color = "#000000" //Hair Gradient color var/skin_tone = "caucasian1" //Skin color var/eye_color = "000" //Eye color var/wing_color = "fff" //Wing color @@ -472,6 +474,9 @@ GLOBAL_LIST_EMPTY(preferences_datums) dat += "[hair_style]" dat += "< >
" dat += "    Change
" + dat += "

Hair Gradiant

" + dat += "[grad_style]" + dat += "    Change
" dat += "

Facial Hair Style

" @@ -1747,6 +1752,18 @@ GLOBAL_LIST_EMPTY(preferences_datums) if(hair_style == "Tail Hair" && clientckey <> "quotefox") hair_style = "Bald" + if("grad_style") + var/new_grad_style + new_grad_style = input(user, "Choose your character's hair gradiant:", "Character Preference") as null|anything in GLOB.hair_gradients + if(new_grad_style) + grad_style = new_grad_style + + if("grad") + var/new_grad + new_grad = input(user, "Choose your character's gradiant color:", "Character Preference", new_grad) as color|null + if(new_grad) + grad_color = sanitize_hexcolor(new_grad) + if("facial") var/new_facial = input(user, "Choose your character's facial-hair colour:", "Character Preference","#"+facial_hair_color) as color|null if(new_facial) @@ -2703,11 +2720,13 @@ GLOBAL_LIST_EMPTY(preferences_datums) organ_eyes.old_eye_color = eye_color character.hair_color = hair_color character.facial_hair_color = facial_hair_color + character.grad_color = grad_color character.wing_color = wing_color character.skin_tone = skin_tone character.hair_style = hair_style character.facial_hair_style = facial_hair_style + character.grad_style = grad_style character.underwear = underwear character.saved_underwear = underwear diff --git a/code/modules/client/preferences_savefile.dm b/code/modules/client/preferences_savefile.dm index 1507f830..776951b4 100644 --- a/code/modules/client/preferences_savefile.dm +++ b/code/modules/client/preferences_savefile.dm @@ -311,10 +311,12 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car S["body_size"] >> body_size S["hair_color"] >> hair_color S["facial_hair_color"] >> facial_hair_color + S["grad_color"] >> grad_color S["eye_color"] >> eye_color S["skin_tone"] >> skin_tone S["hair_style_name"] >> hair_style S["facial_style_name"] >> facial_hair_style + S["grad_style_name"] >> grad_style S["underwear"] >> underwear S["undie_color"] >> undie_color S["undershirt"] >> undershirt @@ -480,6 +482,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car else hair_style = sanitize_inlist(hair_style, GLOB.hair_styles_female_list) facial_hair_style = sanitize_inlist(facial_hair_style, GLOB.facial_hair_styles_female_list) + grad_style = sanitize_inlist(grad_style, GLOB.hair_gradients) underwear = sanitize_inlist(underwear, GLOB.underwear_list) undie_color = sanitize_hexcolor(undie_color, 3, 0, initial(undie_color)) undershirt = sanitize_inlist(undershirt, GLOB.undershirt_list) @@ -489,6 +492,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car age = sanitize_integer(age, AGE_MIN, AGE_MAX, initial(age)) hair_color = sanitize_hexcolor(hair_color, 3, 0) facial_hair_color = sanitize_hexcolor(facial_hair_color, 3, 0) + grad_color = sanitize_hexcolor(grad_color, 6, 1) eye_color = sanitize_hexcolor(eye_color, 3, 0) skin_tone = sanitize_inlist(skin_tone, GLOB.skin_tones) wing_color = sanitize_hexcolor(wing_color, 3, FALSE, "#FFFFFF") @@ -558,10 +562,12 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car WRITE_FILE(S["age"] , age) WRITE_FILE(S["hair_color"] , hair_color) WRITE_FILE(S["facial_hair_color"] , facial_hair_color) + WRITE_FILE(S["grad_color"] , grad_color) WRITE_FILE(S["eye_color"] , eye_color) WRITE_FILE(S["skin_tone"] , skin_tone) WRITE_FILE(S["hair_style_name"] , hair_style) WRITE_FILE(S["facial_style_name"] , facial_hair_style) + WRITE_FILE(S["grad_style_name"] , grad_style) WRITE_FILE(S["underwear"] , underwear) WRITE_FILE(S["body_size"] , body_size) WRITE_FILE(S["undie_color"] , undie_color) diff --git a/code/modules/mob/living/carbon/human/human_defines.dm b/code/modules/mob/living/carbon/human/human_defines.dm index fd9fdcb5..bc429365 100644 --- a/code/modules/mob/living/carbon/human/human_defines.dm +++ b/code/modules/mob/living/carbon/human/human_defines.dm @@ -14,6 +14,9 @@ var/facial_hair_color = "000" var/facial_hair_style = "Shaved" + var/grad_style = "none" + var/grad_color = "#000000" + //Eye colour var/eye_color = "000" diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index 9b457213..b5949de3 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -15,6 +15,7 @@ GLOBAL_LIST_EMPTY(roundstart_races) var/hair_color // this allows races to have specific hair colors... if null, it uses the H's hair/facial hair colors. if "mutcolor", it uses the H's mutant_color var/hair_alpha = 255 // the alpha used by the hair. 255 is completely solid, 0 is transparent. var/wing_color + var/grad_color var/use_skintones = 0 // does it use skintones or not? (spoiler alert this is only used by humans) var/exotic_blood = "" // If your race wants to bleed something other than bog standard blood, change this to reagent id. @@ -467,6 +468,16 @@ GLOBAL_LIST_EMPTY(roundstart_races) if(OFFSET_FACE in H.dna.species.offset_features) hair_overlay.pixel_x += H.dna.species.offset_features[OFFSET_FACE][1] hair_overlay.pixel_y += H.dna.species.offset_features[OFFSET_FACE][2] + if(H.grad_style) + var/icon/grad_s = new/icon("icon" = 'icons/mob/hair_gradients.dmi', "icon_state" = GLOB.hair_gradients[H.grad_style]) + var/grad_f_color = null + if(grad_color) + grad_f_color = "#" + grad_color + else + grad_f_color = "#" + H.grad_color + grad_s.Blend(grad_f_color, ICON_ADD) + hair_overlay.filters = filter(type="layer", icon = grad_s, blend_mode = BLEND_INSET_OVERLAY) + if(hair_overlay.icon) standing += hair_overlay diff --git a/icons/mob/hair_gradients.dmi b/icons/mob/hair_gradients.dmi new file mode 100644 index 0000000000000000000000000000000000000000..1a3c330355e440666270dbd378f7e459fbdc091a GIT binary patch literal 2078 zcma)7dpOgJ8~@H0LrkM)ZV`z@N0&m}9-ig->w`9eL7Lou6~w{O^=p?m{5sVgKu;4a8-kE zl~f-xIIJH?{@(N}zT~6B!t>-*yd!g&yc@%f=GcM5cwjY{yg=8)SJfy6|*FfCHB@6a^a19Lgbz8 zvKrH|D7`nt>28dsGmcw220wEEyh-o*NUDy0wl{X9XyU% z&K%WL^unY5*;Y+9q@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@A;^vm~#TD!Q4w9$LzB@2dP_UPWp9MHLVJ?T=0%o<%9dHpLk_pn{s7$U)3~5 zj5wJK&QA*2xLI){4jJn_t7&w`D1R9f6>D-J*~oISPqV;9uF*Pk(+|?nki#oavW`9* zs5zetp~Fx$y>p;p<+RC595|4q6_BE+Un-WVmsW@`ab~aQK|*(|6CAu{NZXz^DO2~o f#KG4X(qwYoPpw279+Y~lKYYLq?d8;j!l(ZacJ$Xb literal 0 HcmV?d00001 From bbd60b8c0f7ee5a921eea4c65046a92597b82e54 Mon Sep 17 00:00:00 2001 From: lukevale Date: Thu, 25 Mar 2021 15:01:31 -0500 Subject: [PATCH 3/4] the fixening or something --- code/modules/client/preferences_savefile.dm | 2 +- code/modules/mob/living/carbon/human/species.dm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/code/modules/client/preferences_savefile.dm b/code/modules/client/preferences_savefile.dm index 776951b4..56b3c7e3 100644 --- a/code/modules/client/preferences_savefile.dm +++ b/code/modules/client/preferences_savefile.dm @@ -482,7 +482,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car else hair_style = sanitize_inlist(hair_style, GLOB.hair_styles_female_list) facial_hair_style = sanitize_inlist(facial_hair_style, GLOB.facial_hair_styles_female_list) - grad_style = sanitize_inlist(grad_style, GLOB.hair_gradients) + grad_style = sanitize_inlist(grad_style, GLOB.hair_gradients, "None") underwear = sanitize_inlist(underwear, GLOB.underwear_list) undie_color = sanitize_hexcolor(undie_color, 3, 0, initial(undie_color)) undershirt = sanitize_inlist(undershirt, GLOB.undershirt_list) diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index b5949de3..766300e5 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -476,7 +476,7 @@ GLOBAL_LIST_EMPTY(roundstart_races) else grad_f_color = "#" + H.grad_color grad_s.Blend(grad_f_color, ICON_ADD) - hair_overlay.filters = filter(type="layer", icon = grad_s, blend_mode = BLEND_INSET_OVERLAY) + hair_overlay.filters = filter(type="layer", icon = grad_s, blend_mode = BLEND_MULTIPLY) if(hair_overlay.icon) standing += hair_overlay From 6c2ca26e86dab4a513d55ecb6986689b095444bd Mon Sep 17 00:00:00 2001 From: lukevale Date: Thu, 25 Mar 2021 16:56:29 -0500 Subject: [PATCH 4/4] final touches. --- code/__HELPERS/global_lists.dm | 4 ++-- code/modules/mob/living/carbon/human/species.dm | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/code/__HELPERS/global_lists.dm b/code/__HELPERS/global_lists.dm index cab2c536..dddf2ed6 100644 --- a/code/__HELPERS/global_lists.dm +++ b/code/__HELPERS/global_lists.dm @@ -96,12 +96,12 @@ GLOBAL_LIST_INIT(hair_gradients, list( "Fade Low (Up)" = "fadeup_low", "Bottom Flat" = "bottomflat", "Fade Low (Down)" = "fadedown_low", - "Vertical Split" = "vsplit", "Reflected" = "reflected", "Reflected (Inverted)" = "reflected_inverse", "Reflected High" = "reflected_high", "Reflected High (Inverted)" = "reflected_inverse_high", - "Wavy" = "wavy" + "Wavy" = "wavy", + "Color Test" = "vsplit" )) //creates every subtype of prototype (excluding prototype) and adds it to list L. diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index 766300e5..77f3f806 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -468,7 +468,7 @@ GLOBAL_LIST_EMPTY(roundstart_races) if(OFFSET_FACE in H.dna.species.offset_features) hair_overlay.pixel_x += H.dna.species.offset_features[OFFSET_FACE][1] hair_overlay.pixel_y += H.dna.species.offset_features[OFFSET_FACE][2] - if(H.grad_style) + if(H.grad_style ~! "none") var/icon/grad_s = new/icon("icon" = 'icons/mob/hair_gradients.dmi', "icon_state" = GLOB.hair_gradients[H.grad_style]) var/grad_f_color = null if(grad_color) @@ -477,6 +477,7 @@ GLOBAL_LIST_EMPTY(roundstart_races) grad_f_color = "#" + H.grad_color grad_s.Blend(grad_f_color, ICON_ADD) hair_overlay.filters = filter(type="layer", icon = grad_s, blend_mode = BLEND_MULTIPLY) + qdel(grad_s) if(hair_overlay.icon) standing += hair_overlay