From 358a85a179acb4d346a25afb69a2e681d685fa73 Mon Sep 17 00:00:00 2001 From: Loganbacca Date: Mon, 28 Dec 2015 21:05:44 +1300 Subject: [PATCH] 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 --- .../mob/new_player/preferences_setup.dm | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/code/modules/mob/new_player/preferences_setup.dm b/code/modules/mob/new_player/preferences_setup.dm index 789e93a7f99..7fae8447139 100644 --- a/code/modules/mob/new_player/preferences_setup.dm +++ b/code/modules/mob/new_player/preferences_setup.dm @@ -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