From e2defa667a78ef834e75866bacaaf989da09af05 Mon Sep 17 00:00:00 2001 From: MrPerson Date: Mon, 31 Mar 2014 05:41:33 -0700 Subject: [PATCH] Upgrades to the play admin midi client pref Toggling it off will pause any songs currently playing. Toggling it back on will resume playback from where you were. Toggling midis on will play the currently playing admin midi, if there is one. --- code/modules/admin/verbs/playsound.dm | 66 +++++----------------- code/modules/client/preferences_toggles.dm | 9 ++- 2 files changed, 21 insertions(+), 54 deletions(-) diff --git a/code/modules/admin/verbs/playsound.dm b/code/modules/admin/verbs/playsound.dm index 1c6871c3553..45c316988f6 100644 --- a/code/modules/admin/verbs/playsound.dm +++ b/code/modules/admin/verbs/playsound.dm @@ -1,17 +1,28 @@ +#define SOUND_CHANNEL_ADMIN 777 +var/sound/admin_sound + /client/proc/play_sound(S as sound) set category = "Fun" set name = "Play Global Sound" if(!check_rights(R_SOUNDS)) return - var/sound/uploaded_sound = sound(S, repeat = 0, wait = 1, channel = 777) - uploaded_sound.priority = 250 + admin_sound = sound(S, repeat = 0, wait = 1, channel = SOUND_CHANNEL_ADMIN) + admin_sound.priority = 250 + admin_sound.status = SOUND_UPDATE|SOUND_STREAM log_admin("[key_name(src)] played sound [S]") message_admins("[key_name_admin(src)] played sound [S]", 1) + + if(events.holiday == "April Fool's Day") + admin_sound.frequency = pick(0.5, 0.7, 0.8, 0.85, 0.9, 0.95, 1.1, 1.2, 1.4, 1.6, 2.0, 2.5) + src << "You feel the Honkmother messing with your song..." + for(var/mob/M in player_list) if(M.client.prefs.toggles & SOUND_MIDI) - M << uploaded_sound + M << admin_sound + admin_sound.frequency = 1 //Remove this line when the AFD stuff above is gone + admin_sound.wait = 0 feedback_add_details("admin_verb","PGS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! @@ -39,51 +50,4 @@ else return -/* -/client/proc/cuban_pete() - set category = "Fun" - set name = "Cuban Pete Time" - - message_admins("[key_name_admin(usr)] has declared Cuban Pete Time!", 1) - for(var/mob/M in world) - if(M.client) - if(M.client.midis) - M << 'cubanpetetime.ogg' - - for(var/mob/living/carbon/human/CP in world) - if(CP.real_name=="Cuban Pete" && CP.key!="Rosham") - CP << "Your body can't contain the rhumba beat" - CP.gib() - - -/client/proc/bananaphone() - set category = "Fun" - set name = "Banana Phone" - - message_admins("[key_name_admin(usr)] has activated Banana Phone!", 1) - for(var/mob/M in world) - if(M.client) - if(M.client.midis) - M << 'bananaphone.ogg' - - -client/proc/space_asshole() - set category = "Fun" - set name = "Space Asshole" - - message_admins("[key_name_admin(usr)] has played the Space Asshole Hymn.", 1) - for(var/mob/M in world) - if(M.client) - if(M.client.midis) - M << 'space_asshole.ogg' - - -client/proc/honk_theme() - set category = "Fun" - set name = "Honk" - - message_admins("[key_name_admin(usr)] has creeped everyone out with Blackest Honks.", 1) - for(var/mob/M in world) - if(M.client) - if(M.client.midis) - M << 'honk_theme.ogg'*/ +#undef SOUND_CHANNEL_ADMIN \ No newline at end of file diff --git a/code/modules/client/preferences_toggles.dm b/code/modules/client/preferences_toggles.dm index 8c2297108e7..31eb62cd73d 100644 --- a/code/modules/client/preferences_toggles.dm +++ b/code/modules/client/preferences_toggles.dm @@ -79,11 +79,14 @@ prefs.save_preferences() if(prefs.toggles & SOUND_MIDI) src << "You will now hear any sounds uploaded by admins." + if(admin_sound) + src << admin_sound else - var/sound/break_sound = sound(null, repeat = 0, wait = 0, channel = 777) - break_sound.priority = 250 - src << break_sound //breaks the client's sound output on channel 777 src << "You will no longer hear sounds uploaded by admins; any currently playing midis have been disabled." + if(admin_sound && !(admin_sound.status & SOUND_PAUSED)) + admin_sound.status |= SOUND_PAUSED + src << admin_sound + admin_sound.status ^= SOUND_PAUSED feedback_add_details("admin_verb","TMidi") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /client/verb/listen_ooc()