Preview icon fixes

- Fixes preview icon not updating with skin/hair/eye colour, and underwear selection
 - Fixes bug causing blank underwear and undershirt selection after randomizing
This commit is contained in:
Loganbacca
2015-12-28 21:25:14 +13:00
parent c0fb63c796
commit 358a85a179
@@ -5,15 +5,19 @@ datum/preferences
var/datum/species/current_species = all_species[species]
if(current_species)
if(current_species.flags & HAS_SKIN_TONE)
if(current_species.appearance_flags & HAS_SKIN_TONE)
s_tone = random_skin_tone()
if(current_species.flags & HAS_EYE_COLOR)
if(current_species.appearance_flags & HAS_EYE_COLOR)
randomize_eyes_color()
if(current_species.flags & HAS_SKIN_COLOR)
if(current_species.appearance_flags & HAS_SKIN_COLOR)
randomize_skin_color()
if(current_species.flags & HAS_UNDERWEAR)
underwear = rand(1,underwear_m.len)
undershirt = rand(1,undershirt_t.len)
if(current_species.appearance_flags & HAS_UNDERWEAR)
switch(gender)
if(MALE)
underwear = underwear_m[pick(underwear_m)]
if(FEMALE)
underwear = underwear_f[pick(underwear_f)]
undershirt = undershirt_t[pick(undershirt_t)]
h_style = random_hair_style(gender, species)
f_style = random_facial_hair_style(gender, species)
@@ -219,18 +223,18 @@ datum/preferences
preview_icon.Blend(temp, ICON_OVERLAY)
// Skin color
if(current_species && (current_species.flags & HAS_SKIN_COLOR))
if(current_species && (current_species.appearance_flags & HAS_SKIN_COLOR))
preview_icon.Blend(rgb(r_skin, g_skin, b_skin), ICON_ADD)
// Skin tone
if(current_species && (current_species.flags & HAS_SKIN_TONE))
if(current_species && (current_species.appearance_flags & HAS_SKIN_TONE))
if (s_tone >= 0)
preview_icon.Blend(rgb(s_tone, s_tone, s_tone), ICON_ADD)
else
preview_icon.Blend(rgb(-s_tone, -s_tone, -s_tone), ICON_SUBTRACT)
var/icon/eyes_s = new/icon("icon" = 'icons/mob/human_face.dmi', "icon_state" = current_species ? current_species.eyes : "eyes_s")
if ((current_species && (current_species.flags & HAS_EYE_COLOR)))
if ((current_species && (current_species.appearance_flags & HAS_EYE_COLOR)))
eyes_s.Blend(rgb(r_eyes, g_eyes, b_eyes), ICON_ADD)
var/datum/sprite_accessory/hair_style = hair_styles_list[h_style]
@@ -246,11 +250,11 @@ datum/preferences
eyes_s.Blend(facial_s, ICON_OVERLAY)
var/icon/underwear_s = null
if(underwear && current_species.flags & HAS_UNDERWEAR)
if(underwear && current_species.appearance_flags & HAS_UNDERWEAR)
underwear_s = new/icon("icon" = 'icons/mob/human.dmi', "icon_state" = underwear)
var/icon/undershirt_s = null
if(undershirt && current_species.flags & HAS_UNDERWEAR)
if(undershirt && current_species.appearance_flags & HAS_UNDERWEAR)
undershirt_s = new/icon("icon" = 'icons/mob/human.dmi', "icon_state" = undershirt)
var/icon/clothes_s = null