Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allows you to put hats on wigs #425

Merged
merged 1 commit into from
Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading