From 2fa6457130bc2ca144c187d2be9120798987b947 Mon Sep 17 00:00:00 2001 From: MrPerson Date: Sun, 22 Mar 2015 01:25:27 -0700 Subject: [PATCH] Added a preference toggle for hearing musical instruments --- code/__DEFINES/preferences.dm | 3 ++- code/game/objects/structures/musician.dm | 2 ++ code/modules/client/preferences_toggles.dm | 13 +++++++++++++ html/changelogs/MrPerson.yml | 3 ++- 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/code/__DEFINES/preferences.dm b/code/__DEFINES/preferences.dm index d6c41b34888..976f1e016e7 100644 --- a/code/__DEFINES/preferences.dm +++ b/code/__DEFINES/preferences.dm @@ -7,8 +7,9 @@ #define MEMBER_PUBLIC 16 #define INTENT_STYLE 32 #define MIDROUND_ANTAG 64 +#define SOUND_INSTRUMENTS 128 -#define TOGGLES_DEFAULT (SOUND_ADMINHELP|SOUND_MIDI|SOUND_AMBIENCE|SOUND_LOBBY|MEMBER_PUBLIC|INTENT_STYLE|MIDROUND_ANTAG) +#define TOGGLES_DEFAULT (SOUND_ADMINHELP|SOUND_MIDI|SOUND_AMBIENCE|SOUND_LOBBY|MEMBER_PUBLIC|INTENT_STYLE|MIDROUND_ANTAG|SOUND_INSTRUMENTS) //Chat toggles #define CHAT_OOC 1 diff --git a/code/game/objects/structures/musician.dm b/code/game/objects/structures/musician.dm index fb1980692d9..2324c724ed4 100644 --- a/code/game/objects/structures/musician.dm +++ b/code/game/objects/structures/musician.dm @@ -59,6 +59,8 @@ // and play var/turf/source = get_turf(instrumentObj) for(var/mob/M in get_hearers_in_view(15, source)) + if(!M.client || !(M.client.prefs.toggles & SOUND_INSTRUMENTS)) + continue M.playsound_local(source, soundfile, 100, falloff = 5) /datum/song/proc/updateDialog(mob/user as mob) diff --git a/code/modules/client/preferences_toggles.dm b/code/modules/client/preferences_toggles.dm index 52b9329094d..c1af4353e61 100644 --- a/code/modules/client/preferences_toggles.dm +++ b/code/modules/client/preferences_toggles.dm @@ -157,6 +157,19 @@ src << sound(null, repeat = 0, wait = 0, volume = 0, channel = 2) feedback_add_details("admin_verb","TAmbi") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! +// This needs a toggle because you people are awful and spammed terrible music +/client/verb/toggle_instruments() + set name = "Hear/Silence Instruments" + set category = "Preferences" + set desc = "Toggles hearing musical instruments like the violin and piano" + prefs.toggles ^= SOUND_INSTRUMENTS + prefs.save_preferences() + if(prefs.toggles & SOUND_INSTRUMENTS) + src << "You will now hear people playing musical instruments." + else + src << "You will no longer hear musical instruments." + feedback_add_details("admin_verb","TInstru") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! + //be special /client/verb/toggle_be_special(role in be_special_flags) set name = "Toggle SpecialRole Candidacy" diff --git a/html/changelogs/MrPerson.yml b/html/changelogs/MrPerson.yml index 6378584f30e..91f0195b0e7 100644 --- a/html/changelogs/MrPerson.yml +++ b/html/changelogs/MrPerson.yml @@ -1,2 +1,3 @@ author: MrPerson -changes: [] +changes: + - rscadd: "Added a preference toggle for hearing instruments play as suggested by PKPenguin321."