From 86b711d153ca8f7c618927a2bd17190e3343fa01 Mon Sep 17 00:00:00 2001 From: Bm0n <92271472+Bm0n@users.noreply.github.com> Date: Tue, 14 Jun 2022 08:32:33 -0400 Subject: [PATCH] Restores Music Note Toggle On Headphones (#17949) * i still dont like the floaty notes * better wording * review suggestions --- code/datums/action.dm | 3 +++ code/modules/instruments/objs/items/headphones.dm | 13 ++++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/code/datums/action.dm b/code/datums/action.dm index b7787e86a98..871f44ca21b 100644 --- a/code/datums/action.dm +++ b/code/datums/action.dm @@ -224,6 +224,9 @@ /datum/action/item_action/toggle_mister name = "Toggle Mister" +/datum/action/item_action/toggle_music_notes + name = "Toggle Music Notes" + /datum/action/item_action/toggle_helmet_light name = "Toggle Helmet Light" diff --git a/code/modules/instruments/objs/items/headphones.dm b/code/modules/instruments/objs/items/headphones.dm index d55807bcd5a..a4f4fcd7c1e 100644 --- a/code/modules/instruments/objs/items/headphones.dm +++ b/code/modules/instruments/objs/items/headphones.dm @@ -3,8 +3,9 @@ desc = "Unce unce unce unce." icon_state = "headphones0" item_state = "headphones0" - actions_types = list(/datum/action/item_action/change_headphones_song) + actions_types = list(/datum/action/item_action/change_headphones_song, /datum/action/item_action/toggle_music_notes) var/datum/song/headphones/song + var/on = FALSE /obj/item/clothing/ears/headphones/Initialize(mapload) . = ..() @@ -19,8 +20,14 @@ QDEL_NULL(song) return ..() -/obj/item/clothing/ears/headphones/attack_self(mob/user) - ui_interact(user) +/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 + icon_state = "headphones[on]" + item_state = "headphones[on]" + update_icon() /obj/item/clothing/ears/headphones/ui_data(mob/user) return song.ui_data(user)