Skip to content

Commit

Permalink
Admin can change volume of all admin verb sound plays (tgstation#88017)
Browse files Browse the repository at this point in the history
Co-authored-by: Zephyr <[email protected]>
  • Loading branch information
Sadboysuss and ZephyrTFA authored Nov 21, 2024
1 parent 38cbdd8 commit a2934c0
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion code/modules/admin/verbs/playsound.dm
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ ADMIN_VERB(play_sound, R_SOUND, "Play Global Sound", "Play a sound to all connec
ADMIN_VERB(play_local_sound, R_SOUND, "Play Local Sound", "Plays a sound only you can hear.", ADMIN_CATEGORY_FUN, sound as sound)
log_admin("[key_name(user)] played a local sound [sound]")
message_admins("[key_name_admin(user)] played a local sound [sound]")
playsound(get_turf(user.mob), sound, 50, FALSE, FALSE)
var/volume = tgui_input_number(user, "What volume would you like the sound to play at?", max_value = 100)
var/sound/admin_sound = sound(sound)
admin_sound.volume = volume || 50
playsound(get_turf(user.mob), sound, FALSE, FALSE)
BLACKBOX_LOG_ADMIN_VERB("Play Local Sound")

ADMIN_VERB(play_direct_mob_sound, R_SOUND, "Play Direct Mob Sound", "Play a sound directly to a mob.", ADMIN_CATEGORY_FUN, sound as sound, mob/target in world)
Expand All @@ -51,6 +54,10 @@ ADMIN_VERB(play_direct_mob_sound, R_SOUND, "Play Direct Mob Sound", "Play a soun
return
log_admin("[key_name(user)] played a direct mob sound [sound] to [key_name_admin(target)].")
message_admins("[key_name_admin(user)] played a direct mob sound [sound] to [ADMIN_LOOKUPFLW(target)].")
var/volume = tgui_input_number(user, "What volume would you like the sound to play at?", max_value = 100)
var/sound/admin_sound = sound(sound)
if(volume)
admin_sound.volume = volume
SEND_SOUND(target, sound)
BLACKBOX_LOG_ADMIN_VERB("Play Direct Mob Sound")

Expand Down Expand Up @@ -175,6 +182,10 @@ ADMIN_VERB(play_web_sound, R_SOUND, "Play Internet Sound", "Play a given interne
web_sound(user.mob, null)

ADMIN_VERB(set_round_end_sound, R_SOUND, "Set Round End Sound", "Set the sound that plays on round end.", ADMIN_CATEGORY_FUN, sound as sound)
var/volume = tgui_input_number(user, "What volume would you like this sound to play at?", max_value = 100)
var/sound/admin_sound = sound(sound)
if(volume)
admin_sound.volume = volume
SSticker.SetRoundEndSound(sound)

log_admin("[key_name(user)] set the round end sound to [sound]")
Expand Down

0 comments on commit a2934c0

Please sign in to comment.