From 6e4880e484f475c137a60256cbeaa5a80750cdaf Mon Sep 17 00:00:00 2001 From: Casper3667 Date: Tue, 17 Aug 2021 17:08:55 +0200 Subject: [PATCH] Adds new wrist layers (#12279) --- .../objects/items/devices/radio/headset.dm | 12 ++++ code/modules/clothing/glasses/glasses.dm | 1 + code/modules/clothing/wrists/wrists.dm | 10 +++ .../mob/living/carbon/human/update_icons.dm | 61 ++++++++++++------- html/changelogs/LayerChanges.yml | 7 +++ 5 files changed, 69 insertions(+), 22 deletions(-) create mode 100644 html/changelogs/LayerChanges.yml diff --git a/code/game/objects/items/devices/radio/headset.dm b/code/game/objects/items/devices/radio/headset.dm index 644cc699a0d..e92be9603a8 100644 --- a/code/game/objects/items/devices/radio/headset.dm +++ b/code/game/objects/items/devices/radio/headset.dm @@ -188,8 +188,20 @@ item_state = "wristset" slot_flags = SLOT_WRISTS canhear_range = 1 + var/normal_layer = TRUE EarSound = FALSE +/obj/item/device/radio/headset/wrist/verb/change_layer() + set category = "Object" + set name = "Change Wrist Layer" + set src in usr + + normal_layer = !normal_layer + to_chat(usr, SPAN_NOTICE("\The [src] will now layer [normal_layer ? "under" : "over"] your outerwear.")) + if (ismob(src.loc)) + var/mob/M = src.loc + M.update_inv_wrists() + /* * Civillian */ diff --git a/code/modules/clothing/glasses/glasses.dm b/code/modules/clothing/glasses/glasses.dm index ff234238435..1ecfb3232c7 100644 --- a/code/modules/clothing/glasses/glasses.dm +++ b/code/modules/clothing/glasses/glasses.dm @@ -51,6 +51,7 @@ BLIND // can't see anything normal_layer = !normal_layer to_chat(usr, SPAN_NOTICE("\The [src] will now layer [normal_layer ? "under" : "over"] your hair.")) + update_clothing_icon() /obj/item/clothing/glasses/protects_eyestab(var/obj/stab_item, var/stabbed = FALSE) if(stabbed && (body_parts_covered & EYES) && !(item_flags & THICKMATERIAL) && shatter_material && prob(stab_item.force * 5)) diff --git a/code/modules/clothing/wrists/wrists.dm b/code/modules/clothing/wrists/wrists.dm index ee19c8afab2..3cf62e2f561 100644 --- a/code/modules/clothing/wrists/wrists.dm +++ b/code/modules/clothing/wrists/wrists.dm @@ -12,6 +12,7 @@ pickup_sound = 'sound/items/pickup/accessory.ogg' siemens_coefficient = 1.0 var/flipped = 0 + var/normal_layer = TRUE /obj/item/clothing/wrists/update_clothing_icon() if (ismob(src.loc)) @@ -45,6 +46,15 @@ playsound(src, drop_sound, DROP_SOUND_VOLUME) update_clothing_icon() +/obj/item/clothing/wrists/proc/change_layer() + set category = "Object" + set name = "Change Wrist Layer" + set src in usr + + normal_layer = !normal_layer + to_chat(usr, SPAN_NOTICE("\The [src] will now layer [normal_layer ? "under" : "over"] your outerwear.")) + update_clothing_icon() + /obj/item/clothing/wrists/bracelet name = "bracelet" desc = "Made out of some synthetic polymer. Management encourages you to not ask questions." diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index 9be6680cc70..414aa592da4 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -96,27 +96,28 @@ There are several things that need to be remembered: #define SHOES_LAYER 9 #define GLOVES_LAYER 10 #define BELT_LAYER 11 -#define SUIT_LAYER 12 -#define ID_LAYER_ALT 13 -#define TAIL_NORTH_LAYER 14 -#define GLASSES_LAYER 15 -#define BELT_LAYER_ALT 16 -#define SUIT_STORE_LAYER 17 -#define BACK_LAYER 18 -#define HAIR_LAYER 19 -#define GLASSES_LAYER_ALT 20 -#define L_EAR_LAYER 21 -#define R_EAR_LAYER 22 -#define FACEMASK_LAYER 23 -#define HEAD_LAYER 24 -#define COLLAR_LAYER 25 -#define HANDCUFF_LAYER 26 -#define LEGCUFF_LAYER 27 -#define L_HAND_LAYER 28 -#define R_HAND_LAYER 29 -#define WRISTS_LAYER 30 -#define FIRE_LAYER 31 //If you're on fire -#define TOTAL_LAYERS 31 +#define WRISTS_LAYER_ALT 12 +#define SUIT_LAYER 13 +#define ID_LAYER_ALT 14 +#define TAIL_NORTH_LAYER 15 +#define GLASSES_LAYER 16 +#define BELT_LAYER_ALT 17 +#define SUIT_STORE_LAYER 18 +#define BACK_LAYER 19 +#define HAIR_LAYER 20 +#define GLASSES_LAYER_ALT 21 +#define L_EAR_LAYER 22 +#define R_EAR_LAYER 23 +#define FACEMASK_LAYER 24 +#define HEAD_LAYER 25 +#define COLLAR_LAYER 26 +#define HANDCUFF_LAYER 27 +#define LEGCUFF_LAYER 28 +#define L_HAND_LAYER 29 +#define R_HAND_LAYER 30 +#define WRISTS_LAYER 31 +#define FIRE_LAYER 32 //If you're on fire +#define TOTAL_LAYERS 32 ////////////////////////////////// #define GET_BODY_TYPE (cached_bodytype || (cached_bodytype = species.get_bodytype())) @@ -1165,7 +1166,22 @@ There are several things that need to be remembered: else mob_icon = INV_WRISTS_DEF_ICON - overlays_raw[WRISTS_LAYER] = wrists.get_mob_overlay(src, mob_icon, mob_state, slot_wrists_str) + var/image/wrists_overlay = wrists.get_mob_overlay(src, mob_icon, mob_state, slot_wrists_str) + + var/normal_layer = TRUE + if(istype(wrists, /obj/item/clothing/wrists) || istype(wrists, /obj/item/device/radio/headset/wrist)) + var/obj/item/clothing/wrists/W = wrists + normal_layer = W.normal_layer + + if(normal_layer) + overlays_raw[WRISTS_LAYER] = wrists_overlay + overlays_raw[WRISTS_LAYER_ALT] = null + else + overlays_raw[WRISTS_LAYER] = null + overlays_raw[WRISTS_LAYER_ALT] = wrists_overlay + else + overlays_raw[WRISTS_LAYER] = null + overlays_raw[WRISTS_LAYER_ALT] = null if(update_icons) update_icon() @@ -1419,6 +1435,7 @@ There are several things that need to be remembered: #undef SHOES_LAYER #undef GLOVES_LAYER #undef BELT_LAYER +#undef WRISTS_LAYER_ALT #undef SUIT_LAYER #undef TAIL_NORTH_LAYER #undef TAIL_SOUTH_LAYER diff --git a/html/changelogs/LayerChanges.yml b/html/changelogs/LayerChanges.yml new file mode 100644 index 00000000000..c5777e4f390 --- /dev/null +++ b/html/changelogs/LayerChanges.yml @@ -0,0 +1,7 @@ +author: TheGreyWolf + +delete-after: True + +changes: + - rscadd: "Wrist clothing and wrist radios now have a verb to change layer to be under suits and other outer wear." + - bugfix: "Glasses will now instantly change layer."