diff --git a/code/datums/greyscale/json_configs/wintercoats.json b/code/datums/greyscale/json_configs/wintercoats.json index a1a50b04447..c91c7c33211 100644 --- a/code/datums/greyscale/json_configs/wintercoats.json +++ b/code/datums/greyscale/json_configs/wintercoats.json @@ -73,12 +73,6 @@ "icon_state": "bodybottom", "blend_mode": "overlay", "color_ids": [ 6 ] - }, - { - "type": "icon_state", - "icon_state": "hood", - "blend_mode": "overlay", - "color_ids": [ 1 ] } ] } diff --git a/code/modules/clothing/suits/toggles.dm b/code/modules/clothing/suits/toggles.dm index 1ba4f3923d2..dfbcc7db4fe 100644 --- a/code/modules/clothing/suits/toggles.dm +++ b/code/modules/clothing/suits/toggles.dm @@ -8,12 +8,15 @@ var/alternative_mode = FALSE ///Whether the hood is flipped up var/hood_up = FALSE + /// Are we zipped? Mostly relevant for wintercoats, leaving this here to simplify logic and so someone else can extend it if they ever wish to. + var/zipped = FALSE /obj/item/clothing/suit/hooded/Initialize(mapload) . = ..() if(!alternative_mode) MakeHood() + /obj/item/clothing/suit/hooded/Destroy() . = ..() QDEL_NULL(hood) @@ -42,7 +45,9 @@ ToggleHood() /obj/item/clothing/suit/hooded/proc/RemoveHood() - src.icon_state = "[initial(icon_state)]" + icon_state = "[initial(icon_state)]" + worn_icon_state = icon_state + zipped = FALSE hood_up = FALSE if(hood) @@ -82,6 +87,8 @@ return hood_up = TRUE icon_state = "[initial(icon_state)]_t" + worn_icon_state = icon_state + zipped = TRUE // Just to maintain the same behavior, and so we avoid any bugs that otherwise relied on this behavior of zipping the jacket when bringing up the hood H.update_worn_oversuit() H.update_mob_action_buttons() else diff --git a/code/modules/clothing/suits/wintercoats.dm b/code/modules/clothing/suits/wintercoats.dm index 64ecc0b5c18..75329200c80 100644 --- a/code/modules/clothing/suits/wintercoats.dm +++ b/code/modules/clothing/suits/wintercoats.dm @@ -11,6 +11,8 @@ min_cold_protection_temperature = FIRE_SUIT_MIN_TEMP_PROTECT allowed = list() armor_type = /datum/armor/hooded_wintercoat + /// The mutable_appearance of the associated hood, when it's down. Can be null when the hood is up. + var/mutable_appearance/hood_overlay /datum/armor/hooded_wintercoat bio = 10 @@ -29,6 +31,42 @@ /obj/item/toy, ) + generate_hood_overlay() + + +/obj/item/clothing/suit/hooded/wintercoat/examine(mob/user) + . = ..() + + . += span_notice("Alt-click to [zipped ? "un" : ""]zip.") + + +/obj/item/clothing/suit/hooded/wintercoat/AltClick(mob/user) + . = ..() + + if (. == FALSE) // Direct check for FALSE, because that's the specific case we want to propagate, not just null. + return FALSE + + zipped = !zipped + worn_icon_state = "[initial(icon_state)][zipped ? "_t" : ""]" + balloon_alert(user, "[zipped ? "" : "un"]zipped") + + if(ishuman(loc)) + var/mob/living/carbon/human/wearer = loc + wearer.update_worn_oversuit() + + +/// Helper proc to generate the `hood_overlay` associated to the wintercoat. +/obj/item/clothing/suit/hooded/wintercoat/proc/generate_hood_overlay() + hood_overlay = mutable_appearance(initial(worn_icon), "[initial(icon_state)]_hood", -SUIT_LAYER) + + +/obj/item/clothing/suit/hooded/wintercoat/worn_overlays(mutable_appearance/standing, isinhands) + . = ..() + + if(!isinhands && !hood_up) + . += hood_overlay + + /obj/item/clothing/head/hooded/winterhood name = "winter hood" desc = "A cozy winter hood attached to a heavy winter jacket." @@ -49,7 +87,6 @@ /obj/item/clothing/suit/hooded/wintercoat/eva name = "\proper Endotherm winter coat" desc = "A thickly padded winter coat to keep the wearer well insulated no matter the circumstances. It has a harness for a larger oxygen tank attached to the back." - icon_state = "coateva" w_class = WEIGHT_CLASS_BULKY slowdown = 0.75 armor_type = /datum/armor/wintercoat_eva @@ -77,7 +114,6 @@ /obj/item/clothing/head/hooded/winterhood/eva name = "\proper Endotherm winter hood" desc = "A thickly padded hood attached to an even thicker coat." - icon_state = "hood_eva" armor_type = /datum/armor/winterhood_eva min_cold_protection_temperature = SPACE_HELM_MIN_TEMP_PROTECT max_heat_protection_temperature = SPACE_HELM_MAX_TEMP_PROTECT diff --git a/icons/mob/clothing/suits/wintercoat.dmi b/icons/mob/clothing/suits/wintercoat.dmi index 7d751aa630c..7a3f27954df 100644 Binary files a/icons/mob/clothing/suits/wintercoat.dmi and b/icons/mob/clothing/suits/wintercoat.dmi differ diff --git a/icons/obj/clothing/suits/wintercoat.dmi b/icons/obj/clothing/suits/wintercoat.dmi index a971d35e1fc..bed075d2ace 100644 Binary files a/icons/obj/clothing/suits/wintercoat.dmi and b/icons/obj/clothing/suits/wintercoat.dmi differ diff --git a/modular_skyrat/master_files/icons/mob/clothing/suits/wintercoat.dmi b/modular_skyrat/master_files/icons/mob/clothing/suits/wintercoat.dmi index 34a8fdadb8a..82a9c0f7c31 100644 Binary files a/modular_skyrat/master_files/icons/mob/clothing/suits/wintercoat.dmi and b/modular_skyrat/master_files/icons/mob/clothing/suits/wintercoat.dmi differ diff --git a/modular_skyrat/master_files/icons/obj/clothing/suits/wintercoat.dmi b/modular_skyrat/master_files/icons/obj/clothing/suits/wintercoat.dmi index 42093f7c089..bcd09afc2b8 100644 Binary files a/modular_skyrat/master_files/icons/obj/clothing/suits/wintercoat.dmi and b/modular_skyrat/master_files/icons/obj/clothing/suits/wintercoat.dmi differ