From c11e1c969cdc576eb75b39cc04a34d4b9ddcaf0a Mon Sep 17 00:00:00 2001 From: Bm0n <92271472+Bm0n@users.noreply.github.com> Date: Wed, 12 Feb 2025 16:38:48 -0500 Subject: [PATCH] Ports stop sounds verb from TG (#28072) * sounds have been stopped * update * name and format update --------- Co-authored-by: Bmon --- code/modules/admin/admin_verbs.dm | 3 ++- code/modules/admin/verbs/playsound.dm | 14 ++++++++++++++ code/modules/client/client_procs.dm | 8 ++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index b5a6fd1d5fc..74c98524134 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -80,7 +80,8 @@ GLOBAL_LIST_INIT(admin_verbs_sounds, list( /client/proc/play_sound, /client/proc/play_server_sound, /client/proc/play_intercomm_sound, - /client/proc/stop_global_admin_sounds + /client/proc/stop_global_admin_sounds, + /client/proc/stop_sounds_global )) GLOBAL_LIST_INIT(admin_verbs_event, list( /client/proc/object_talk, diff --git a/code/modules/admin/verbs/playsound.dm b/code/modules/admin/verbs/playsound.dm index 6bee256df5c..117b8981dba 100644 --- a/code/modules/admin/verbs/playsound.dm +++ b/code/modules/admin/verbs/playsound.dm @@ -113,3 +113,17 @@ GLOBAL_LIST_EMPTY(sounds_cache) if(!I.on && !ignore_power) continue playsound(I, melody, cvol) + +/client/proc/stop_sounds_global() + set category = "Debug" + set name = "Stop Sounds Global" + set desc = "Stop all playing sounds globally." + if(!check_rights(R_SOUNDS)) + return + + log_admin("[key_name(src)] stopped all currently playing sounds.") + message_admins("[key_name_admin(src)] stopped all currently playing sounds.") + for(var/mob/M in GLOB.player_list) + SEND_SOUND(M, sound(null)) + var/client/C = M.client + C?.tgui_panel?.stop_music() diff --git a/code/modules/client/client_procs.dm b/code/modules/client/client_procs.dm index b00cbb4271b..ef2df0b49f7 100644 --- a/code/modules/client/client_procs.dm +++ b/code/modules/client/client_procs.dm @@ -1317,6 +1317,14 @@ editor.ui_interact(mob) +/client/verb/stop_client_sounds() + set category = "Special Verbs" + set name = "Stop Sounds" + set desc = "Stop Current Sounds." + SEND_SOUND(usr, sound(null)) + to_chat(src, "All sounds stopped.") + tgui_panel?.stop_music() + #undef LIMITER_SIZE #undef CURRENT_SECOND #undef SECOND_COUNT