Skip to content

Commit

Permalink
Allows you to put hats on wigs (for cosmetics) (#425)
Browse files Browse the repository at this point in the history
  • Loading branch information
MrMelbert authored Feb 19, 2024
1 parent bd25238 commit 1995acd
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
1 change: 1 addition & 0 deletions maplestation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 13 additions & 0 deletions maplestation_modules/code/modules/clothing/head/wig.dm
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 1995acd

Please sign in to comment.