From 12c4aa559021c7f1dad25bb53f89c589c46bcd44 Mon Sep 17 00:00:00 2001 From: ElorgRHG <71735193+ElorgRHG@users.noreply.github.com> Date: Fri, 21 Oct 2022 13:35:04 +0200 Subject: [PATCH] Removes the need to make handholes for jumpsuit sprites (#19058) * Handholes were kinda cringe * A mildly overengineered solution * Deconflict * Lobby gloves fix --- code/__DEFINES/misc.dm | 24 +++++----- code/modules/client/preference/character.dm | 44 +++++++++++++----- .../mob/living/carbon/human/update_icons.dm | 24 ++++++++-- icons/mob/clothing/masking_helpers.dmi | Bin 0 -> 369 bytes 4 files changed, 65 insertions(+), 27 deletions(-) create mode 100644 icons/mob/clothing/masking_helpers.dmi diff --git a/code/__DEFINES/misc.dm b/code/__DEFINES/misc.dm index 473831cee30..3dc9223bb57 100644 --- a/code/__DEFINES/misc.dm +++ b/code/__DEFINES/misc.dm @@ -163,18 +163,18 @@ //Human Overlays Indexes///////// #define WING_LAYER 41 -#define WING_UNDERLIMBS_LAYER 40 -#define BODY_LAYER 39 -#define MUTANTRACE_LAYER 38 -#define TAIL_UNDERLIMBS_LAYER 37 //Tail split-rendering. -#define LIMBS_LAYER 36 -#define INTORGAN_LAYER 35 -#define MARKINGS_LAYER 34 -#define UNDERWEAR_LAYER 33 -#define MUTATIONS_LAYER 32 -#define H_DAMAGE_LAYER 31 -#define UNIFORM_LAYER 30 -#define ID_LAYER 29 +#define WING_UNDERLIMBS_LAYER 40 +#define MUTANTRACE_LAYER 39 +#define TAIL_UNDERLIMBS_LAYER 38 //Tail split-rendering. +#define LIMBS_LAYER 37 +#define INTORGAN_LAYER 36 +#define MARKINGS_LAYER 35 +#define UNDERWEAR_LAYER 34 +#define MUTATIONS_LAYER 33 +#define H_DAMAGE_LAYER 32 +#define UNIFORM_LAYER 31 +#define ID_LAYER 30 +#define HANDS_LAYER 29 //Exists to overlay hands over jumpsuits #define SHOES_LAYER 28 #define GLOVES_LAYER 27 #define EARS_LAYER 26 diff --git a/code/modules/client/preference/character.dm b/code/modules/client/preference/character.dm index 0902f372af3..bb6829aad4c 100644 --- a/code/modules/client/preference/character.dm +++ b/code/modules/client/preference/character.dm @@ -823,6 +823,9 @@ else preview_icon.Blend(rgb(-s_tone, -s_tone, -s_tone), ICON_SUBTRACT) + var/icon/hands_icon = icon(preview_icon) + hands_icon.Blend(icon('icons/mob/clothing/masking_helpers.dmi', "hands_mask"), ICON_MULTIPLY) + // Body accessory if(current_species && (current_species.bodyflags & HAS_BODY_ACCESSORY)) var/icon @@ -969,6 +972,8 @@ socks_s = new/icon(u3_icon, "sk_[U3.icon_state]_s", ICON_OVERLAY) var/icon/clothes_s = null + var/has_gloves = FALSE + if(job_support_low & JOB_ASSISTANT) //This gives the preview icon clothes depending on which job(if any) is set to 'high' clothes_s = new /icon('icons/mob/clothing/under/color.dmi', "grey_s") clothes_s.Blend(new /icon('icons/mob/clothing/feet.dmi', "black"), ICON_UNDERLAY) @@ -1006,8 +1011,9 @@ if(JOB_BOTANIST) clothes_s = new /icon('icons/mob/clothing/under/civilian.dmi', "hydroponics_s") clothes_s.Blend(new /icon('icons/mob/clothing/feet.dmi', "black"), ICON_UNDERLAY) - clothes_s.Blend(new /icon('icons/mob/clothing/hands.dmi', "ggloves"), ICON_UNDERLAY) + clothes_s.Blend(new /icon('icons/mob/clothing/hands.dmi', "ggloves"), ICON_OVERLAY) clothes_s.Blend(new /icon('icons/mob/clothing/suit.dmi', "apron"), ICON_OVERLAY) + has_gloves = TRUE if(prob(1)) clothes_s.Blend(new /icon('icons/mob/clothing/head.dmi', "nymph"), ICON_OVERLAY) switch(backbag) @@ -1057,7 +1063,8 @@ if(JOB_QUARTERMASTER) clothes_s = new /icon('icons/mob/clothing/under/cargo.dmi', "qm_s") clothes_s.Blend(new /icon('icons/mob/clothing/feet.dmi', "brown"), ICON_UNDERLAY) - clothes_s.Blend(new /icon('icons/mob/clothing/hands.dmi', "bgloves"), ICON_UNDERLAY) + clothes_s.Blend(new /icon('icons/mob/clothing/hands.dmi', "bgloves"), ICON_OVERLAY) + has_gloves = TRUE if(prob(1)) clothes_s.Blend(new /icon('icons/mob/clothing/suit.dmi', "poncho"), ICON_OVERLAY) switch(backbag) @@ -1070,7 +1077,8 @@ if(JOB_CARGOTECH) clothes_s = new /icon('icons/mob/clothing/under/cargo.dmi', "cargo_s") clothes_s.Blend(new /icon('icons/mob/clothing/feet.dmi', "black"), ICON_UNDERLAY) - clothes_s.Blend(new /icon('icons/mob/clothing/hands.dmi', "bgloves"), ICON_UNDERLAY) + clothes_s.Blend(new /icon('icons/mob/clothing/hands.dmi', "bgloves"), ICON_OVERLAY) + has_gloves = TRUE if(prob(1)) clothes_s.Blend(new /icon('icons/mob/clothing/head.dmi', "flat_cap"), ICON_OVERLAY) switch(backbag) @@ -1083,7 +1091,8 @@ if(JOB_MINER) clothes_s = new /icon('icons/mob/clothing/under/cargo.dmi', "explorer_s") clothes_s.Blend(new /icon('icons/mob/clothing/feet.dmi', "explorer"), ICON_UNDERLAY) - clothes_s.Blend(new /icon('icons/mob/clothing/hands.dmi', "bgloves"), ICON_UNDERLAY) + clothes_s.Blend(new /icon('icons/mob/clothing/hands.dmi', "bgloves"), ICON_OVERLAY) + has_gloves = TRUE if(prob(1)) clothes_s.Blend(new /icon('icons/mob/clothing/head.dmi', "bearpelt"), ICON_OVERLAY) switch(backbag) @@ -1126,10 +1135,11 @@ if(JOB_MIME) clothes_s = new /icon('icons/mob/clothing/under/civilian.dmi', "mime_s") clothes_s.Blend(new /icon('icons/mob/clothing/feet.dmi', "black"), ICON_UNDERLAY) - clothes_s.Blend(new /icon('icons/mob/clothing/hands.dmi', "lgloves"), ICON_UNDERLAY) + clothes_s.Blend(new /icon('icons/mob/clothing/hands.dmi', "lgloves"), ICON_OVERLAY) clothes_s.Blend(new /icon('icons/mob/clothing/mask.dmi', "mime"), ICON_OVERLAY) clothes_s.Blend(new /icon('icons/mob/clothing/head.dmi', "beret"), ICON_OVERLAY) clothes_s.Blend(new /icon('icons/mob/clothing/suit.dmi', "suspenders"), ICON_OVERLAY) + has_gloves = TRUE switch(backbag) if(2) clothes_s.Blend(new /icon('icons/mob/clothing/back.dmi', "backpack"), ICON_OVERLAY) @@ -1274,8 +1284,9 @@ if(JOB_ROBOTICIST) clothes_s = new /icon('icons/mob/clothing/under/rnd.dmi', "robotics_s") clothes_s.Blend(new /icon('icons/mob/clothing/feet.dmi', "black"), ICON_UNDERLAY) - clothes_s.Blend(new /icon('icons/mob/clothing/hands.dmi', "bgloves"), ICON_UNDERLAY) + clothes_s.Blend(new /icon('icons/mob/clothing/hands.dmi', "bgloves"), ICON_OVERLAY) clothes_s.Blend(new /icon('icons/mob/clothing/suit.dmi', "labcoat_open"), ICON_OVERLAY) + has_gloves = TRUE if(prob(1)) clothes_s.Blend(new /icon('icons/mob/inhands/items_righthand.dmi', "toolbox_blue"), ICON_OVERLAY) switch(backbag) @@ -1305,7 +1316,8 @@ if(JOB_HOS) clothes_s = new /icon('icons/mob/clothing/under/security.dmi', "hosred_s") clothes_s.Blend(new /icon('icons/mob/clothing/feet.dmi', "jackboots"), ICON_UNDERLAY) - clothes_s.Blend(new /icon('icons/mob/clothing/hands.dmi', "bgloves"), ICON_UNDERLAY) + clothes_s.Blend(new /icon('icons/mob/clothing/hands.dmi', "bgloves"), ICON_OVERLAY) + has_gloves = TRUE if(prob(1)) clothes_s.Blend(new /icon('icons/mob/clothing/head.dmi', "beret_hos"), ICON_OVERLAY) switch(backbag) @@ -1321,7 +1333,8 @@ clothes_s.Blend(new /icon('icons/mob/clothing/feet.dmi', "slippers_worn"), ICON_OVERLAY) else clothes_s.Blend(new /icon('icons/mob/clothing/feet.dmi', "jackboots"), ICON_UNDERLAY) - clothes_s.Blend(new /icon('icons/mob/clothing/hands.dmi', "bgloves"), ICON_UNDERLAY) + clothes_s.Blend(new /icon('icons/mob/clothing/hands.dmi', "bgloves"), ICON_OVERLAY) + has_gloves = TRUE switch(backbag) if(2) clothes_s.Blend(new /icon('icons/mob/clothing/back.dmi', "securitypack"), ICON_OVERLAY) @@ -1332,11 +1345,12 @@ if(JOB_DETECTIVE) clothes_s = new /icon('icons/mob/clothing/under/security.dmi', "detective_s") clothes_s.Blend(new /icon('icons/mob/clothing/feet.dmi', "brown"), ICON_UNDERLAY) - clothes_s.Blend(new /icon('icons/mob/clothing/hands.dmi', "bgloves"), ICON_UNDERLAY) + clothes_s.Blend(new /icon('icons/mob/clothing/hands.dmi', "bgloves"), ICON_OVERLAY) if(prob(1)) clothes_s.Blend(new /icon('icons/mob/clothing/mask.dmi', "cigaron"), ICON_OVERLAY) clothes_s.Blend(new /icon('icons/mob/clothing/head.dmi', "detective"), ICON_OVERLAY) clothes_s.Blend(new /icon('icons/mob/clothing/suit.dmi', "detective"), ICON_OVERLAY) + has_gloves = TRUE switch(backbag) if(2) clothes_s.Blend(new /icon('icons/mob/clothing/back.dmi', "backpack"), ICON_OVERLAY) @@ -1359,9 +1373,10 @@ if(JOB_CHIEF) clothes_s = new /icon('icons/mob/clothing/under/engineering.dmi', "chief_s") clothes_s.Blend(new /icon('icons/mob/clothing/feet.dmi', "brown"), ICON_UNDERLAY) - clothes_s.Blend(new /icon('icons/mob/clothing/hands.dmi', "bgloves"), ICON_UNDERLAY) + clothes_s.Blend(new /icon('icons/mob/clothing/hands.dmi', "bgloves"), ICON_OVERLAY) clothes_s.Blend(new /icon('icons/mob/clothing/belt.dmi', "utility"), ICON_OVERLAY) clothes_s.Blend(new /icon('icons/mob/clothing/head.dmi', "hardhat0_white"), ICON_OVERLAY) + has_gloves = TRUE if(prob(1)) clothes_s.Blend(new /icon('icons/mob/inhands/items_righthand.dmi', "blueprints"), ICON_OVERLAY) switch(backbag) @@ -1388,8 +1403,9 @@ if(JOB_ATMOSTECH) clothes_s = new /icon('icons/mob/clothing/under/engineering.dmi', "atmos_s") clothes_s.Blend(new /icon('icons/mob/clothing/feet.dmi', "black"), ICON_UNDERLAY) - clothes_s.Blend(new /icon('icons/mob/clothing/hands.dmi', "bgloves"), ICON_UNDERLAY) + clothes_s.Blend(new /icon('icons/mob/clothing/hands.dmi', "bgloves"), ICON_OVERLAY) clothes_s.Blend(new /icon('icons/mob/clothing/belt.dmi', "utility"), ICON_OVERLAY) + has_gloves = TRUE if(prob(1)) clothes_s.Blend(new /icon('icons/mob/clothing/suit.dmi', "firesuit"), ICON_OVERLAY) switch(backbag) @@ -1443,8 +1459,9 @@ if(JOB_BLUESHIELD) clothes_s = new /icon('icons/mob/clothing/under/centcom.dmi', "officer_s") clothes_s.Blend(new /icon('icons/mob/clothing/feet.dmi', "jackboots"), ICON_UNDERLAY) - clothes_s.Blend(new /icon('icons/mob/clothing/hands.dmi', "swat_gl"), ICON_UNDERLAY) + clothes_s.Blend(new /icon('icons/mob/clothing/hands.dmi', "swat_gl"), ICON_OVERLAY) clothes_s.Blend(new /icon('icons/mob/clothing/suit.dmi', "blueshield"), ICON_OVERLAY) + has_gloves = TRUE switch(backbag) if(2) clothes_s.Blend(new /icon('icons/mob/clothing/back.dmi', "securitypack"), ICON_OVERLAY) @@ -1473,6 +1490,9 @@ preview_icon.Blend(socks_s, ICON_OVERLAY) if(clothes_s) preview_icon.Blend(clothes_s, ICON_OVERLAY) + if(!has_gloves) + preview_icon.Blend(hands_icon, ICON_OVERLAY) + preview_icon.Blend(face_s, ICON_OVERLAY) preview_icon_front = new(preview_icon, dir = SOUTH) preview_icon_side = new(preview_icon, dir = WEST) diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index 867c8dcb9ee..e81eb51c87c 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -165,7 +165,6 @@ GLOBAL_LIST_EMPTY(damage_icon_parts) //BASE MOB SPRITE /mob/living/carbon/human/proc/update_body(rebuild_base = FALSE) - remove_overlay(BODY_LAYER) remove_overlay(LIMBS_LAYER) // So we don't get the old species' sprite splatted on top of the new one's remove_overlay(UNDERWEAR_LAYER) @@ -273,8 +272,6 @@ GLOBAL_LIST_EMPTY(damage_icon_parts) overlays_standing[UNDERWEAR_LAYER] = mutable_appearance(underwear_standing, layer = -UNDERWEAR_LAYER) apply_overlay(UNDERWEAR_LAYER) - overlays_standing[BODY_LAYER] = standing - apply_overlay(BODY_LAYER) //tail update_tail_layer() update_wing_layer() @@ -407,6 +404,26 @@ GLOBAL_LIST_EMPTY(damage_icon_parts) overlays_standing[HAIR_LAYER] = MA apply_overlay(HAIR_LAYER) +//HANDS OVERLAY +//Exists to stop the need to cut holes in jumpsuit sprites +/mob/living/carbon/human/proc/update_hands_layer() + remove_overlay(HANDS_LAYER) + + var/mutable_appearance/hands_appearance = new() + hands_appearance.layer = -HANDS_LAYER + + var/obj/item/organ/external/hand/l_hand = get_limb_by_name("l_hand") + var/obj/item/organ/external/hand/right/r_hand = get_limb_by_name("r_hand") + + if(l_hand) + hands_appearance.overlays += l_hand.mob_icon + if(r_hand) + hands_appearance.overlays += r_hand.mob_icon + + overlays_standing[HANDS_LAYER] = hands_appearance + + apply_overlay(HANDS_LAYER) + //FACIAL HAIR OVERLAY /mob/living/carbon/human/proc/update_fhair() //Reset our facial hair @@ -531,6 +548,7 @@ GLOBAL_LIST_EMPTY(damage_icon_parts) update_inv_wear_pda() UpdateDamageIcon() force_update_limbs() + update_hands_layer() update_tail_layer() update_wing_layer() update_halo_layer() diff --git a/icons/mob/clothing/masking_helpers.dmi b/icons/mob/clothing/masking_helpers.dmi new file mode 100644 index 0000000000000000000000000000000000000000..ee098b3ba75e49825457b92034a82a7f02156112 GIT binary patch literal 369 zcmV-%0gnEOP)fFDZ*Bkpc$`yKaB_9`^iy#0 z_2eo`Eh^5;&r`5fFwryM;w;ZhDainGjE%TBGg33tGfE(w;*!LYR3K9+BQYYE64FKIx949?20L=gZ0G>%iK~yM_m61CR z!Y~j-2c-y|j}UIcaX1F#X5=PGLyJ3HSQ&N%{vcT>vGk-Te`nX=cc3BhN&$v51?UF~ zaCQ`x0Sc_ABSn$MTU%r?S+>e#2`42SE#cVJ@~=NuX;h`b zY7eU2+lAi!NT2$XW`awN%BLhLyzlqQQ}SxcLpNXQC-ggU*exk)3ICBd(p7`EGBPfv P00000NkvXXu0mjf+PaY) literal 0 HcmV?d00001