From 4950e9c59a86d5ce62e88ccef7a9a8a8e014b770 Mon Sep 17 00:00:00 2001 From: Bram961 Date: Sun, 19 Apr 2015 13:29:27 +0200 Subject: [PATCH] Splitting the Ambience and background noise Splits off Ambience sounds and the background "shipambience.ogg" under two difrent buttons. --- code/game/area/areas.dm | 50 +++++++++++----------- code/modules/client/preferences_toggles.dm | 15 ++++++- code/setup.dm | 3 +- 3 files changed, 41 insertions(+), 27 deletions(-) diff --git a/code/game/area/areas.dm b/code/game/area/areas.dm index c24ea331bcd..cba9e44ecde 100644 --- a/code/game/area/areas.dm +++ b/code/game/area/areas.dm @@ -52,7 +52,7 @@ InitializeLighting() -/area/proc/poweralert(var/state, var/obj/source as obj) +/area/proc/poweralert(var/state, var/obj/source as obj) if (state != poweralm) poweralm = state if(istype(source)) //Only report power alarms on the z-level where the source is located. @@ -263,7 +263,7 @@ /area/proc/updateicon() if(radalert) // always show the radiation alert, regardless of power icon_state = "radiation" - blend_mode = BLEND_MULTIPLY + blend_mode = BLEND_MULTIPLY else if ((fire || eject || party) && ((!requires_power)?(!requires_power):power_environ))//If it doesn't require power, can still activate this proc. if(fire && !radalert && !eject && !party) icon_state = "red" @@ -385,30 +385,30 @@ thunk(L) // Ambience goes down here -- make sure to list each area seperately for ease of adding things in later, thanks! Note: areas adjacent to each other should have the same sounds to prevent cutoff when possible.- LastyScratch - if(L && L.client && (L.client.prefs.sound & SOUND_AMBIENCE)) - if(!L.client.ambience_playing) - L.client.ambience_playing = 1 - L << sound('sound/ambience/shipambience.ogg', repeat = 1, wait = 0, volume = 35, channel = 2) + if(!L.client.ambience_playing && L && L.client && (L.client.prefs.sound & SOUND_BUZZ)) //split off the white noise from the rest of the ambience because of annoyance complaints - Kluys + L.client.ambience_playing = 1 + L << sound('sound/ambience/shipambience.ogg', repeat = 1, wait = 0, volume = 35, channel = 2) + else L.client.ambience_playing = 0 - if(prob(35) && !newarea.media_source) - // TODO: This is dumb. - N3X - if(istype(src, /area/chapel)) - sound = pick('sound/ambience/ambicha1.ogg','sound/ambience/ambicha2.ogg','sound/ambience/ambicha3.ogg','sound/ambience/ambicha4.ogg','sound/music/traitor.ogg') - else if(istype(src, /area/medical/morgue)) - sound = pick('sound/ambience/ambimo1.ogg','sound/ambience/ambimo2.ogg','sound/music/main.ogg') - else if(type == /area) - sound = pick('sound/ambience/ambispace.ogg','sound/music/title2.ogg','sound/music/space.ogg','sound/music/main.ogg','sound/music/traitor.ogg') - else if(istype(src, /area/engine)) - sound = pick('sound/ambience/ambisin1.ogg','sound/ambience/ambisin2.ogg','sound/ambience/ambisin3.ogg','sound/ambience/ambisin4.ogg') - else if(istype(src, /area/AIsattele) || istype(src, /area/turret_protected/ai) || istype(src, /area/turret_protected/ai_upload) || istype(src, /area/turret_protected/ai_upload_foyer)) - sound = pick('sound/ambience/ambimalf.ogg') - else if(istype(src, /area/mine/explored) || istype(src, /area/mine/unexplored)) - sound = pick('sound/ambience/ambimine.ogg', 'sound/ambience/song_game.ogg') - musVolume = 25 - else if(istype(src, /area/tcommsat) || istype(src, /area/turret_protected/tcomwest) || istype(src, /area/turret_protected/tcomeast) || istype(src, /area/turret_protected/tcomfoyer) || istype(src, /area/turret_protected/tcomsat)) - sound = pick('sound/ambience/ambisin2.ogg', 'sound/ambience/signal.ogg', 'sound/ambience/signal.ogg', 'sound/ambience/ambigen10.ogg') - else - sound = pick('sound/ambience/ambigen1.ogg','sound/ambience/ambigen3.ogg','sound/ambience/ambigen4.ogg','sound/ambience/ambigen5.ogg','sound/ambience/ambigen6.ogg','sound/ambience/ambigen7.ogg','sound/ambience/ambigen8.ogg','sound/ambience/ambigen9.ogg','sound/ambience/ambigen10.ogg','sound/ambience/ambigen11.ogg','sound/ambience/ambigen12.ogg','sound/ambience/ambigen14.ogg') + if(prob(35) && !newarea.media_source && L && L.client && (L.client.prefs.sound & SOUND_AMBIENCE)) + // TODO: This is dumb. - N3X + if(istype(src, /area/chapel)) + sound = pick('sound/ambience/ambicha1.ogg','sound/ambience/ambicha2.ogg','sound/ambience/ambicha3.ogg','sound/ambience/ambicha4.ogg','sound/music/traitor.ogg') + else if(istype(src, /area/medical/morgue)) + sound = pick('sound/ambience/ambimo1.ogg','sound/ambience/ambimo2.ogg','sound/music/main.ogg') + else if(type == /area) + sound = pick('sound/ambience/ambispace.ogg','sound/music/title2.ogg','sound/music/space.ogg','sound/music/main.ogg','sound/music/traitor.ogg') + else if(istype(src, /area/engine)) + sound = pick('sound/ambience/ambisin1.ogg','sound/ambience/ambisin2.ogg','sound/ambience/ambisin3.ogg','sound/ambience/ambisin4.ogg') + else if(istype(src, /area/AIsattele) || istype(src, /area/turret_protected/ai) || istype(src, /area/turret_protected/ai_upload) || istype(src, /area/turret_protected/ai_upload_foyer)) + sound = pick('sound/ambience/ambimalf.ogg') + else if(istype(src, /area/mine/explored) || istype(src, /area/mine/unexplored)) + sound = pick('sound/ambience/ambimine.ogg', 'sound/ambience/song_game.ogg') + musVolume = 25 + else if(istype(src, /area/tcommsat) || istype(src, /area/turret_protected/tcomwest) || istype(src, /area/turret_protected/tcomeast) || istype(src, /area/turret_protected/tcomfoyer) || istype(src, /area/turret_protected/tcomsat)) + sound = pick('sound/ambience/ambisin2.ogg', 'sound/ambience/signal.ogg', 'sound/ambience/signal.ogg', 'sound/ambience/ambigen10.ogg') + else + sound = pick('sound/ambience/ambigen1.ogg','sound/ambience/ambigen3.ogg','sound/ambience/ambigen4.ogg','sound/ambience/ambigen5.ogg','sound/ambience/ambigen6.ogg','sound/ambience/ambigen7.ogg','sound/ambience/ambigen8.ogg','sound/ambience/ambigen9.ogg','sound/ambience/ambigen10.ogg','sound/ambience/ambigen11.ogg','sound/ambience/ambigen12.ogg','sound/ambience/ambigen14.ogg') if(!L.client.played) L << sound(sound, repeat = 0, wait = 0, volume = musVolume, channel = 1) diff --git a/code/modules/client/preferences_toggles.dm b/code/modules/client/preferences_toggles.dm index a0cdd527b30..2831d63a652 100644 --- a/code/modules/client/preferences_toggles.dm +++ b/code/modules/client/preferences_toggles.dm @@ -131,9 +131,22 @@ else src << "You will no longer hear ambient sounds." src << sound(null, repeat = 0, wait = 0, volume = 0, channel = 1) - 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! +/client/verb/Toggle_Buzz() //No more headaches because headphones bump up shipambience.ogg to insanity levels. + set name = "Hear/Silence White Noise" + set category = "Preferences" + set desc = "Toggles hearing ambient white noise" + prefs.sound ^= SOUND_BUZZ + prefs.save_preferences(src) + if(prefs.sound & SOUND_BUZZ) + src << "You will now hear ambient white noise." + else + src << "You will no longer hear ambient white noise." + src << sound(null, repeat = 0, wait = 0, volume = 0, channel = 2) + feedback_add_details("admin_verb","TBuzz") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! + + /client/verb/Toggle_Heartbeat() //to toggle off heartbeat sounds, in case they get too annoying set name = "Hear/Silence Heartbeat" set category = "Preferences" diff --git a/code/setup.dm b/code/setup.dm index 1f8956ad74c..a3d7c9138fb 100644 --- a/code/setup.dm +++ b/code/setup.dm @@ -733,8 +733,9 @@ var/list/TAGGERLOCATIONS = list("Disposals", #define SOUND_LOBBY 8 #define SOUND_STREAMING 16 #define SOUND_HEARTBEAT 32 +#define SOUND_BUZZ 64 -#define SOUND_DEFAULT (SOUND_ADMINHELP|SOUND_MIDI|SOUND_AMBIENCE|SOUND_LOBBY|SOUND_STREAMING|SOUND_HEARTBEAT) +#define SOUND_DEFAULT (SOUND_ADMINHELP|SOUND_MIDI|SOUND_AMBIENCE|SOUND_LOBBY|SOUND_STREAMING|SOUND_HEARTBEAT|SOUND_BUZZ) #define TOGGLES_DEFAULT (CHAT_OOC|CHAT_DEAD|CHAT_GHOSTEARS|CHAT_GHOSTSIGHT|CHAT_PRAYER|CHAT_RADIO|CHAT_ATTACKLOGS|CHAT_LOOC) #define BE_TRAITOR 1