Custom skin tone preferences.

This commit is contained in:
Ghommie
2020-04-14 19:10:28 +02:00
parent 8f71aafde5
commit 571584901c
30 changed files with 210 additions and 185 deletions
@@ -37,7 +37,7 @@
if(ishuman(source_mob))
var/mob/living/carbon/human/H = source_mob
if(H.dna.species.use_skintones)
body_coloring = "#[skintone2hex(H.skin_tone)]"
body_coloring = SKINTONE2HEX(H.skin_tone)
else
body_coloring = "#[H.dna.features["mcolor"]]"
@@ -49,7 +49,7 @@
H.set_species(gib_mob_species)
dna_to_add = temp_mob.get_blood_dna_list()
if(H.dna.species.use_skintones)
body_coloring = "#[skintone2hex(H.skin_tone)]"
body_coloring = SKINTONE2HEX(H.skin_tone)
else
body_coloring = "#[H.dna.features["mcolor"]]"
else
+14 -4
View File
@@ -158,11 +158,21 @@
H.set_species(newrace, icon_update=0)
if(H.dna.species.use_skintones)
var/new_s_tone = input(user, "Choose your skin tone:", "Race change") as null|anything in GLOB.skin_tones
var/new_s_tone = input(H, "Choose your skin tone:", "Race change") as null|anything in GLOB.skin_tones + "custom"
if(new_s_tone)
H.skin_tone = new_s_tone
H.dna.update_ui_block(DNA_SKIN_TONE_BLOCK)
if(new_s_tone == "custom")
var/default = H.dna.skin_tone_override || null
var/custom_tone = input(user, "Choose your custom skin tone:", "Race change", default) as color|null
if(custom_tone)
var/temp_hsv = RGBtoHSV(new_s_tone)
if(ReadHSV(temp_hsv)[3] >= ReadHSV("#202020")[3])
to_chat(H,"<span class='danger'>Invalid color. Your color is not bright enough.</span>")
else
H.skin_tone = custom_tone
H.dna.skin_tone_override = custom_tone
else
H.skin_tone = new_s_tone
H.dna.update_ui_block(DNA_SKIN_TONE_BLOCK)
if(MUTCOLORS in H.dna.species.species_traits)
var/new_mutantcolor = input(user, "Choose your skin color:", "Race change","#"+H.dna.features["mcolor"]) as color|null