Skip to content

Commit

Permalink
fix: headphone music notes updating / admin musician outfit (#26814)
Browse files Browse the repository at this point in the history
  • Loading branch information
warriorstar-orion authored Sep 28, 2024
1 parent a422b25 commit fafb2d6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
4 changes: 2 additions & 2 deletions code/datums/outfits/outfit_admin.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
14 changes: 11 additions & 3 deletions code/modules/instruments/objs/items/headphones.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit fafb2d6

Please sign in to comment.