diff --git a/maplestation.dme b/maplestation.dme index 085fd871c85f..7103c2b7586e 100644 --- a/maplestation.dme +++ b/maplestation.dme @@ -6278,6 +6278,7 @@ #include "maplestation_modules\code\modules\clothing\head\jobs.dm" #include "maplestation_modules\code\modules\clothing\head\loadout_helmet.dm" #include "maplestation_modules\code\modules\clothing\head\misc.dm" +#include "maplestation_modules\code\modules\clothing\head\wig.dm" #include "maplestation_modules\code\modules\clothing\masks\ornithid_masks.dm" #include "maplestation_modules\code\modules\clothing\neck\coconut_bra.dm" #include "maplestation_modules\code\modules\clothing\shoes\digi_shoes.dm" diff --git a/maplestation_modules/code/datums/components/stackable_item.dm b/maplestation_modules/code/datums/components/stackable_item.dm index 681d88f8a0ed..b85887db46d6 100644 --- a/maplestation_modules/code/datums/components/stackable_item.dm +++ b/maplestation_modules/code/datums/components/stackable_item.dm @@ -75,7 +75,12 @@ return // Add in our new worn icon as an overlay of our item's icon. - overlays += stacked_on.build_worn_icon(standing.layer) + var/mutable_appearance/created = stacked_on.build_worn_icon(standing.layer) + if(isnull(created)) + return + + created.appearance_flags |= RESET_COLOR + overlays += created /datum/component/stackable_item/proc/atom_exited(obj/item/source, atom/movable/gone, direction) SIGNAL_HANDLER diff --git a/maplestation_modules/code/modules/clothing/head/wig.dm b/maplestation_modules/code/modules/clothing/head/wig.dm new file mode 100644 index 000000000000..75e73549e899 --- /dev/null +++ b/maplestation_modules/code/modules/clothing/head/wig.dm @@ -0,0 +1,13 @@ +/obj/item/clothing/head/wig/Initialize(mapload) + . = ..() + AddComponent(/datum/component/stackable_item, \ + wearables = list(/obj/item/clothing/head), \ + wearable_descriptor = "a hat", \ + can_stack = CALLBACK(src, PROC_REF(can_attach_hat)), \ + ) + +/obj/item/clothing/head/wig/proc/can_attach_hat(obj/item/source, obj/item/clothing/head/incoming_head, mob/user) + if(incoming_head.clothing_flags & STACKABLE_HELMET_EXEMPT) + balloon_alert(user, "invalid hat!") + return FALSE + return TRUE