From 556ef6acc874d95a63d37b42745f02f02f0a9184 Mon Sep 17 00:00:00 2001 From: Aronai Sieyes Date: Thu, 26 Mar 2020 11:43:26 -0400 Subject: [PATCH] Emote noise toggle --- .../preference_setup/global/setting_datums.dm | 6 ++++ code/modules/client/preferences_vr.dm | 16 +++++++++++ code/modules/mob/living/carbon/human/emote.dm | 28 +++++++++---------- .../mob/living/carbon/human/emote_vr.dm | 18 ++++++------ 4 files changed, 45 insertions(+), 23 deletions(-) diff --git a/code/modules/client/preference_setup/global/setting_datums.dm b/code/modules/client/preference_setup/global/setting_datums.dm index 200e71c7e3a..99892d4d15b 100644 --- a/code/modules/client/preference_setup/global/setting_datums.dm +++ b/code/modules/client/preference_setup/global/setting_datums.dm @@ -98,6 +98,12 @@ var/list/_client_preferences_by_type key = "DIGEST_NOISES" enabled_description = "Noisy" disabled_description = "Silent" + +/datum/client_preference/emote_noises + description = "Emote Noises" //MERP + key = "EMOTE_NOISES" + enabled_description = "Noisy" + disabled_description = "Silent" //VOREStation Add End /datum/client_preference/weather_sounds description ="Weather sounds" diff --git a/code/modules/client/preferences_vr.dm b/code/modules/client/preferences_vr.dm index 746a95d6dbe..97074d32983 100644 --- a/code/modules/client/preferences_vr.dm +++ b/code/modules/client/preferences_vr.dm @@ -34,3 +34,19 @@ datum/preferences SScharacter_setup.queue_preferences_save(prefs) feedback_add_details("admin_verb","TDigestNoise") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! + + +/client/verb/toggle_emote_noises() + set name = "Emote Noises" + set category = "Preferences" + set desc = "Toggles emote noises." + + var/pref_path = /datum/client_preference/emote_noises + + toggle_preference(pref_path) + + to_chat(src, "You will [ (is_preference_enabled(pref_path)) ? "now" : "no longer"] hear emote-related noises.") + + SScharacter_setup.queue_preferences_save(prefs) + + feedback_add_details("admin_verb","TEmoteNoise") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! diff --git a/code/modules/mob/living/carbon/human/emote.dm b/code/modules/mob/living/carbon/human/emote.dm index 6940d1c3c28..c0f0e594211 100644 --- a/code/modules/mob/living/carbon/human/emote.dm +++ b/code/modules/mob/living/carbon/human/emote.dm @@ -79,7 +79,7 @@ message = "[display_msg] at [param]." else message = "[display_msg]." - playsound(src.loc, use_sound, 50, 0) + playsound(src.loc, use_sound, 50, 0, preference = /datum/client_preference/emote_noises) //VOREStation Add m_type = 1 //Promethean-only emotes @@ -89,7 +89,7 @@ to_chat(src, "You are not a slime thing!") return */ //VOREStation Removal End - playsound(src.loc, 'sound/effects/slime_squish.ogg', 50, 0) //Credit to DrMinky (freesound.org) for the sound. + playsound(src.loc, 'sound/effects/slime_squish.ogg', 50, 0, preference = /datum/client_preference/emote_noises) //VOREStation Add //Credit to DrMinky (freesound.org) for the sound. message = "squishes." m_type = 1 @@ -99,7 +99,7 @@ to_chat(src, "You are not a Skrell!") return - playsound(src.loc, 'sound/effects/warble.ogg', 50, 0) // Copyright CC BY 3.0 alienistcog (freesound.org) for the sound. + playsound(src.loc, 'sound/effects/warble.ogg', 50, 0, preference = /datum/client_preference/emote_noises) //VOREStation Add // Copyright CC BY 3.0 alienistcog (freesound.org) for the sound. message = "warbles." m_type = 2 @@ -261,10 +261,10 @@ message = "coughs!" if(get_gender() == FEMALE) if(species.female_cough_sounds) - playsound(src, pick(species.female_cough_sounds), 120) + playsound(src, pick(species.female_cough_sounds), 120, preference = /datum/client_preference/emote_noises) //VOREStation Add else if(species.male_cough_sounds) - playsound(src, pick(species.male_cough_sounds), 120) + playsound(src, pick(species.male_cough_sounds), 120, preference = /datum/client_preference/emote_noises) //VOREStation Add else message = "emits a robotic cough" var/use_sound @@ -272,7 +272,7 @@ use_sound = pick('sound/effects/mob_effects/f_machine_cougha.ogg','sound/effects/mob_effects/f_machine_coughb.ogg') else use_sound = pick('sound/effects/mob_effects/m_machine_cougha.ogg','sound/effects/mob_effects/m_machine_coughb.ogg', 'sound/effects/mob_effects/m_machine_coughc.ogg') - playsound(src.loc, use_sound, 50, 0) + playsound(src.loc, use_sound, 50, 0, preference = /datum/client_preference/emote_noises) //VOREStation Add else message = "makes a strong noise." m_type = 2 @@ -534,9 +534,9 @@ if(!robotic) message = "sneezes." if(get_gender() == FEMALE) - playsound(src, species.female_sneeze_sound, 70) + playsound(src, species.female_sneeze_sound, 70, preference = /datum/client_preference/emote_noises) //VOREStation Add else - playsound(src, species.male_sneeze_sound, 70) + playsound(src, species.male_sneeze_sound, 70, preference = /datum/client_preference/emote_noises) //VOREStation Add m_type = 2 else message = "emits a robotic sneeze" @@ -545,7 +545,7 @@ use_sound = 'sound/effects/mob_effects/machine_sneeze.ogg' else use_sound = 'sound/effects/mob_effects/f_machine_sneeze.ogg' - playsound(src.loc, use_sound, 50, 0) + playsound(src.loc, use_sound, 50, 0, preference = /datum/client_preference/emote_noises) //VOREStation Add else message = "makes a strange noise." m_type = 2 @@ -658,14 +658,14 @@ break if(M) message = "slaps [M] across the face. Ouch!" - playsound(loc, 'sound/effects/snap.ogg', 50, 1) + playsound(loc, 'sound/effects/snap.ogg', 50, 1, preference = /datum/client_preference/emote_noises) //VOREStation Add if(ishuman(M)) //Snowflakey! var/mob/living/carbon/human/H = M if(istype(H.wear_mask,/obj/item/clothing/mask/smokable)) H.drop_from_inventory(H.wear_mask) else message = "slaps [T.himself]!" - playsound(loc, 'sound/effects/snap.ogg', 50, 1) + playsound(loc, 'sound/effects/snap.ogg', 50, 1, preference = /datum/client_preference/emote_noises) //VOREStation Add if("scream", "screams") if(miming) @@ -702,7 +702,7 @@ return message = "snaps [T.his] fingers." - playsound(loc, 'sound/effects/fingersnap.ogg', 50, 1, -3) + playsound(loc, 'sound/effects/fingersnap.ogg', 50, 1, -3, preference = /datum/client_preference/emote_noises) //VOREStation Add if("swish") src.animate_tail_once() @@ -726,14 +726,14 @@ if("whistle" || "whistles") if(!muzzled) message = "whistles a tune." - playsound(loc, 'sound/misc/longwhistle.ogg') //praying this doesn't get abused + playsound(loc, 'sound/misc/longwhistle.ogg', preference = /datum/client_preference/emote_noises) //VOREStation Add else message = "makes a light spitting noise, a poor attempt at a whistle." if("qwhistle") if(!muzzled) message = "whistles quietly." - playsound(loc, 'sound/misc/shortwhistle.ogg') + playsound(loc, 'sound/misc/shortwhistle.ogg', preference = /datum/client_preference/emote_noises) //VOREStation Add else message = "makes a light spitting noise, a poor attempt at a whistle." diff --git a/code/modules/mob/living/carbon/human/emote_vr.dm b/code/modules/mob/living/carbon/human/emote_vr.dm index 583483edd61..05e5ff31fa4 100644 --- a/code/modules/mob/living/carbon/human/emote_vr.dm +++ b/code/modules/mob/living/carbon/human/emote_vr.dm @@ -26,39 +26,39 @@ if ("awoo") m_type = 2 message = "lets out an awoo." - playsound(loc, 'sound/voice/awoo.ogg', 50, 1, -1) + playsound(loc, 'sound/voice/awoo.ogg', 50, 1, -1, preference = /datum/client_preference/emote_noises) if ("nya") message = "lets out a nya." m_type = 2 - playsound(loc, 'sound/voice/nya.ogg', 50, 1, -1) + playsound(loc, 'sound/voice/nya.ogg', 50, 1, -1, preference = /datum/client_preference/emote_noises) if ("peep") message = "peeps like a bird." m_type = 2 - playsound(loc, 'sound/voice/peep.ogg', 50, 1, -1) + playsound(loc, 'sound/voice/peep.ogg', 50, 1, -1, preference = /datum/client_preference/emote_noises) if ("chirp") message = "chirps!" - playsound(src.loc, 'sound/misc/nymphchirp.ogg', 50, 0) + playsound(src.loc, 'sound/misc/nymphchirp.ogg', 50, 0, preference = /datum/client_preference/emote_noises) m_type = 2 if ("weh") message = "lets out a weh." m_type = 2 - playsound(loc, 'sound/voice/weh.ogg', 50, 1, -1) + playsound(loc, 'sound/voice/weh.ogg', 50, 1, -1, preference = /datum/client_preference/emote_noises) if ("merp") message = "lets out a merp." m_type = 2 - playsound(loc, 'sound/voice/merp.ogg', 50, 1, -1) + playsound(loc, 'sound/voice/merp.ogg', 50, 1, -1, preference = /datum/client_preference/emote_noises) if ("bark") message = "lets out a bark." m_type = 2 - playsound(loc, 'sound/voice/bark2.ogg', 50, 1, -1) + playsound(loc, 'sound/voice/bark2.ogg', 50, 1, -1, preference = /datum/client_preference/emote_noises) if ("his") message = "lets out a hiss." m_type = 2 - playsound(loc, 'sound/voice/hiss.ogg', 50, 1, -1) + playsound(loc, 'sound/voice/hiss.ogg', 50, 1, -1, preference = /datum/client_preference/emote_noises) if ("squeak") message = "lets out a squeak." m_type = 2 - playsound(loc, 'sound/effects/mouse_squeak.ogg', 50, 1, -1) + playsound(loc, 'sound/effects/mouse_squeak.ogg', 50, 1, -1, preference = /datum/client_preference/emote_noises) if ("nsay") nsay() return TRUE