Second package of skin tone fixes (#29489)

* further skin tone fixes

* a bit more
This commit is contained in:
kyunkyunkyun
2025-06-17 21:49:49 +05:00
committed by GitHub
parent 6c2915e581
commit 23a6483db0
10 changed files with 59 additions and 93 deletions
+4 -2
View File
@@ -32,7 +32,7 @@
var/f_style = "Shaved" //Facial hair type
var/f_colour = "#000000" //Facial hair color
var/f_sec_colour = "#000000" //Secondary facial hair color
var/s_tone = 0 //Skin tone
var/s_tone = 1 //Skin tone
var/s_colour = "#000000" //Skin color
var/e_colour = "#000000" //Eye color
var/alt_head = "None" //Alt head style.
@@ -619,7 +619,9 @@
socks = random_socks(body_type, species)
if(length(GLOB.body_accessory_by_species[species]))
body_accessory = random_body_accessory(species, S.optional_body_accessory)
if(S.bodyflags & (HAS_SKIN_TONE|HAS_ICON_SKIN_TONE))
if(S.bodyflags & HAS_SKIN_TONE)
s_tone = 35 - random_skin_tone(species)
else if(S.bodyflags & HAS_ICON_SKIN_TONE)
s_tone = random_skin_tone(species)
h_style = random_hair_style(gender, species, robohead)
f_style = random_facial_hair_style(gender, species, robohead)
@@ -151,8 +151,10 @@
if("eyes")
active_character.e_colour = rand_hex_color()
if("s_tone")
if(S.bodyflags & (HAS_SKIN_TONE|HAS_ICON_SKIN_TONE))
active_character.s_tone = random_skin_tone()
if(S.bodyflags & HAS_SKIN_TONE)
active_character.s_tone = 35 - random_skin_tone(active_character.species)
else if(S.bodyflags & HAS_ICON_SKIN_TONE)
active_character.s_tone = random_skin_tone(active_character.species)
if("s_color")
if(S.bodyflags & HAS_SKIN_COLOR)
active_character.s_colour = rand_hex_color()
@@ -246,10 +248,12 @@
active_character.socks = random_socks(active_character.body_type, active_character.species)
//reset skin tone and colour
if(NS.bodyflags & (HAS_SKIN_TONE|HAS_ICON_SKIN_TONE))
random_skin_tone(active_character.species)
if(NS.bodyflags & HAS_SKIN_TONE)
active_character.s_tone = 35 - random_skin_tone(active_character.species)
else if(NS.bodyflags & HAS_ICON_SKIN_TONE)
active_character.s_tone = random_skin_tone(active_character.species)
else
active_character.s_tone = 0
active_character.s_tone = 1
if(!(NS.bodyflags & HAS_SKIN_COLOR))
active_character.s_colour = "#000000"
@@ -639,18 +643,18 @@
active_character.e_colour = new_eyes
if("s_tone")
var/new_s_tone
if(S.bodyflags & HAS_SKIN_TONE)
var/new_s_tone = input(user, "Choose your character's skin-tone:\n(Light 1 - 220 Dark)", "Character Preference") as num|null
new_s_tone = tgui_input_number(user, "Choose your character's skin-tone:\n(Light 1 - 220 Dark)", "Character Preference", -active_character.s_tone + 35, 220, 1)
if(isnull(new_s_tone))
return
active_character.s_tone = 35 - max(min(round(new_s_tone), 220), 1)
active_character.s_tone = 35 - new_s_tone
else if(S.bodyflags & HAS_ICON_SKIN_TONE)
var/const/MAX_LINE_ENTRIES = 4
var/prompt = "Choose your character's skin tone: 1-[length(S.icon_skin_tones)]\n(Light to Dark)"
var/skin_c = tgui_input_number(user, prompt, "Character Preference", active_character.s_tone, length(S.icon_skin_tones), 1)
if(isnull(skin_c))
new_s_tone = tgui_input_number(user, prompt, "Character Preference", active_character.s_tone, length(S.icon_skin_tones), 1)
if(isnull(new_s_tone))
return
active_character.s_tone = skin_c
active_character.s_tone = new_s_tone
if("skin")
if((S.bodyflags & HAS_SKIN_COLOR) || GLOB.body_accessory_by_species[active_character.species] || check_rights(R_ADMIN, 0, user))