diff --git a/code/modules/client/preference_setup/general/03_body.dm b/code/modules/client/preference_setup/general/03_body.dm index e482079550..dfd1f45716 100644 --- a/code/modules/client/preference_setup/general/03_body.dm +++ b/code/modules/client/preference_setup/general/03_body.dm @@ -16,6 +16,9 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O S["hair_green"] >> pref.g_hair S["hair_blue"] >> pref.b_hair S["facial_red"] >> pref.r_facial + S["grad_red"] >> pref.r_grad + S["grad_green"] >> pref.g_grad + S["grad_blue"] >> pref.b_grad S["facial_green"] >> pref.g_facial S["facial_blue"] >> pref.b_facial S["skin_tone"] >> pref.s_tone @@ -24,6 +27,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O S["skin_blue"] >> pref.b_skin S["hair_style_name"] >> pref.h_style S["facial_style_name"] >> pref.f_style + S["grad_style_name"] >> pref.grad_style S["eyes_red"] >> pref.r_eyes S["eyes_green"] >> pref.g_eyes S["eyes_blue"] >> pref.b_eyes @@ -45,6 +49,9 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O S["hair_red"] << pref.r_hair S["hair_green"] << pref.g_hair S["hair_blue"] << pref.b_hair + S["grad_red"] >> pref.r_grad + S["grad_green"] >> pref.g_grad + S["grad_blue"] >> pref.b_grad S["facial_red"] << pref.r_facial S["facial_green"] << pref.g_facial S["facial_blue"] << pref.b_facial @@ -54,6 +61,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O S["skin_blue"] << pref.b_skin S["hair_style_name"] << pref.h_style S["facial_style_name"] << pref.f_style + S["grad_style_name"] << pref.grad_style S["eyes_red"] << pref.r_eyes S["eyes_green"] << pref.g_eyes S["eyes_blue"] << pref.b_eyes @@ -76,6 +84,9 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O pref.r_hair = sanitize_integer(pref.r_hair, 0, 255, initial(pref.r_hair)) pref.g_hair = sanitize_integer(pref.g_hair, 0, 255, initial(pref.g_hair)) pref.b_hair = sanitize_integer(pref.b_hair, 0, 255, initial(pref.b_hair)) + pref.r_grad = sanitize_integer(pref.r_grad, 0, 255, initial(pref.r_grad)) + pref.g_grad = sanitize_integer(pref.g_grad, 0, 255, initial(pref.g_grad)) + pref.b_grad = sanitize_integer(pref.b_grad, 0, 255, initial(pref.b_grad)) pref.r_facial = sanitize_integer(pref.r_facial, 0, 255, initial(pref.r_facial)) pref.g_facial = sanitize_integer(pref.g_facial, 0, 255, initial(pref.g_facial)) pref.b_facial = sanitize_integer(pref.b_facial, 0, 255, initial(pref.b_facial)) @@ -85,6 +96,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O pref.b_skin = sanitize_integer(pref.b_skin, 0, 255, initial(pref.b_skin)) pref.h_style = sanitize_inlist(pref.h_style, hair_styles_list, initial(pref.h_style)) pref.f_style = sanitize_inlist(pref.f_style, facial_hair_styles_list, initial(pref.f_style)) + pref.grad_style = sanitize_inlist(pref.grad_style, GLOB.hair_gradients, initial(pref.grad_style)) pref.r_eyes = sanitize_integer(pref.r_eyes, 0, 255, initial(pref.r_eyes)) pref.g_eyes = sanitize_integer(pref.g_eyes, 0, 255, initial(pref.g_eyes)) pref.b_eyes = sanitize_integer(pref.b_eyes, 0, 255, initial(pref.b_eyes)) @@ -108,6 +120,9 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O character.r_hair = pref.r_hair character.g_hair = pref.g_hair character.b_hair = pref.b_hair + character.r_grad = pref.r_grad + character.g_grad = pref.g_grad + character.b_grad = pref.b_grad character.f_style = pref.f_style character.r_facial = pref.r_facial character.g_facial = pref.g_facial @@ -118,6 +133,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O character.s_tone = pref.s_tone character.h_style = pref.h_style character.f_style = pref.f_style + character.grad_style= pref.grad_style character.b_type = pref.b_type character.synth_color = pref.synth_color character.r_synth = pref.r_synth @@ -319,6 +335,10 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O . += "Change Color [color_square(pref.r_hair, pref.g_hair, pref.b_hair)] " . += " Style: < > [pref.h_style]
" //The < & > in this line is correct-- those extra characters are the arrows you click to switch between styles. + . += "Gradient
" + . += "Change Color [color_square(pref.r_grad, pref.g_grad, pref.b_grad)] " + . += " Style: < > [pref.grad_style]
" + . += "
Facial
" if(has_flag(mob_species, HAS_HAIR_COLOR)) . += "Change Color [color_square(pref.r_facial, pref.g_facial, pref.b_facial)] " @@ -445,6 +465,16 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O pref.b_hair = hex2num(copytext(new_hair, 6, 8)) return TOPIC_REFRESH_UPDATE_PREVIEW + else if(href_list["grad_color"]) + if(!has_flag(mob_species, HAS_HAIR_COLOR)) + return TOPIC_NOACTION + var/new_grad = input(user, "Choose your character's secondary hair color:", "Character Preference", rgb(pref.r_grad, pref.g_grad, pref.b_grad)) as color|null + if(new_grad && has_flag(mob_species, HAS_HAIR_COLOR) && CanUseTopic(user)) + pref.r_grad = hex2num(copytext(new_grad, 2, 4)) + pref.g_grad = hex2num(copytext(new_grad, 4, 6)) + pref.b_grad = hex2num(copytext(new_grad, 6, 8)) + return TOPIC_REFRESH_UPDATE_PREVIEW + else if(href_list["hair_style"]) var/list/valid_hairstyles = pref.get_valid_hairstyles() @@ -453,6 +483,14 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O pref.h_style = new_h_style return TOPIC_REFRESH_UPDATE_PREVIEW + else if(href_list["grad_style"]) + var/list/valid_gradients = GLOB.hair_gradients + + var/new_grad_style = input(user, "Choose a color pattern for your hair:", "Character Preference", pref.grad_style) as null|anything in valid_gradients + if(new_grad_style && CanUseTopic(user)) + pref.grad_style = new_grad_style + return TOPIC_REFRESH_UPDATE_PREVIEW + else if(href_list["hair_style_left"]) var/H = href_list["hair_style_left"] var/list/valid_hairstyles = pref.get_valid_hairstyles() diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index b7a0262793..1c1e1fc44b 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -37,6 +37,10 @@ datum/preferences var/r_hair = 0 //Hair color var/g_hair = 0 //Hair color var/b_hair = 0 //Hair color + var/grad_style = "none" //Gradient style + var/r_grad = 0 //Gradient color + var/g_grad = 0 //Gradient color + var/b_grad = 0 //Gradient color var/f_style = "Shaved" //Face hair type var/r_facial = 0 //Face hair color var/g_facial = 0 //Face hair color diff --git a/code/modules/mob/living/carbon/human/gradient.dm b/code/modules/mob/living/carbon/human/gradient.dm new file mode 100644 index 0000000000..7a0e1d37f1 --- /dev/null +++ b/code/modules/mob/living/carbon/human/gradient.dm @@ -0,0 +1,6 @@ +GLOBAL_LIST_INIT(hair_gradients, list( + "None" = "none", + "Fade (Up)" = "fadeup", + "Fade (Down)" = "fadedown", + "Vertical Split" = "vsplit" + )) \ No newline at end of file diff --git a/code/modules/mob/living/carbon/human/human_defines.dm b/code/modules/mob/living/carbon/human/human_defines.dm index 18e0babf42..4bba6c7ceb 100644 --- a/code/modules/mob/living/carbon/human/human_defines.dm +++ b/code/modules/mob/living/carbon/human/human_defines.dm @@ -5,6 +5,10 @@ var/b_hair = 0 var/h_style = "Bald" + var/r_grad = 0 + var/g_grad = 0 + var/b_grad = 0 + var/grad_style = "none" //Facial hair colour and style var/r_facial = 0 var/g_facial = 0 diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index 46011af5ba..74836a00f8 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -430,11 +430,18 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() hair_style = hair_styles_list["Short Hair"] if(hair_style && (src.species.get_bodytype(src) in hair_style.species_allowed)) + var/icon/grad_s = null var/icon/hair_s = new/icon("icon" = hair_style.icon, "icon_state" = "[hair_style.icon_state]_s") var/icon/hair_s_add = new/icon("icon" = hair_style.icon_add, "icon_state" = "[hair_style.icon_state]_s") if(hair_style.do_colouration) + if(grad_style) + grad_s = new/icon("icon" = 'icons/mob/hair_gradients.dmi', "icon_state" = GLOB.hair_gradients[grad_style]) + grad_s.Blend(hair_s, ICON_AND) + grad_s.Blend(rgb(r_grad, g_grad, b_grad), ICON_MULTIPLY) hair_s.Blend(rgb(r_hair, g_hair, b_hair), ICON_MULTIPLY) hair_s.Blend(hair_s_add, ICON_ADD) + if(!isnull(grad_s)) + hair_s.Blend(grad_s, ICON_OVERLAY) face_standing.Blend(hair_s, ICON_OVERLAY) diff --git a/icons/mob/hair_gradients.dmi b/icons/mob/hair_gradients.dmi new file mode 100644 index 0000000000..0f40b098e9 Binary files /dev/null and b/icons/mob/hair_gradients.dmi differ diff --git a/vorestation.dme b/vorestation.dme index 8f61780e46..7deca54823 100644 --- a/vorestation.dme +++ b/vorestation.dme @@ -2447,7 +2447,11 @@ #include "code\modules\mob\living\carbon\human\emote.dm" #include "code\modules\mob\living\carbon\human\emote_vr.dm" #include "code\modules\mob\living\carbon\human\examine.dm" +<<<<<<< HEAD:vorestation.dme #include "code\modules\mob\living\carbon\human\examine_vr.dm" +======= +#include "code\modules\mob\living\carbon\human\gradient.dm" +>>>>>>> 4d70bd7... ice cream (#7313):polaris.dme #include "code\modules\mob\living\carbon\human\human.dm" #include "code\modules\mob\living\carbon\human\human_attackhand.dm" #include "code\modules\mob\living\carbon\human\human_attackhand_vr.dm"