From fafb2d6e338494d36e3b40b4f62ec75ad5255664 Mon Sep 17 00:00:00 2001 From: warriorstar-orion Date: Sat, 28 Sep 2024 18:36:22 -0400 Subject: [PATCH] fix: headphone music notes updating / admin musician outfit (#26814) --- code/datums/outfits/outfit_admin.dm | 4 ++-- code/modules/instruments/objs/items/headphones.dm | 14 +++++++++++--- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/code/datums/outfits/outfit_admin.dm b/code/datums/outfits/outfit_admin.dm index bb28197d619..22963dd84aa 100644 --- a/code/datums/outfits/outfit_admin.dm +++ b/code/datums/outfits/outfit_admin.dm @@ -561,9 +561,9 @@ if(istype(I)) apply_to_card(I, H, list(ACCESS_MAINT_TUNNELS), "Bard") - var/obj/item/clothing/ears/headphones/P = r_ear + var/obj/item/clothing/ears/headphones/P = H.r_ear if(istype(P)) - P.attack_self(H) // activate them, display musical notes effect + P.toggle_visual_notes(H) // activate them, display musical notes effect // Soviet Military diff --git a/code/modules/instruments/objs/items/headphones.dm b/code/modules/instruments/objs/items/headphones.dm index 8ea5c4b12e4..32373c5afb4 100644 --- a/code/modules/instruments/objs/items/headphones.dm +++ b/code/modules/instruments/objs/items/headphones.dm @@ -23,9 +23,17 @@ /obj/item/clothing/ears/headphones/ui_action_click(mob/user, actiontype) if(actiontype == /datum/action/item_action/change_headphones_song) ui_interact(user) - else - on = !on - update_icon(UPDATE_ICON_STATE) + else if(actiontype == /datum/action/item_action/toggle_music_notes) + toggle_visual_notes(user) + + for(var/X in actions) + var/datum/action/A = X + A.UpdateButtons() + +/obj/item/clothing/ears/headphones/proc/toggle_visual_notes(mob/user) + on = !on + update_icon(UPDATE_ICON_STATE) + user.regenerate_icons() /obj/item/clothing/ears/headphones/ui_data(mob/user) return song.ui_data(user)