diff --git a/code/__DEFINES/icon_layering.dm b/code/__DEFINES/icon_layering.dm index 9bfd1993b06..eac113a0eeb 100644 --- a/code/__DEFINES/icon_layering.dm +++ b/code/__DEFINES/icon_layering.dm @@ -7,36 +7,37 @@ #define TAIL_SOUTH_LAYER 6 #define TAIL_SOUTH_ACC_LAYER 7 #define SHOES_LAYER_ALT 8 -#define UNIFORM_LAYER 9 -#define MOB_DAMAGE_LAYER 10 -#define ID_LAYER 11 -#define BANDAGE_LAYER 12 -#define SHOES_LAYER 13 -#define GLOVES_LAYER 14 -#define BELT_LAYER 15 -#define WRISTS_LAYER_ALT 16 -#define SUIT_LAYER 17 -#define ID_LAYER_ALT 18 -#define TAIL_NORTH_LAYER 19 -#define TAIL_NORTH_ACC_LAYER 20 -#define HAIR_LAYER_ALT 21 -#define GLASSES_LAYER 22 -#define BELT_LAYER_ALT 23 -#define SUIT_STORE_LAYER 24 -#define BACK_LAYER 25 -#define HAIR_LAYER 26 -#define GLASSES_LAYER_ALT 27 -#define L_EAR_LAYER 28 -#define R_EAR_LAYER 29 -#define FACEMASK_LAYER 30 -#define HEAD_LAYER 31 -#define GLASSES_LAYER_OVER 32 -#define COLLAR_LAYER 33 -#define HANDCUFF_LAYER 34 -#define LEGCUFF_LAYER 35 -#define L_HAND_LAYER 36 -#define R_HAND_LAYER 37 -#define WRISTS_LAYER 38 -#define FIRE_LAYER_UPPER 39 -#define TOTAL_LAYERS 39 +#define WRISTS_LAYER_UNDER 9 +#define UNIFORM_LAYER 10 +#define MOB_DAMAGE_LAYER 11 +#define ID_LAYER 12 +#define BANDAGE_LAYER 13 +#define SHOES_LAYER 14 +#define GLOVES_LAYER 15 +#define BELT_LAYER 16 +#define WRISTS_LAYER_UNIFORM 17 +#define SUIT_LAYER 18 +#define ID_LAYER_ALT 19 +#define TAIL_NORTH_LAYER 20 +#define TAIL_NORTH_ACC_LAYER 21 +#define HAIR_LAYER_ALT 22 +#define GLASSES_LAYER 23 +#define BELT_LAYER_ALT 24 +#define SUIT_STORE_LAYER 25 +#define BACK_LAYER 26 +#define HAIR_LAYER 27 +#define GLASSES_LAYER_ALT 28 +#define L_EAR_LAYER 29 +#define R_EAR_LAYER 30 +#define FACEMASK_LAYER 31 +#define HEAD_LAYER 32 +#define GLASSES_LAYER_OVER 33 +#define COLLAR_LAYER 34 +#define WRISTS_LAYER_OVER 35 +#define HANDCUFF_LAYER 36 +#define LEGCUFF_LAYER 37 +#define L_HAND_LAYER 38 +#define R_HAND_LAYER 39 +#define FIRE_LAYER_UPPER 40 +#define TOTAL_LAYERS 40 //////////////////////////// diff --git a/code/modules/client/preference_setup/loadout/items/wrists.dm b/code/modules/client/preference_setup/loadout/items/wrists.dm index cc3f286683a..b76c655263f 100644 --- a/code/modules/client/preference_setup/loadout/items/wrists.dm +++ b/code/modules/client/preference_setup/loadout/items/wrists.dm @@ -6,6 +6,10 @@ sort_category = "Wristwear" flags = GEAR_HAS_NAME_SELECTION | GEAR_HAS_DESC_SELECTION | GEAR_HAS_COLOR_SELECTION +/datum/gear/wrists/New() + ..() + gear_tweaks += list(GLOB.gear_tweak_wrist_layer) + /datum/gear/wrists/beaded display_name = "beaded bracelet" path = /obj/item/clothing/wrists/beaded @@ -31,3 +35,37 @@ watchtype["spy watch"] = /obj/item/clothing/wrists/watch/spy watchtype["pocketwatch"] = /obj/item/pocketwatch gear_tweaks += new /datum/gear_tweak/path(watchtype) + +/* + Wristwear Layer Adjustment +*/ + +#define WRISTS_UNDER "Under Uniform" +#define WRISTS_OVER_UNIFORM "Over Uniform" +#define WRISTS_OVER_SUIT "Over Suit" + +GLOBAL_DATUM_INIT(gear_tweak_wrist_layer, /datum/gear_tweak/wrist_layer, new()) + +/datum/gear_tweak/wrist_layer + var/list/options = list(WRISTS_UNDER = WRISTS_LAYER_UNDER, WRISTS_OVER_UNIFORM = WRISTS_LAYER_UNIFORM, WRISTS_OVER_SUIT = WRISTS_LAYER_OVER) + +/datum/gear_tweak/wrist_layer/get_contents(var/metadata) + return "Wrist Layer: [metadata]" + +/datum/gear_tweak/wrist_layer/get_default() + return WRISTS_OVER_SUIT + +/datum/gear_tweak/wrist_layer/get_metadata(var/user, var/metadata, var/gear_path) + var/input = tgui_input_list(user, "Choose in which layer you want your wristwear to spawn in.", "Wristwear Layer", options, metadata) + if(!input) + input = metadata + return input + +/datum/gear_tweak/wrist_layer/tweak_item(var/obj/item/clothing/wrists/wrists, var/metadata, var/title, var/gear_path) + if(!istype(wrists)) + return + wrists.mob_wear_layer = options[metadata] + +#undef WRISTS_UNDER +#undef WRISTS_OVER_UNIFORM +#undef WRISTS_OVER_SUIT diff --git a/code/modules/clothing/wrists/wrists.dm b/code/modules/clothing/wrists/wrists.dm index 8252034e611..3d0ffd70894 100644 --- a/code/modules/clothing/wrists/wrists.dm +++ b/code/modules/clothing/wrists/wrists.dm @@ -15,7 +15,7 @@ pickup_sound = 'sound/items/pickup/accessory.ogg' siemens_coefficient = 1.0 var/flipped = 0 - var/normal_layer = TRUE + var/mob_wear_layer = WRISTS_LAYER_OVER /obj/item/clothing/wrists/update_clothing_icon() if (ismob(src.loc)) @@ -30,6 +30,18 @@ if((gender != PLURAL) && (flipped != -1)) // Check for plurality and whether it has a flipped icon. verbs += /obj/item/clothing/wrists/watch/proc/swapwrists +/obj/item/clothing/wrists/verb/change_layer() + set category = "Object" + set name = "Change Wristwear Layer" + set src in usr + + var/list/options = list("Under Uniform" = WRISTS_LAYER_UNDER, "Over Uniform" = WRISTS_LAYER_UNIFORM, "Over Suit" = WRISTS_LAYER_OVER) + var/new_layer = tgui_input_list(usr, "Position Wristwear", "Wristwear Style", options) + if(new_layer) + mob_wear_layer = options[new_layer] + to_chat(usr, SPAN_NOTICE("\The [src] will now layer [new_layer].")) + update_clothing_icon() + /obj/item/clothing/wrists/watch/proc/swapwrists() set category = "Object" set name = "Flip Wristwear" @@ -49,15 +61,6 @@ 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 62940348b1c..1846da7649e 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -1252,7 +1252,10 @@ There are several things that need to be remembered: if (QDELETED(src)) return - overlays_raw[WRISTS_LAYER] = null + overlays_raw[WRISTS_LAYER_UNDER] = null + overlays_raw[WRISTS_LAYER_UNIFORM] = null + overlays_raw[WRISTS_LAYER_OVER] = null + if(check_draw_wrists()) var/mob_icon var/mob_state = wrists.item_state || wrists.icon_state @@ -1280,20 +1283,12 @@ There are several things that need to be remembered: var/image/wrists_overlay = wrists.get_mob_overlay(src, mob_icon, mob_state, slot_wrists_str) - var/normal_layer = TRUE + var/wrist_layer = WRISTS_LAYER_OVER 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 + wrist_layer = W.mob_wear_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 + overlays_raw[wrist_layer] = wrists_overlay if(update_icons) update_icon() diff --git a/html/changelogs/geeves-wrist_layer_toggle.yml b/html/changelogs/geeves-wrist_layer_toggle.yml new file mode 100644 index 00000000000..9671a5a4d53 --- /dev/null +++ b/html/changelogs/geeves-wrist_layer_toggle.yml @@ -0,0 +1,6 @@ +author: Geeves + +delete-after: True + +changes: + - rscadd: "You can now set wristwear to layer under your uniform, over your uniform, or over your suit." \ No newline at end of file