From 2ad8d26aebfcf7caa9ee19fbce75ac54e43c5e5f Mon Sep 17 00:00:00 2001 From: volas Date: Mon, 9 Mar 2015 11:01:00 +0300 Subject: [PATCH] Play server sound verb for admins --- code/modules/admin/admin_verbs.dm | 4 +++- code/modules/admin/verbs/playsound.dm | 24 +++++++++++++++++++++++- sound/serversound_list.txt | 11 +++++++++++ 3 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 sound/serversound_list.txt diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 6b079ef1ac..cc31febed8 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -87,7 +87,8 @@ var/list/admin_verbs_ban = list( ) var/list/admin_verbs_sounds = list( /client/proc/play_local_sound, - /client/proc/play_sound + /client/proc/play_sound, + /client/proc/play_server_sound ) var/list/admin_verbs_fun = list( /client/proc/object_talk, @@ -206,6 +207,7 @@ var/list/admin_verbs_hideable = list( /client/proc/check_words, /client/proc/play_local_sound, /client/proc/play_sound, + /client/proc/play_server_sound, /client/proc/object_talk, /client/proc/cmd_admin_dress, /client/proc/cmd_admin_gib_self, diff --git a/code/modules/admin/verbs/playsound.dm b/code/modules/admin/verbs/playsound.dm index 6ff66c4647..3a4b40d985 100644 --- a/code/modules/admin/verbs/playsound.dm +++ b/code/modules/admin/verbs/playsound.dm @@ -1,3 +1,5 @@ +var/list/sounds_cache = list() + /client/proc/play_sound(S as sound) set category = "Fun" set name = "Play Global Sound" @@ -6,6 +8,11 @@ var/sound/uploaded_sound = sound(S, repeat = 0, wait = 1, channel = 777) uploaded_sound.priority = 250 + sounds_cache += S + + if(alert("Do you ready?\nSong: [S]\nNow you can also play this sound using \"Play Server Sound\".", "Confirmation request" ,"Play", "Cancel") == "Cancel") + return + log_admin("[key_name(src)] played sound [S]") message_admins("[key_name_admin(src)] played sound [S]", 1) for(var/mob/M in player_list) @@ -14,7 +21,6 @@ feedback_add_details("admin_verb","PGS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - /client/proc/play_local_sound(S as sound) set category = "Fun" set name = "Play Local Sound" @@ -26,6 +32,22 @@ feedback_add_details("admin_verb","PLS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! +/client/proc/play_server_sound() + set category = "Fun" + set name = "Play Server Sound" + if(!check_rights(R_SOUNDS)) return + + var/list/sounds = file2list("sound/serversound_list.txt"); + sounds += "--CANCEL--" + sounds += sounds_cache + + var/melody = input("Select a sound from the server to play", "Server sound list", "--CANCEL--") in sounds + + if(melody == "--CANCEL--") return + + play_sound(melody) + feedback_add_details("admin_verb","PSS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! + /* /client/proc/cuban_pete() set category = "Fun" diff --git a/sound/serversound_list.txt b/sound/serversound_list.txt new file mode 100644 index 0000000000..24cbafaf15 --- /dev/null +++ b/sound/serversound_list.txt @@ -0,0 +1,11 @@ +sound/music/1.ogg +sound/music/b12_combined_start.ogg +sound/music/main.ogg +sound/music/space.ogg +sound/music/space_asshole.ogg +sound/music/space_oddity.ogg +sound/music/title1.ogg +sound/music/title2.ogg +sound/music/traitor.ogg +sound/items/bikehorn.ogg +sound/effects/siren.ogg \ No newline at end of file