From b2ef07604352d19acab28f862e2f7f59b5472400 Mon Sep 17 00:00:00 2001 From: SandPoot Date: Thu, 26 Aug 2021 16:44:36 -0300 Subject: [PATCH] Upload files --- code/modules/client/preferences.dm | 27 +++++++++++++++++++++ code/modules/client/preferences_savefile.dm | 6 +++++ 2 files changed, 33 insertions(+) diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index 5bc0440b77..877b0a8725 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -117,6 +117,8 @@ GLOBAL_LIST_EMPTY(preferences_datums) var/hair_color = "000000" //Hair color var/facial_hair_style = "Shaved" //Face hair type var/facial_hair_color = "000000" //Facial hair color + var/grad_style //Hair gradient style + var/grad_color = "FFFFFF" //Hair gradient color var/skin_tone = "caucasian1" //Skin color var/use_custom_skin_tone = FALSE var/left_eye_color = "000000" //Eye color @@ -503,6 +505,12 @@ GLOBAL_LIST_EMPTY(preferences_datums) dat += "< >
" dat += "    Change
" + dat += "

Hair Gradient

" + + dat += "[grad_style]" + dat += "< >
" + dat += "    Change
" + dat += "" //Mutant stuff var/mutant_category = 0 @@ -1707,6 +1715,23 @@ GLOBAL_LIST_EMPTY(preferences_datums) if("previous_facehair_style") facial_hair_style = previous_list_item(facial_hair_style, GLOB.facial_hair_styles_list) + if("grad_color") + var/new_grad_color = input(user, "Choose your character's gradient colour:", "Character Preference","#"+grad_color) as color|null + if(new_grad_color) + grad_color = sanitize_hexcolor(new_grad_color, 6) + + if("grad_style") + var/new_grad_style + new_grad_style = input(user, "Choose your character's hair gradient style:", "Character Preference") as null|anything in GLOB.hair_gradients_list + if(new_grad_style) + grad_style = new_grad_style + + if("next_grad_style") + grad_style = next_list_item(grad_style, GLOB.hair_gradients_list) + + if("previous_grad_style") + grad_style = previous_list_item(grad_style, GLOB.hair_gradients_list) + if("cycle_bg") bgstate = next_list_item(bgstate, bgstate_options) @@ -3006,6 +3031,8 @@ GLOBAL_LIST_EMPTY(preferences_datums) character.dna.skin_tone_override = use_custom_skin_tone ? skin_tone : null character.hair_style = hair_style character.facial_hair_style = facial_hair_style + character.grad_style = grad_style + character.grad_color = grad_color character.underwear = underwear character.saved_underwear = underwear diff --git a/code/modules/client/preferences_savefile.dm b/code/modules/client/preferences_savefile.dm index d4d13dc40f..f1badf9d1a 100644 --- a/code/modules/client/preferences_savefile.dm +++ b/code/modules/client/preferences_savefile.dm @@ -676,6 +676,8 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car S["skin_tone"] >> skin_tone S["hair_style_name"] >> hair_style S["facial_style_name"] >> facial_hair_style + S["grad_style"] >> grad_style + S["grad_color"] >> grad_color S["underwear"] >> underwear S["undie_color"] >> undie_color S["undershirt"] >> undershirt @@ -868,6 +870,8 @@ 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, 6, FALSE) facial_hair_color = sanitize_hexcolor(facial_hair_color, 6, FALSE) + grad_style = sanitize_inlist(grad_style, GLOB.hair_gradients_list) + grad_color = sanitize_hexcolor(grad_color, 6, FALSE) eye_type = sanitize_inlist(eye_type, GLOB.eye_types, DEFAULT_EYES_TYPE) left_eye_color = sanitize_hexcolor(left_eye_color, 6, FALSE) right_eye_color = sanitize_hexcolor(right_eye_color, 6, FALSE) @@ -1037,6 +1041,8 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car 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"] , grad_style) + WRITE_FILE(S["grad_color"] , grad_color) WRITE_FILE(S["underwear"] , underwear) WRITE_FILE(S["undie_color"] , undie_color) WRITE_FILE(S["undershirt"] , undershirt)