Merge pull request #15504 from phil235/HatMaskFacialHairFixes

Fixes mask and head gear issues
This commit is contained in:
AnturK
2016-02-17 21:47:17 +01:00
36 changed files with 163 additions and 154 deletions
@@ -600,6 +600,10 @@
if(head.flags_inv & HIDEEARS)
obscured |= slot_ears
if(wear_mask)
if(wear_mask.flags_inv & HIDEEYES)
obscured |= slot_glasses
if(obscured.len > 0)
return obscured
else
@@ -167,16 +167,18 @@
update_inv_s_store()
/mob/living/carbon/human/wear_mask_update(obj/item/clothing/C, unequip = 1)
if(C.flags & BLOCKHAIR)
if((C.flags_inv & (HIDEHAIR|HIDEFACIALHAIR)) || (initial(C.flags_inv) & (HIDEHAIR|HIDEFACIALHAIR)))
update_hair()
if(unequip && internal)
update_internals_hud_icon(0)
internal = null
if(C.flags_inv & HIDEEYES)
update_inv_glasses()
sec_hud_set_security_status()
..()
/mob/living/carbon/human/head_update(obj/item/I, forced)
if(I.flags & BLOCKHAIR || forced)
if((I.flags_inv & (HIDEHAIR|HIDEFACIALHAIR)) || forced)
update_hair()
if(I.flags_inv & HIDEEYES || forced)
update_inv_glasses()
+45 -31
View File
@@ -169,11 +169,23 @@
/datum/species/proc/handle_hair(mob/living/carbon/human/H, forced_colour)
H.remove_overlay(HAIR_LAYER)
if(H.disabilities & HUSK)
return
var/datum/sprite_accessory/S
var/list/standing = list()
var/list/standing = list()
var/hair_hidden = 0
var/facialhair_hidden = 0
//we check if our hat or helmet hides our facial hair.
if(H.head)
var/obj/item/I = H.head
if(I.flags_inv & HIDEFACIALHAIR)
facialhair_hidden = 1
if(H.wear_mask)
var/obj/item/clothing/mask/M = H.wear_mask
if(M.flags_inv & HIDEFACIALHAIR)
facialhair_hidden = 1
if(H.facial_hair_style && FACEHAIR in specflags)
if(H.facial_hair_style && (FACEHAIR in specflags) && !facialhair_hidden)
S = facial_hair_styles_list[H.facial_hair_style]
if(S)
var/image/img_facial_s
@@ -193,44 +205,46 @@
img_facial_s.alpha = hair_alpha
standing += img_facial_s
standing += img_facial_s
//Applies the debrained overlay if there is no brain
if(!H.getorgan(/obj/item/organ/internal/brain))
standing += image("icon"='icons/mob/human_face.dmi', "icon_state" = "debrained_s", "layer" = -HAIR_LAYER)
//we check if our hat or helmet hides our hair.
if(H.head)
var/obj/item/I = H.head
if(I.flags_inv & HIDEHAIR)
hair_hidden = 1
if(H.wear_mask)
var/obj/item/clothing/mask/M = H.wear_mask
if(M.flags_inv & HIDEHAIR)
hair_hidden = 1
if(!hair_hidden)
if(!H.getorgan(/obj/item/organ/internal/brain)) //Applies the debrained overlay if there is no brain
standing += image("icon"='icons/mob/human_face.dmi', "icon_state" = "debrained_s", "layer" = -HAIR_LAYER)
if((H.wear_suit) && (H.wear_suit.hooded) && (H.wear_suit.suittoggled == 1))
if(standing.len)
H.overlays_standing[HAIR_LAYER] = standing
H.apply_overlay(HAIR_LAYER)
return
else if(H.hair_style && (HAIR in specflags))
S = hair_styles_list[H.hair_style]
if(S)
var/image/img_hair_s = image("icon" = S.icon, "icon_state" = "[S.icon_state]_s", "layer" = -HAIR_LAYER)
else if(H.hair_style && HAIR in specflags)
S = hair_styles_list[H.hair_style]
if(S)
var/image/img_hair_s = image("icon" = S.icon, "icon_state" = "[S.icon_state]_s", "layer" = -HAIR_LAYER)
img_hair_s = image("icon" = S.icon, "icon_state" = "[S.icon_state]_s", "layer" = -HAIR_LAYER)
img_hair_s = image("icon" = S.icon, "icon_state" = "[S.icon_state]_s", "layer" = -HAIR_LAYER)
if(!forced_colour)
if(hair_color)
if(hair_color == "mutcolor")
img_hair_s.color = "#" + H.dna.features["mcolor"]
if(!forced_colour)
if(hair_color)
if(hair_color == "mutcolor")
img_hair_s.color = "#" + H.dna.features["mcolor"]
else
img_hair_s.color = "#" + hair_color
else
img_hair_s.color = "#" + hair_color
img_hair_s.color = "#" + H.hair_color
else
img_hair_s.color = "#" + H.hair_color
else
img_hair_s.color = forced_colour
img_hair_s.alpha = hair_alpha
img_hair_s.color = forced_colour
img_hair_s.alpha = hair_alpha
standing += img_hair_s
standing += img_hair_s
if(standing.len)
H.overlays_standing[HAIR_LAYER] = standing
H.apply_overlay(HAIR_LAYER)
return
/datum/species/proc/handle_body(mob/living/carbon/human/H)
H.remove_overlay(BODY_LAYER)
@@ -329,11 +343,11 @@
bodyparts_to_add -= "frills"
if("horns" in mutant_bodyparts)
if(!H.dna.features["horns"] || H.dna.features["horns"] == "None" || H.head && (H.head.flags & BLOCKHAIR) || (H.wear_mask && (H.wear_mask.flags & BLOCKHAIR)))
if(!H.dna.features["horns"] || H.dna.features["horns"] == "None" || H.head && (H.head.flags_inv & HIDEHAIR) || (H.wear_mask && (H.wear_mask.flags_inv & HIDEHAIR)))
bodyparts_to_add -= "horns"
if("ears" in mutant_bodyparts)
if(!H.dna.features["ears"] || H.dna.features["ears"] == "None" || H.head && (H.head.flags & BLOCKHAIR) || (H.wear_mask && (H.wear_mask.flags & BLOCKHAIR)))
if(!H.dna.features["ears"] || H.dna.features["ears"] == "None" || H.head && (H.head.flags_inv & HIDEHAIR) || (H.wear_mask && (H.wear_mask.flags_inv & HIDEHAIR)))
bodyparts_to_add -= "ears"
if(!bodyparts_to_add)
@@ -76,15 +76,6 @@ Please contact me on #coderbus IRC. ~Carnie x
//HAIR OVERLAY
/mob/living/carbon/human/update_hair()
//Reset our hair
remove_overlay(HAIR_LAYER)
if( (disabilities & HUSK) || (head && (head.flags & BLOCKHAIR)) || (wear_mask && (wear_mask.flags & BLOCKHAIR)) )
return
if((wear_suit) && (wear_suit.hooded) && (wear_suit.suittoggled == 1))
return
dna.species.handle_hair(src)
/mob/living/carbon/human/proc/update_mutcolor()
@@ -246,7 +237,7 @@ Please contact me on #coderbus IRC. ~Carnie x
glasses.screen_loc = ui_glasses //...draw the item in the inventory screen
client.screen += glasses //Either way, add the item to the HUD
if(!(head && (head.flags_inv & HIDEEYES)))
if(!(head && (head.flags_inv & HIDEEYES)) && !(wear_mask && (wear_mask.flags_inv & HIDEEYES)))
var/image/standing = glasses.build_worn_icon(state = glasses.icon_state, default_layer = GLASSES_LAYER, default_icon_file = 'icons/mob/eyes.dmi')
overlays_standing[GLASSES_LAYER] = standing
+4 -1
View File
@@ -88,7 +88,10 @@
update_inv_legcuffed()
//handle stuff to update when a mob equips/unequips a mask.
/mob/living/carbon/proc/wear_mask_update(obj/item/clothing/C, unequip = 1)
/mob/living/proc/wear_mask_update(obj/item/clothing/C, unequip = 1)
update_inv_wear_mask()
/mob/living/carbon/wear_mask_update(obj/item/clothing/C, unequip = 1)
if(C.tint || initial(C.tint))
update_tint()
update_inv_wear_mask()
@@ -77,8 +77,10 @@
if(client && hud_used && hud_used.hud_shown)
head.screen_loc = ui_drone_head
client.screen += head
var/image/head_overlay = head.build_worn_icon(state = head.icon_state, default_layer = DRONE_HEAD_LAYER, default_icon_file = 'icons/mob/head.dmi')
var/used_head_icon = 'icons/mob/head.dmi'
if(istype(head, /obj/item/clothing/mask))
used_head_icon = 'icons/mob/mask.dmi'
var/image/head_overlay = head.build_worn_icon(state = head.icon_state, default_layer = DRONE_HEAD_LAYER, default_icon_file = used_head_icon)
head_overlay.pixel_y += -15
drone_overlays[DRONE_HEAD_LAYER] = head_overlay