Skip to content

Commit

Permalink
Ports stop sounds verb from TG (#28072)
Browse files Browse the repository at this point in the history
* sounds have been stopped

* update

* name and format update

---------

Co-authored-by: Bmon <no@email.com>
  • Loading branch information
Bm0n and Bmon authored Feb 12, 2025
1 parent 5b48612 commit c11e1c9
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
3 changes: 2 additions & 1 deletion code/modules/admin/admin_verbs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
14 changes: 14 additions & 0 deletions code/modules/admin/verbs/playsound.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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()
8 changes: 8 additions & 0 deletions code/modules/client/client_procs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c11e1c9

Please sign in to comment.