Final Pass

Breaks Facial Hair updates into their own proc and puts facial hair on
its own layer.
Works through everything that calls update_hair with the intention of
updating facial hair and adds update_fhair
Fixes the sprite names and colouring on all 'facial' and 'body marking'
aspects.

Fixes/implements proper ID photo/preferences preview picture generation.

To do: Tail marking customization possible rework, gutting in the
meantime
This commit is contained in:
KasparoVy
2015-12-27 05:45:25 -05:00
parent 73d514f5a2
commit 5f72fff880
17 changed files with 111 additions and 80 deletions
@@ -54,7 +54,7 @@
f_style = facial_hair_style
update_hair()
update_fhair()
return 1
/mob/living/carbon/human/proc/reset_hair()
@@ -74,6 +74,7 @@
f_style = "Shaved"
update_hair()
update_fhair()
/mob/living/carbon/human/proc/change_eye_color(var/red, var/green, var/blue)
if(red == r_eyes && green == g_eyes && blue == b_eyes)
@@ -106,7 +107,7 @@
g_facial = green
b_facial = blue
update_hair()
update_fhair()
return 1
/mob/living/carbon/human/proc/change_skin_color(var/red, var/green, var/blue)
@@ -150,6 +150,7 @@
f_style = "Shaved"
if(h_style)
h_style = "Bald"
update_fhair(0)
update_hair(0)
mutations.Add(SKELETON)
@@ -166,6 +167,7 @@
f_style = "Shaved" //we only change the icon_state of the hair datum, so it doesn't mess up their UI/UE
if(h_style)
h_style = "Bald"
update_fhair(0)
update_hair(0)
mutations.Add(HUSK)
@@ -143,6 +143,7 @@
head = null
if(I.flags & BLOCKHAIR || I.flags & BLOCKHEADHAIR)
update_hair() //rebuild hair
update_fhair()
update_inv_head()
else if(I == r_ear)
r_ear = null
@@ -160,6 +161,7 @@
wear_mask = null
if(I.flags & BLOCKHAIR || I.flags & BLOCKHEADHAIR)
update_hair() //rebuild hair
update_fhair()
if(internal)
if(internals)
internals.icon_state = "internal0"
@@ -122,16 +122,17 @@ Please contact me on #coderbus IRC. ~Carn x
#define BACK_LAYER 15
#define HAIR_LAYER 16 //TODO: make part of head layer?
#define HORN_LAYER 17
#define FACEMASK_LAYER 18
#define HEAD_LAYER 19
#define COLLAR_LAYER 20
#define HANDCUFF_LAYER 21
#define LEGCUFF_LAYER 22
#define L_HAND_LAYER 23
#define R_HAND_LAYER 24
#define TARGETED_LAYER 25 //BS12: Layer for the target overlay from weapon targeting system
#define FIRE_LAYER 26 //If you're on fire
#define TOTAL_LAYERS 26
#define FHAIR_LAYER 18
#define FACEMASK_LAYER 19
#define HEAD_LAYER 20
#define COLLAR_LAYER 21
#define HANDCUFF_LAYER 22
#define LEGCUFF_LAYER 23
#define L_HAND_LAYER 24
#define R_HAND_LAYER 25
#define TARGETED_LAYER 26 //BS12: Layer for the target overlay from weapon targeting system
#define FIRE_LAYER 27 //If you're on fire
#define TOTAL_LAYERS 27
@@ -356,11 +357,13 @@ var/global/list/damage_icon_parts = list()
update_horns(0)
//markings
update_markings(0)
//hair
update_hair(0)
update_fhair(0)
//MARKINGS OVERLAY
/mob/living/carbon/human/proc/update_markings(var/update_icons=1)
world << "\red PROC CALLED"
//Reset our markings
overlays_standing[MARKINGS_LAYER] = null
@@ -436,6 +439,41 @@ var/global/list/damage_icon_parts = list()
if(update_icons) update_icons()
return
//base icons
var/icon/hair_standing = new /icon('icons/mob/human_face.dmi',"bald_s")
if(h_style && !(head && (head.flags & BLOCKHEADHAIR) && !(isSynthetic())))
var/datum/sprite_accessory/hair_style = hair_styles_list[h_style]
if(hair_style && hair_style.species_allowed)
if(src.species.name in hair_style.species_allowed)
var/icon/hair_s = new/icon("icon" = hair_style.icon, "icon_state" = "[hair_style.icon_state]_s")
if(hair_style.do_colouration)
hair_s.Blend(rgb(r_hair, g_hair, b_hair), ICON_ADD)
hair_standing.Blend(hair_s, ICON_OVERLAY)
else
//warning("Invalid h_style for [species.name]: [h_style]")
overlays_standing[HAIR_LAYER] = image(hair_standing)
if(update_icons) update_icons()
//FACIAL HAIR OVERLAY
/mob/living/carbon/human/proc/update_fhair(var/update_icons=1)
//Reset our facial hair
overlays_standing[FHAIR_LAYER] = null
var/obj/item/organ/external/head/head_organ = get_organ("head")
if(!head_organ || head_organ.is_stump() || (head_organ.status & ORGAN_DESTROYED) )
if(update_icons) update_icons()
return
//masks and helmets can obscure our facial hair, unless we're a synthetic
if( (head && (head.flags & BLOCKHAIR)) || (wear_mask && (wear_mask.flags & BLOCKHAIR)))
if(update_icons) update_icons()
return
//base icons
var/icon/face_standing = new /icon('icons/mob/human_face.dmi',"bald_s")
@@ -450,19 +488,7 @@ var/global/list/damage_icon_parts = list()
else
//warning("Invalid f_style for [species.name]: [f_style]")
if(h_style && !(head && (head.flags & BLOCKHEADHAIR) && !(isSynthetic())))
var/datum/sprite_accessory/hair_style = hair_styles_list[h_style]
if(hair_style && hair_style.species_allowed)
if(src.species.name in hair_style.species_allowed)
var/icon/hair_s = new/icon("icon" = hair_style.icon, "icon_state" = "[hair_style.icon_state]_s")
if(hair_style.do_colouration)
hair_s.Blend(rgb(r_hair, g_hair, b_hair), ICON_ADD)
face_standing.Blend(hair_s, ICON_OVERLAY)
else
//warning("Invalid h_style for [species.name]: [h_style]")
overlays_standing[HAIR_LAYER] = image(face_standing)
overlays_standing[FHAIR_LAYER] = image(face_standing)
if(update_icons) update_icons()
@@ -526,6 +552,7 @@ var/global/list/damage_icon_parts = list()
skeleton = null
update_hair(0)
update_fhair(0)
if(update_icons) update_icons()
//Call when target overlay should be added/removed
@@ -554,6 +581,8 @@ var/global/list/damage_icon_parts = list()
update_mutations(0)
update_body(0)
update_hair(0)
update_horns(0)
update_fhair(0)
update_mutantrace(0)
update_inv_w_uniform(0,0)
update_inv_wear_id(0)
@@ -1103,6 +1132,7 @@ var/global/list/damage_icon_parts = list()
#undef HAIR_LAYER
#undef HEAD_LAYER
#undef HORN_LAYER
#undef FHAIR_LAYER
#undef COLLAR_LAYER
#undef HANDCUFF_LAYER
#undef LEGCUFF_LAYER
+2 -1
View File
@@ -112,7 +112,7 @@
if(self_message && M==src)
msg = self_message
M.show_message(msg, 2, deaf_message, 1)
// based on say code
var/omsg = replacetext(message, "<B>[src]</B> ", "")
var/list/listening_obj = new
@@ -177,6 +177,7 @@
if(ishuman(src) && W == src:head)
src:update_hair()
src:update_fhair()
/mob/proc/put_in_any_hand_if_possible(obj/item/W as obj, del_on_fail = 0, disable_warning = 1, redraw_mob = 1)
if(equip_to_slot_if_possible(W, slot_l_hand, del_on_fail, disable_warning, redraw_mob))
@@ -267,12 +267,6 @@ datum/preferences
hair_s.Blend(rgb(r_hair, g_hair, b_hair), ICON_ADD)
eyes_s.Blend(hair_s, ICON_OVERLAY)
var/datum/sprite_accessory/facial_hair_style = facial_hair_styles_list[f_style]
if(facial_hair_style)
var/icon/facial_s = new/icon("icon" = facial_hair_style.icon, "icon_state" = "[facial_hair_style.icon_state]_s")
facial_s.Blend(rgb(r_facial, g_facial, b_facial), ICON_ADD)
eyes_s.Blend(facial_s, ICON_OVERLAY)
//Horns
if(current_species && (current_species.bodyflags & HAS_HORNS))
var/datum/sprite_accessory/horn_style = horn_styles_list[horns]
@@ -281,6 +275,12 @@ datum/preferences
horns_s.Blend(rgb(r_skin, g_skin, b_skin), ICON_ADD)
eyes_s.Blend(horns_s, ICON_OVERLAY)
var/datum/sprite_accessory/facial_hair_style = facial_hair_styles_list[f_style]
if(facial_hair_style)
var/icon/facial_s = new/icon("icon" = facial_hair_style.icon, "icon_state" = "[facial_hair_style.icon_state]_s")
facial_s.Blend(rgb(r_facial, g_facial, b_facial), ICON_ADD)
eyes_s.Blend(facial_s, ICON_OVERLAY)
var/icon/underwear_s = null
if(underwear && (current_species.clothing_flags & HAS_UNDERWEAR))
var/datum/sprite_accessory/underwear/U = underwear_list[underwear]
@@ -821,8 +821,6 @@ datum/preferences
else if(backbag == 3 || backbag == 4)
clothes_s.Blend(new /icon('icons/mob/back.dmi', "satchel"), ICON_OVERLAY)
if(!(current_species.bodyflags & NO_EYES))
preview_icon.Blend(eyes_s, ICON_OVERLAY)
if(underwear_s)
preview_icon.Blend(underwear_s, ICON_OVERLAY)
if(undershirt_s)
@@ -831,6 +829,8 @@ datum/preferences
preview_icon.Blend(socks_s, ICON_OVERLAY)
if(clothes_s)
preview_icon.Blend(clothes_s, ICON_OVERLAY)
if(!(current_species.bodyflags & NO_EYES))
preview_icon.Blend(eyes_s, ICON_OVERLAY)
preview_icon_front = new(preview_icon, dir = SOUTH)
preview_icon_side = new(preview_icon, dir = WEST)
@@ -981,44 +981,44 @@
//Unathi
una_spines_long
name = "Long Unathi Spines"
name = "Long Spines"
icon_state = "soghun_longspines"
species_allowed = list("Unathi")
gender = NEUTER
una_spines_short
name = "Short Unathi Spines"
name = "Short Spines"
icon_state = "soghun_shortspines"
species_allowed = list("Unathi")
gender = NEUTER
una_frills_long
name = "Long Unathi Frills"
name = "Long Frills"
icon_state = "soghun_longfrills"
species_allowed = list("Unathi")
gender = NEUTER
una_frills_short
name = "Short Unathi Frills"
name = "Short Frills"
icon_state = "soghun_shortfrills"
species_allowed = list("Unathi")
gender = NEUTER
una_simple
name = "Simple"
icon_state = "soghun_longwebbed_frills"
una_frills_webbed_long
name = "Long Webbed Frills"
icon_state = "soghun_longfrills_webbed"
species_allowed = list("Unathi")
gender = NEUTER
una_short
name = "Short"
icon_state = "soghun_shortwebbed_frills"
una_frills_webbed_short
name = "Short Webbed Frills"
icon_state = "soghun_shortfrills_webbed"
species_allowed = list("Unathi")
gender = NEUTER
una_aquatic
name = "Aquatic"
icon_state = "soghun_aquafrills"
una_frills_webbed_aquatic
name = "Aquatic Frills"
icon_state = "soghun_aquaticfrills_webbed"
species_allowed = list("Unathi")
gender = NEUTER
@@ -1588,26 +1588,14 @@
name = "None"
icon_state = "accessory_none"
/datum/sprite_accessory/body_markings/dstripe
name = "Dark Stripe"
icon_state = "markings_dstripe"
/datum/sprite_accessory/body_markings/stripe
name = "Stripe"
icon_state = "markings_stripe"
/datum/sprite_accessory/body_markings/lstripe
name = "Light Stripe"
icon_state = "markings_lstripe"
/datum/sprite_accessory/body_markings/tiger
name = "Tiger Body"
icon_state = "markings_tiger"
/datum/sprite_accessory/body_markings/dtiger
name = "Dark Tiger Body"
icon_state = "markings_dtiger"
/datum/sprite_accessory/body_markings/dtigerhead
name = "Dark Tiger Body + Head"
icon_state = "markings_dtigerhead"
/datum/sprite_accessory/body_markings/ltiger
name = "Light Tiger Body"
icon_state = "markings_ltiger"
/datum/sprite_accessory/body_markings/ltigerhead
name = "Light Tiger Body + Head"
icon_state = "markings_ltigerhead"
/datum/sprite_accessory/body_markings/tigerhead
name = "Tiger Body + Head"
icon_state = "markings_tigerhead"