From 8a56be0e41841e9f5babc87a63af433e88a51fe7 Mon Sep 17 00:00:00 2001 From: MrMelbert <51863163+MrMelbert@users.noreply.github.com> Date: Mon, 26 Dec 2022 18:05:58 -0600 Subject: [PATCH] Cherry-picks hide flags fix (#205) --- code/modules/clothing/under/skirt_dress.dm | 2 +- .../mob/living/carbon/carbon_update_icons.dm | 2 +- .../living/carbon/human/human_update_icons.dm | 176 ++++++++---------- code/modules/unit_tests/inhands.dm | 2 +- .../screenshot_antag_icons_abductor.png | Bin 885 -> 883 bytes .../noble_equipment/code/nobleclothing.dm | 2 +- 6 files changed, 82 insertions(+), 102 deletions(-) diff --git a/code/modules/clothing/under/skirt_dress.dm b/code/modules/clothing/under/skirt_dress.dm index 62dd8182353e..76558b3e00c4 100644 --- a/code/modules/clothing/under/skirt_dress.dm +++ b/code/modules/clothing/under/skirt_dress.dm @@ -25,7 +25,7 @@ icon_state = "wedding_dress" inhand_icon_state = null body_parts_covered = CHEST|GROIN|LEGS - flags_cover = HIDESHOES + flags_inv = HIDESHOES /obj/item/clothing/under/dress/redeveninggown name = "red evening gown" diff --git a/code/modules/mob/living/carbon/carbon_update_icons.dm b/code/modules/mob/living/carbon/carbon_update_icons.dm index 9001e51d98ca..05b7805f25e5 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() //IMPORTANT: Multiple animate() calls do not stack well, so try to do them all at once if you can. 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 c68aeeef8a51..2fa3a91a78d7 100644 --- a/code/modules/mob/living/carbon/human/human_update_icons.dm +++ b/code/modules/mob/living/carbon/human/human_update_icons.dm @@ -84,16 +84,14 @@ 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(transparent_protection = TRUE) & ITEM_SLOT_ICLOTHING) return - var/target_overlay = uniform.icon_state if(uniform.adjusted == ALT_STYLE) target_overlay = "[target_overlay]_d" var/mutable_appearance/uniform_overlay - //This is how non-humanoid clothing works. You check if the mob has the right bodyflag, and the clothing has the corresponding clothing flag. //handled_by_bodytype is used to track whether or not we successfully used an alternate sprite. It's set to TRUE to ease up on copy-paste. //icon_file MUST be set to null by default, or it causes issues. @@ -103,34 +101,33 @@ There are several things that need to be remembered: var/handled_by_bodytype = TRUE var/icon_file var/woman - if(!uniform_overlay) - //BEGIN SPECIES HANDLING - if((dna?.species.bodytype & BODYTYPE_MONKEY) && (uniform.supports_variations_flags & CLOTHING_MONKEY_VARIATION)) - icon_file = MONKEY_UNIFORM_FILE - else if((dna?.species.bodytype & BODYTYPE_DIGITIGRADE) && (uniform.supports_variations_flags & CLOTHING_DIGITIGRADE_VARIATION)) - // NON-MODULE CHANGE kapu why - if(uniform.greyscale_config_worn && uniform.digitigrade_greyscale_config_worn && uniform.greyscale_colors) - icon_file = SSgreyscale.GetColoredIconByType(uniform.digitigrade_greyscale_config_worn, uniform.greyscale_colors) - else - icon_file = uniform.digitigrade_file - // NON-MODULE CHANGE END - //Female sprites have lower priority than digitigrade sprites - else if(dna.species.sexes && (dna.species.bodytype & BODYTYPE_HUMANOID) && physique == FEMALE && !(uniform.female_sprite_flags & NO_FEMALE_UNIFORM)) //Agggggggghhhhh - woman = TRUE - - if(!icon_exists(icon_file, RESOLVE_ICON_STATE(uniform))) - icon_file = DEFAULT_UNIFORM_FILE - handled_by_bodytype = FALSE - - //END SPECIES HANDLING - uniform_overlay = uniform.build_worn_icon( - default_layer = UNIFORM_LAYER, - default_icon_file = icon_file, - isinhands = FALSE, - female_uniform = woman ? uniform.female_sprite_flags : null, - override_state = target_overlay, - override_file = handled_by_bodytype ? icon_file : null, - ) + //BEGIN SPECIES HANDLING + if((dna?.species.bodytype & BODYTYPE_MONKEY) && (uniform.supports_variations_flags & CLOTHING_MONKEY_VARIATION)) + icon_file = MONKEY_UNIFORM_FILE + else if((dna?.species.bodytype & BODYTYPE_DIGITIGRADE) && (uniform.supports_variations_flags & CLOTHING_DIGITIGRADE_VARIATION)) + // NON-MODULE CHANGE kapu why + if(uniform.greyscale_config_worn && uniform.digitigrade_greyscale_config_worn && uniform.greyscale_colors) + icon_file = SSgreyscale.GetColoredIconByType(uniform.digitigrade_greyscale_config_worn, uniform.greyscale_colors) + else + icon_file = uniform.digitigrade_file + // NON-MODULE CHANGE END + //Female sprites have lower priority than digitigrade sprites + else if(dna.species.sexes && (dna.species.bodytype & BODYTYPE_HUMANOID) && physique == FEMALE && !(uniform.female_sprite_flags & NO_FEMALE_UNIFORM)) //Agggggggghhhhh + woman = TRUE + + if(!icon_exists(icon_file, RESOLVE_ICON_STATE(uniform))) + icon_file = DEFAULT_UNIFORM_FILE + handled_by_bodytype = FALSE + + //END SPECIES HANDLING + uniform_overlay = uniform.build_worn_icon( + default_layer = UNIFORM_LAYER, + default_icon_file = icon_file, + isinhands = FALSE, + female_uniform = woman ? uniform.female_sprite_flags : null, + override_state = target_overlay, + override_file = handled_by_bodytype ? icon_file : null, + ) if(OFFSET_UNIFORM in dna.species.offset_features) uniform_overlay?.pixel_x += dna.species.offset_features[OFFSET_UNIFORM][1] @@ -190,19 +187,18 @@ There are several things that need to be remembered: add_overlay(bloody_overlay) //Bloody hands end - var/mutable_appearance/gloves_overlay if(gloves) var/obj/item/worn_item = gloves update_hud_gloves(worn_item) - var/icon_file + if(check_obscured_slots(transparent_protection = TRUE) & ITEM_SLOT_GLOVES) + return + + var/icon_file if(!icon_exists(icon_file, RESOLVE_ICON_STATE(worn_item))) icon_file = 'icons/mob/clothing/hands.dmi' - gloves_overlay = gloves.build_worn_icon(default_layer = GLOVES_LAYER, default_icon_file = icon_file) - - if(!gloves_overlay) - return + var/mutable_appearance/gloves_overlay = gloves.build_worn_icon(default_layer = GLOVES_LAYER, default_icon_file = icon_file) if(OFFSET_GLOVES in dna.species.offset_features) gloves_overlay.pixel_x += dna.species.offset_features[OFFSET_GLOVES][1] gloves_overlay.pixel_y += dna.species.offset_features[OFFSET_GLOVES][2] @@ -222,19 +218,16 @@ There are several things that need to be remembered: if(glasses) var/obj/item/worn_item = glasses - var/mutable_appearance/glasses_overlay update_hud_glasses(worn_item) - var/icon_file - if(!(head?.flags_inv & HIDEEYES) && !(wear_mask?.flags_inv & HIDEEYES)) - - if(!icon_exists(icon_file, RESOLVE_ICON_STATE(worn_item))) - icon_file = 'icons/mob/clothing/eyes.dmi' + if(check_obscured_slots(transparent_protection = TRUE) & ITEM_SLOT_EYES) + return - glasses_overlay = glasses.build_worn_icon(default_layer = GLASSES_LAYER, default_icon_file = icon_file) + var/icon_file + if(!icon_exists(icon_file, RESOLVE_ICON_STATE(worn_item))) + icon_file = 'icons/mob/clothing/eyes.dmi' - if(!glasses_overlay) - return + var/mutable_appearance/glasses_overlay = glasses.build_worn_icon(default_layer = GLASSES_LAYER, default_icon_file = icon_file) if(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] @@ -254,18 +247,16 @@ There are several things that need to be remembered: if(ears) var/obj/item/worn_item = ears - var/mutable_appearance/ears_overlay update_hud_ears(worn_item) - var/icon_file + if(check_obscured_slots(transparent_protection = TRUE) & ITEM_SLOT_EARS) + return + var/icon_file if(!(icon_exists(icon_file, RESOLVE_ICON_STATE(worn_item)))) icon_file = 'icons/mob/clothing/ears.dmi' - ears_overlay = ears.build_worn_icon(default_layer = EARS_LAYER, default_icon_file = icon_file) - - if(!ears_overlay) - return + var/mutable_appearance/ears_overlay = ears.build_worn_icon(default_layer = EARS_LAYER, default_icon_file = icon_file) if(OFFSET_EARS in dna.species.offset_features) ears_overlay.pixel_x += dna.species.offset_features[OFFSET_EARS][1] ears_overlay.pixel_y += dna.species.offset_features[OFFSET_EARS][2] @@ -282,21 +273,19 @@ 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(!(ITEM_SLOT_NECK & check_obscured_slots())) - var/mutable_appearance/neck_overlay - var/icon_file - if(!(icon_exists(icon_file, RESOLVE_ICON_STATE(worn_item)))) - icon_file = 'icons/mob/clothing/neck.dmi' + if(check_obscured_slots(transparent_protection = TRUE) & ITEM_SLOT_NECK) + return - neck_overlay = worn_item.build_worn_icon(default_layer = NECK_LAYER, default_icon_file = icon_file) + var/icon_file + if(!(icon_exists(icon_file, RESOLVE_ICON_STATE(worn_item)))) + icon_file = 'icons/mob/clothing/neck.dmi' - if(!neck_overlay) - return - if(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 + var/mutable_appearance/neck_overlay = worn_item.build_worn_icon(default_layer = NECK_LAYER, default_icon_file = icon_file) + if(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) @@ -312,10 +301,12 @@ There are several things that need to be remembered: if(shoes) var/obj/item/worn_item = shoes - var/mutable_appearance/shoes_overlay - var/icon_file update_hud_shoes(worn_item) + if(check_obscured_slots(transparent_protection = TRUE) & ITEM_SLOT_FEET) + return + + var/icon_file // NON-MODULE CHANGE becuase kapu why if((dna.species.bodytype & BODYTYPE_DIGITIGRADE) && (worn_item.supports_variations_flags & CLOTHING_DIGITIGRADE_VARIATION)) var/obj/item/bodypart/leg = src.get_bodypart(BODY_ZONE_L_LEG) @@ -326,8 +317,7 @@ There are several things that need to be remembered: if(!(icon_exists(icon_file, RESOLVE_ICON_STATE(worn_item)))) icon_file = DEFAULT_SHOES_FILE - shoes_overlay = shoes.build_worn_icon(default_layer = SHOES_LAYER, default_icon_file = icon_file) - + var/mutable_appearance/shoes_overlay = shoes.build_worn_icon(default_layer = SHOES_LAYER, default_icon_file = icon_file) if(!shoes_overlay) return if(OFFSET_SHOES in dna.species.offset_features) @@ -349,13 +339,12 @@ There are several things that need to be remembered: if(s_store) var/obj/item/worn_item = s_store - var/mutable_appearance/s_store_overlay update_hud_s_store(worn_item) - s_store_overlay = worn_item.build_worn_icon(default_layer = SUIT_STORE_LAYER, default_icon_file = 'icons/mob/clothing/belt_mirror.dmi') - - if(!s_store_overlay) + if(check_obscured_slots(transparent_protection = TRUE) & ITEM_SLOT_SUITSTORE) return + + var/mutable_appearance/s_store_overlay = worn_item.build_worn_icon(default_layer = SUIT_STORE_LAYER, default_icon_file = 'icons/mob/clothing/belt_mirror.dmi') if(OFFSET_S_STORE in dna.species.offset_features) s_store_overlay.pixel_x += dna.species.offset_features[OFFSET_S_STORE][1] s_store_overlay.pixel_y += dna.species.offset_features[OFFSET_S_STORE][2] @@ -370,17 +359,16 @@ There are several things that need to be remembered: if(head) var/obj/item/worn_item = head - var/mutable_appearance/head_overlay update_hud_head(worn_item) - var/icon_file + if(check_obscured_slots(transparent_protection = TRUE) & ITEM_SLOT_HEAD) + return + + var/icon_file if(!(icon_exists(icon_file, RESOLVE_ICON_STATE(worn_item)))) icon_file = 'icons/mob/clothing/head/default.dmi' - head_overlay = head.build_worn_icon(default_layer = HEAD_LAYER, default_icon_file = icon_file) - - if(!head_overlay) - return + var/mutable_appearance/head_overlay = head.build_worn_icon(default_layer = HEAD_LAYER, default_icon_file = icon_file) if(OFFSET_HEAD in dna.species.offset_features) head_overlay.pixel_x += dna.species.offset_features[OFFSET_HEAD][1] head_overlay.pixel_y += dna.species.offset_features[OFFSET_HEAD][2] @@ -398,17 +386,16 @@ There are several things that need to be remembered: if(belt) var/obj/item/worn_item = belt - var/mutable_appearance/belt_overlay update_hud_belt(worn_item) - var/icon_file + if(check_obscured_slots(transparent_protection = TRUE) & ITEM_SLOT_BELT) + return + + var/icon_file if(!(icon_exists(icon_file, RESOLVE_ICON_STATE(worn_item)))) icon_file = 'icons/mob/clothing/belt.dmi' - belt_overlay = belt.build_worn_icon(default_layer = BELT_LAYER, default_icon_file = icon_file) - - if(!belt_overlay) - return + var/mutable_appearance/belt_overlay = belt.build_worn_icon(default_layer = BELT_LAYER, default_icon_file = icon_file) if(OFFSET_BELT in dna.species.offset_features) belt_overlay.pixel_x += dna.species.offset_features[OFFSET_BELT][1] belt_overlay.pixel_y += dna.species.offset_features[OFFSET_BELT][2] @@ -425,7 +412,6 @@ There are several things that need to be remembered: if(wear_suit) var/obj/item/worn_item = wear_suit - var/mutable_appearance/suit_overlay update_hud_wear_suit(worn_item) var/icon_file @@ -438,10 +424,7 @@ There are several things that need to be remembered: if(!(icon_exists(icon_file, RESOLVE_ICON_STATE(worn_item)))) icon_file = DEFAULT_SUIT_FILE - suit_overlay = wear_suit.build_worn_icon(default_layer = SUIT_LAYER, default_icon_file = icon_file) - - if(!suit_overlay) - return + var/mutable_appearance/suit_overlay = wear_suit.build_worn_icon(default_layer = SUIT_LAYER, default_icon_file = icon_file) if(OFFSET_SUIT in dna.species.offset_features) suit_overlay.pixel_x += dna.species.offset_features[OFFSET_SUIT][1] suit_overlay.pixel_y += dna.species.offset_features[OFFSET_SUIT][2] @@ -486,18 +469,15 @@ There are several things that need to be remembered: if(wear_mask) var/obj/item/worn_item = wear_mask update_hud_wear_mask(worn_item) - var/mutable_appearance/mask_overlay - var/icon_file = 'icons/mob/clothing/mask.dmi' - - if(!(ITEM_SLOT_MASK & check_obscured_slots())) - if(!(icon_exists(icon_file, RESOLVE_ICON_STATE(worn_item)))) - icon_file = 'icons/mob/clothing/mask.dmi' + if(check_obscured_slots(transparent_protection = TRUE) & ITEM_SLOT_MASK) + return - mask_overlay = wear_mask.build_worn_icon(default_layer = FACEMASK_LAYER, default_icon_file = icon_file) + var/icon_file = 'icons/mob/clothing/mask.dmi' + if(!(icon_exists(icon_file, RESOLVE_ICON_STATE(worn_item)))) + icon_file = 'icons/mob/clothing/mask.dmi' - if(!mask_overlay) - return + var/mutable_appearance/mask_overlay = wear_mask.build_worn_icon(default_layer = FACEMASK_LAYER, default_icon_file = icon_file) if(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] diff --git a/code/modules/unit_tests/inhands.dm b/code/modules/unit_tests/inhands.dm index 90f36350e35c..1641f16a69f1 100644 --- a/code/modules/unit_tests/inhands.dm +++ b/code/modules/unit_tests/inhands.dm @@ -6,7 +6,7 @@ /// additional_inhands_location is for downstream modularity support. as an example, for skyrat's usage, set additional_inhands_location = "modular_skyrat/master_files/icons/mob/inhands/" /// Make sure this location is also present in tools/deploy.sh /// If you need additional paths ontop of this second one, you can add another generate_possible_icon_states_list("your/folder/path/inhands/") below the if(additional_inhands_location) block in Run(), and make sure to add that path to tools/deploy.sh as well. - var/additional_inhands_location = null + var/additional_inhands_location = "maplestation_modules/" // NON-MODULE CHANGE /datum/unit_test/defined_inhand_icon_states/proc/generate_possible_icon_states_list(directory_path) if(!directory_path) diff --git a/code/modules/unit_tests/screenshots/screenshot_antag_icons_abductor.png b/code/modules/unit_tests/screenshots/screenshot_antag_icons_abductor.png index 67220602607711458cb1514e634f062697bb0471..613358f5d1de1654c8d40da392dbe437bfd0b52f 100644 GIT binary patch delta 611 zcmV-p0-XKz2J;56907kqNklW!1Ac80YBLDw4dd}<#n_6k> zi!-;g=Ox)}az2JMOUh&t3WY+UQ0O;xb=JrMe_TH_zCNoH6o5_uU2j}N7)4Rsy6B#T zNRA3nmgOCE55b%bA`F%n&8LvQ?c0`=z?1+C0z5#l`wLYN%+-G-vVA0`ChTE>IrOPa zbXHfR+UEfD0{%gDT`O047rpx8MstF5swRu0NTN3az-%_-be#hVuIhE313}VuG&S{) zAAnwfF=oanYgeDSGrmA%UiqB=A25d&i$(2UzP18`3nssHrWbOw;IPC6sM4qPc%3+wMxvGl)s%N(P`GfErE@G~Cjq3(=J)Ig$Yo@hl;iRsZI1sgk1t zP){z6WJxi|@+9rDyPWQM9JPf3=m%hS=Ft|Da%=*Ywz6rSLu}zV06f>L)v7%WgR8lU z2!xGM^P~~0$c3hV>Ds~o^aHg1B0xTD*6X#JwLX?ED5`%xy04^KWK}x={Q#YuP5|aS zLz~Tp(Z*W6%e+8>=*NK3D`fc*0C0&GAbX7UC?|m4PO|^o^mZahx=(u~0B`64=mlVE z2B5avt$GPyckNmX{+Wd64chH?d+E*e>Ov9&BLLuQ;)8uS9BB0pp%Sn`guw%o{&q+J zTQF#MJRV#3t`A6E0+0;AAb@I7rzZBlvtG@401(kf06zVGfKn~8WB>*OvLb|omPG=5 xuWX^$B1Q!G!qEUyEjpb}>J0_>!nE=i0iU)c6B*w}CQbkV002ovPDHLkV1mkp7T5p) delta 613 zcmV-r0-F8v2K5H8907ksNklZZHRQG9*1mF!l0G$9# zO#swpvr(@C*j>96gMTI=dV{vx?Ys15dUYX*fdK&UHSxjT?RK>KfKUn8Aj05|Nq;*e zfGrrb+wWcX@2*csT>_8{Kreu5QL9Gwzq4M=c>oa6M*u$ket@c4WXS;Z1|&rY2Q7&N zIIU!%*CIv)_`<;es#