From d29075f92ac57b137b4e76307202c869a84bd427 Mon Sep 17 00:00:00 2001 From: Kapu1178 <75460809+Kapu1178@users.noreply.github.com> Date: Fri, 23 Feb 2024 18:50:09 -0500 Subject: [PATCH] Fixes many instances of item obscurity not working as intended. (#824) * fixes item obscurity * more fixes --- code/modules/clothing/under/skirt_dress.dm | 2 +- .../mob/living/carbon/carbon_update_icons.dm | 2 +- .../living/carbon/human/human_update_icons.dm | 183 +++++++++++------- 3 files changed, 115 insertions(+), 72 deletions(-) diff --git a/code/modules/clothing/under/skirt_dress.dm b/code/modules/clothing/under/skirt_dress.dm index 387612d7784a..ac1a4b37a4e5 100644 --- a/code/modules/clothing/under/skirt_dress.dm +++ b/code/modules/clothing/under/skirt_dress.dm @@ -38,7 +38,7 @@ icon_state = "wedding_dress" inhand_icon_state = "wedding_dress" body_parts_covered = CHEST|GROIN|LEGS - flags_cover = HIDESHOES + flags_inv = HIDESHOES supports_variations_flags = CLOTHING_DIGITIGRADE_VARIATION_NO_NEW_ICON | CLOTHING_TESHARI_VARIATION | CLOTHING_VOX_VARIATION /obj/item/clothing/under/dress/redeveninggown diff --git a/code/modules/mob/living/carbon/carbon_update_icons.dm b/code/modules/mob/living/carbon/carbon_update_icons.dm index 79bf1f2c1f2c..85f86cb37f26 100644 --- a/code/modules/mob/living/carbon/carbon_update_icons.dm +++ b/code/modules/mob/living/carbon/carbon_update_icons.dm @@ -29,7 +29,7 @@ update_worn_undersuit() if(slot_flags & ITEM_SLOT_SUITSTORE) update_suit_storage() - if(slot_flags & ITEM_SLOT_LPOCKET || slot_flags & ITEM_SLOT_RPOCKET) + if(slot_flags & (ITEM_SLOT_LPOCKET|ITEM_SLOT_RPOCKET)) update_pockets() diff --git a/code/modules/mob/living/carbon/human/human_update_icons.dm b/code/modules/mob/living/carbon/human/human_update_icons.dm index 5ad8a04883e7..292c16a9625a 100644 --- a/code/modules/mob/living/carbon/human/human_update_icons.dm +++ b/code/modules/mob/living/carbon/human/human_update_icons.dm @@ -84,7 +84,7 @@ There are several things that need to be remembered: var/obj/item/clothing/under/uniform = w_uniform update_hud_uniform(uniform) - if(wear_suit && (wear_suit.flags_inv & HIDEJUMPSUIT)) + if(check_obscured_slots() & ITEM_SLOT_ICLOTHING) return @@ -150,6 +150,10 @@ There are several things that need to be remembered: if(wear_id) var/obj/item/worn_item = wear_id update_hud_id(worn_item) + + if(check_obscured_slots() & ITEM_SLOT_ID) + return + var/handled_by_bodytype = TRUE var/icon_file @@ -194,6 +198,10 @@ There are several things that need to be remembered: if(gloves) var/obj/item/worn_item = gloves update_hud_gloves(worn_item) + + if(check_obscured_slots() & ITEM_SLOT_GLOVES) + return + var/icon_file var/handled_by_bodytype = TRUE if(dna.species.bodytype & BODYTYPE_TESHARI) @@ -240,31 +248,34 @@ There are several things that need to be remembered: var/mutable_appearance/glasses_overlay update_hud_glasses(worn_item) + if(check_obscured_slots() & ITEM_SLOT_EYES) + return + var/handled_by_bodytype = TRUE var/icon_file - if(!(head?.flags_inv & HIDEEYES) && !(wear_mask?.flags_inv & HIDEEYES)) - if(dna.species.bodytype & BODYTYPE_TESHARI) - if(glasses.supports_variations_flags & CLOTHING_TESHARI_VARIATION) - icon_file = TESHARI_EYES_FILE + if(dna.species.bodytype & BODYTYPE_TESHARI) + if(glasses.supports_variations_flags & CLOTHING_TESHARI_VARIATION) + icon_file = TESHARI_EYES_FILE - if(dna.species.bodytype & BODYTYPE_VOX_OTHER) - if(worn_item.supports_variations_flags & CLOTHING_VOX_VARIATION) - icon_file = worn_item.worn_icon_vox || VOX_EYES_FILE + if(dna.species.bodytype & BODYTYPE_VOX_OTHER) + if(worn_item.supports_variations_flags & CLOTHING_VOX_VARIATION) + icon_file = worn_item.worn_icon_vox || VOX_EYES_FILE - if(!icon_exists(icon_file, RESOLVE_ICON_STATE(worn_item))) - icon_file = 'icons/mob/clothing/eyes.dmi' - handled_by_bodytype = FALSE + if(!icon_exists(icon_file, RESOLVE_ICON_STATE(worn_item))) + icon_file = 'icons/mob/clothing/eyes.dmi' + handled_by_bodytype = FALSE - glasses_overlay = glasses.build_worn_icon( - src, - default_layer = GLASSES_LAYER, - default_icon_file = icon_file, - override_file = handled_by_bodytype ? icon_file : null, - fallback = handled_by_bodytype ? null : dna.species.fallback_clothing_path - ) + glasses_overlay = glasses.build_worn_icon( + src, + default_layer = GLASSES_LAYER, + default_icon_file = icon_file, + override_file = handled_by_bodytype ? icon_file : null, + fallback = handled_by_bodytype ? null : dna.species.fallback_clothing_path + ) if(!glasses_overlay) return + if(!handled_by_bodytype && (OFFSET_GLASSES in dna.species.offset_features)) glasses_overlay.pixel_x += dna.species.offset_features[OFFSET_GLASSES][1] glasses_overlay.pixel_y += dna.species.offset_features[OFFSET_GLASSES][2] @@ -287,6 +298,9 @@ There are several things that need to be remembered: var/mutable_appearance/ears_overlay update_hud_ears(worn_item) + if(check_obscured_slots() & ITEM_SLOT_EARS) + return + var/handled_by_bodytype = TRUE var/icon_file if(dna.species.bodytype & BODYTYPE_TESHARI) @@ -321,32 +335,35 @@ There are several things that need to be remembered: if(wear_neck) var/obj/item/worn_item = wear_neck update_hud_neck(wear_neck) - if(!(check_obscured_slots() & ITEM_SLOT_NECK)) - var/mutable_appearance/neck_overlay - var/icon_file - var/handled_by_bodytype = TRUE - if(dna.species.bodytype & BODYTYPE_TESHARI) - if(worn_item.supports_variations_flags & CLOTHING_TESHARI_VARIATION) - icon_file = TESHARI_NECK_FILE - if(!(icon_exists(icon_file, RESOLVE_ICON_STATE(worn_item)))) - handled_by_bodytype = FALSE - icon_file = 'icons/mob/clothing/neck.dmi' + if(check_obscured_slots() & ITEM_SLOT_NECK) + return - neck_overlay = worn_item.build_worn_icon( - src, - default_layer = NECK_LAYER, - default_icon_file = icon_file, - override_file = handled_by_bodytype ? icon_file : null, - fallback = handled_by_bodytype ? null : dna.species.fallback_clothing_path - ) + var/mutable_appearance/neck_overlay + var/icon_file + var/handled_by_bodytype = TRUE + if(dna.species.bodytype & BODYTYPE_TESHARI) + if(worn_item.supports_variations_flags & CLOTHING_TESHARI_VARIATION) + icon_file = TESHARI_NECK_FILE + + if(!(icon_exists(icon_file, RESOLVE_ICON_STATE(worn_item)))) + handled_by_bodytype = FALSE + icon_file = 'icons/mob/clothing/neck.dmi' + + neck_overlay = worn_item.build_worn_icon( + src, + default_layer = NECK_LAYER, + default_icon_file = icon_file, + override_file = handled_by_bodytype ? icon_file : null, + fallback = handled_by_bodytype ? null : dna.species.fallback_clothing_path + ) - if(!neck_overlay) - return - if(!handled_by_bodytype && (OFFSET_NECK in dna.species.offset_features)) - neck_overlay.pixel_x += dna.species.offset_features[OFFSET_NECK][1] - neck_overlay.pixel_y += dna.species.offset_features[OFFSET_NECK][2] - overlays_standing[NECK_LAYER] = neck_overlay + if(!neck_overlay) + return + if(!handled_by_bodytype && (OFFSET_NECK in dna.species.offset_features)) + neck_overlay.pixel_x += dna.species.offset_features[OFFSET_NECK][1] + neck_overlay.pixel_y += dna.species.offset_features[OFFSET_NECK][2] + overlays_standing[NECK_LAYER] = neck_overlay apply_overlay(NECK_LAYER) @@ -365,6 +382,10 @@ There are several things that need to be remembered: var/mutable_appearance/shoes_overlay var/icon_file update_hud_shoes(worn_item) + + if(check_obscured_slots() & ITEM_SLOT_FEET) + return + var/handled_by_bodytype = TRUE if((dna.species.bodytype & BODYTYPE_DIGITIGRADE) && (worn_item.supports_variations_flags & CLOTHING_DIGITIGRADE_VARIATION)) @@ -416,6 +437,9 @@ There are several things that need to be remembered: var/mutable_appearance/s_store_overlay update_hud_s_store(worn_item) + if(check_obscured_slots() & ITEM_SLOT_SUITSTORE) + return + s_store_overlay = worn_item.build_worn_icon(src, default_layer = SUIT_STORE_LAYER, default_icon_file = 'icons/mob/clothing/belt_mirror.dmi') if(!s_store_overlay) @@ -436,6 +460,10 @@ There are several things that need to be remembered: var/obj/item/worn_item = head var/mutable_appearance/head_overlay update_hud_head(worn_item) + + if(check_obscured_slots() & ITEM_SLOT_HEAD) + return + var/handled_by_bodytype = TRUE //PARIAH EDIT var/icon_file @@ -482,6 +510,10 @@ There are several things that need to be remembered: var/obj/item/worn_item = belt var/mutable_appearance/belt_overlay update_hud_belt(worn_item) + + if(check_obscured_slots() & ITEM_SLOT_BELT) + return + var/handled_by_bodytype = TRUE var/icon_file if(dna.species.bodytype & BODYTYPE_TESHARI) @@ -523,8 +555,11 @@ There are several things that need to be remembered: var/obj/item/worn_item = wear_suit var/mutable_appearance/suit_overlay update_hud_wear_suit(worn_item) - var/icon_file + if(check_obscured_slots() & ITEM_SLOT_OCLOTHING) + return + + var/icon_file var/handled_by_bodytype = TRUE //PARIAH EDIT @@ -532,6 +567,7 @@ There are several things that need to be remembered: if(dna.species.bodytype & BODYTYPE_DIGITIGRADE) if(worn_item.supports_variations_flags & CLOTHING_DIGITIGRADE_VARIATION) icon_file = wear_suit.worn_icon_digitigrade || DIGITIGRADE_SUIT_FILE //PARIAH EDIT + //PARIAH EDIT END if(dna.species.bodytype & BODYTYPE_TESHARI) if(worn_item.supports_variations_flags & CLOTHING_TESHARI_VARIATION) @@ -599,41 +635,43 @@ There are several things that need to be remembered: var/obj/item/worn_item = wear_mask update_hud_wear_mask(worn_item) - if(!(check_obscured_slots() & ITEM_SLOT_MASK)) - var/mutable_appearance/mask_overlay - var/icon_file - var/handled_by_bodytype = TRUE + if(check_obscured_slots() & ITEM_SLOT_MASK) + return + + var/mutable_appearance/mask_overlay + var/icon_file + var/handled_by_bodytype = TRUE - if(dna.species.bodytype & BODYTYPE_SNOUTED) - if(worn_item.supports_variations_flags & CLOTHING_SNOUTED_VARIATION) - icon_file = wear_mask.worn_icon_snouted || SNOUTED_MASK_FILE + if(dna.species.bodytype & BODYTYPE_SNOUTED) + if(worn_item.supports_variations_flags & CLOTHING_SNOUTED_VARIATION) + icon_file = wear_mask.worn_icon_snouted || SNOUTED_MASK_FILE - if(dna.species.bodytype & BODYTYPE_VOX_BEAK) - if(worn_item.supports_variations_flags & CLOTHING_VOX_VARIATION) - icon_file = worn_item.worn_icon_vox || VOX_MASK_FILE + if(dna.species.bodytype & BODYTYPE_VOX_BEAK) + if(worn_item.supports_variations_flags & CLOTHING_VOX_VARIATION) + icon_file = worn_item.worn_icon_vox || VOX_MASK_FILE - if(dna.species.bodytype & BODYTYPE_TESHARI) - if(worn_item.supports_variations_flags & CLOTHING_TESHARI_VARIATION) - icon_file = TESHARI_MASK_FILE + if(dna.species.bodytype & BODYTYPE_TESHARI) + if(worn_item.supports_variations_flags & CLOTHING_TESHARI_VARIATION) + icon_file = TESHARI_MASK_FILE - if(!(icon_exists(icon_file, RESOLVE_ICON_STATE(worn_item)))) - icon_file = 'icons/mob/clothing/mask.dmi' - handled_by_bodytype = FALSE + if(!(icon_exists(icon_file, RESOLVE_ICON_STATE(worn_item)))) + icon_file = 'icons/mob/clothing/mask.dmi' + handled_by_bodytype = FALSE - mask_overlay = wear_mask.build_worn_icon( - src, - default_layer = FACEMASK_LAYER, - default_icon_file = icon_file, - override_file = handled_by_bodytype ? icon_file : null - ) + mask_overlay = wear_mask.build_worn_icon( + src, + default_layer = FACEMASK_LAYER, + default_icon_file = icon_file, + override_file = handled_by_bodytype ? icon_file : null + ) - if(!mask_overlay) - return - if(!handled_by_bodytype && (OFFSET_FACEMASK in dna.species.offset_features)) - mask_overlay.pixel_x += dna.species.offset_features[OFFSET_FACEMASK][1] - mask_overlay.pixel_y += dna.species.offset_features[OFFSET_FACEMASK][2] + if(!mask_overlay) + return + if(!handled_by_bodytype && (OFFSET_FACEMASK in dna.species.offset_features)) + mask_overlay.pixel_x += dna.species.offset_features[OFFSET_FACEMASK][1] + mask_overlay.pixel_y += dna.species.offset_features[OFFSET_FACEMASK][2] - overlays_standing[FACEMASK_LAYER] = mask_overlay + overlays_standing[FACEMASK_LAYER] = mask_overlay apply_overlay(FACEMASK_LAYER) update_body_parts() //Snoots @@ -648,7 +686,12 @@ There are several things that need to be remembered: if(back) var/obj/item/worn_item = back var/mutable_appearance/back_overlay + update_hud_back(worn_item) + + if(check_obscured_slots() & ITEM_SLOT_BACK) + return + var/icon_file var/handled_by_bodytype = TRUE if(dna.species.bodytype & BODYTYPE_TESHARI)