diff --git a/code/game/area/areas.dm b/code/game/area/areas.dm index ff617f163e9..f13224e1089 100644 --- a/code/game/area/areas.dm +++ b/code/game/area/areas.dm @@ -332,7 +332,7 @@ L.lastarea = newarea // 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.toggles & SOUND_AMBIENCE))) return + if(!(L && L.client && (L.client.prefs.sound & SOUND_AMBIENCE))) return if(!L.client.ambience_playing) L.client.ambience_playing = 1 diff --git a/code/game/sound.dm b/code/game/sound.dm index 6eaa6abe651..a1653ba20cd 100644 --- a/code/game/sound.dm +++ b/code/game/sound.dm @@ -55,7 +55,7 @@ var/const/SURROUND_CAP = 7 /client/proc/playtitlemusic() if(!ticker || !ticker.login_music) return - if(prefs.toggles & SOUND_LOBBY) + if(prefs.sound & SOUND_LOBBY) src << sound(ticker.login_music, repeat = 0, wait = 0, volume = 85, channel = 1) // MAD JAMS /proc/get_rand_frequency() diff --git a/code/modules/admin/verbs/adminhelp.dm b/code/modules/admin/verbs/adminhelp.dm index 89a56065f06..870f7181453 100644 --- a/code/modules/admin/verbs/adminhelp.dm +++ b/code/modules/admin/verbs/adminhelp.dm @@ -95,7 +95,7 @@ var/list/adminhelp_ignored_words = list("unknown","the","a","an","of","monkey"," if((R_ADMIN|R_MOD) & X.holder.rights) if(X.is_afk()) admin_number_afk++ - if(X.prefs.toggles & SOUND_ADMINHELP) + if(X.prefs.sound & SOUND_ADMINHELP) X << 'sound/effects/adminhelp.ogg' X << msg diff --git a/code/modules/admin/verbs/adminpm.dm b/code/modules/admin/verbs/adminpm.dm index d6ff60c2a2f..28f5a4e46e7 100644 --- a/code/modules/admin/verbs/adminpm.dm +++ b/code/modules/admin/verbs/adminpm.dm @@ -119,7 +119,7 @@ //play the recieving admin the adminhelp sound (if they have them enabled) //non-admins shouldn't be able to disable this - if(C.prefs.toggles & SOUND_ADMINHELP) + if(C.prefs.sound & SOUND_ADMINHELP) C << 'sound/effects/adminhelp.ogg' /* diff --git a/code/modules/admin/verbs/playsound.dm b/code/modules/admin/verbs/playsound.dm index 20a3862300f..7264fac8f9f 100644 --- a/code/modules/admin/verbs/playsound.dm +++ b/code/modules/admin/verbs/playsound.dm @@ -9,7 +9,7 @@ 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) - if(M.client.prefs.toggles & SOUND_MIDI) + if(M.client.prefs.sound & SOUND_MIDI) M << uploaded_sound feedback_add_details("admin_verb","PGS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index 31a6c26db44..b1e681021a5 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -45,6 +45,7 @@ datum/preferences var/be_special = 0 //Special role selection var/UI_style = "Midnight" var/toggles = TOGGLES_DEFAULT + var/sound = SOUND_DEFAULT var/UI_style_color = "#ffffff" var/UI_style_alpha = 255 @@ -303,13 +304,14 @@ datum/preferences dat += "Custom UI(recommended for White UI):
" dat += "-Color: [UI_style_color]
__

" dat += "-Alpha(transparence): [UI_style_alpha]
" - dat += "Play admin midis: [(toggles & SOUND_MIDI) ? "Yes" : "No"]
" - dat += "Play lobby music: [(toggles & SOUND_LOBBY) ? "Yes" : "No"]
" + dat += "Play admin midis: [(sound & SOUND_MIDI) ? "Yes" : "No"]
" + dat += "Play lobby music: [(sound & SOUND_LOBBY) ? "Yes" : "No"]
" + dat += "Hear player voices: [(sound & SOUND_VOICES) ? "Yes" : "No"]
" dat += "Randomized Character Slot: [randomslot ? "Yes" : "No"]
" dat += "Ghost ears: [(toggles & CHAT_GHOSTEARS) ? "Nearest Creatures" : "All Speech"]
" dat += "Ghost sight: [(toggles & CHAT_GHOSTSIGHT) ? "Nearest Creatures" : "All Emotes"]
" dat += "Ghost radio: [(toggles & CHAT_GHOSTRADIO) ? "Nearest Speakers" : "All Chatter"]
" - dat += "Hear player voices: [(toggles & SOUND_VOICES) ? "Yes" : "No"]
" + if(config.allow_Metadata) dat += "OOC Notes: Edit
" @@ -1244,7 +1246,7 @@ datum/preferences if("hear_adminhelps") - toggles ^= SOUND_ADMINHELP + sound ^= SOUND_ADMINHELP if("ui") switch(UI_style) @@ -1274,11 +1276,11 @@ datum/preferences randomslot = !randomslot if("hear_midis") - toggles ^= SOUND_MIDI + sound ^= SOUND_MIDI if("lobby_music") - toggles ^= SOUND_LOBBY - if(toggles & SOUND_LOBBY) + sound ^= SOUND_LOBBY + if(sound & SOUND_LOBBY) user << sound(ticker.login_music, repeat = 0, wait = 0, volume = 85, channel = 1) else user << sound(null, repeat = 0, wait = 0, volume = 85, channel = 1) @@ -1293,7 +1295,7 @@ datum/preferences toggles ^= CHAT_GHOSTRADIO if("player_voices") - toggles ^= SOUND_VOICES + sound ^= SOUND_VOICES if("save") save_preferences() diff --git a/code/modules/client/preferences_savefile.dm b/code/modules/client/preferences_savefile.dm index 262f27330bb..a7934c7da8b 100644 --- a/code/modules/client/preferences_savefile.dm +++ b/code/modules/client/preferences_savefile.dm @@ -54,6 +54,7 @@ S["be_special"] >> be_special S["default_slot"] >> default_slot S["toggles"] >> toggles + S["sound"] >> sound S["UI_style_color"] >> UI_style_color S["UI_style_alpha"] >> UI_style_alpha S["randomslot"] >> randomslot @@ -65,6 +66,7 @@ be_special = sanitize_integer(be_special, 0, 65535, initial(be_special)) default_slot = sanitize_integer(default_slot, 1, MAX_SAVE_SLOTS, initial(default_slot)) toggles = sanitize_integer(toggles, 0, 65535, initial(toggles)) + sound = sanitize_integer(sound, 0, 65535, initial(toggles)) UI_style_color = sanitize_hexcolor(UI_style_color, initial(UI_style_color)) UI_style_alpha = sanitize_integer(UI_style_alpha, 0, 255, initial(UI_style_alpha)) randomslot = sanitize_integer(randomslot, 0, 1, initial(randomslot)) @@ -85,6 +87,7 @@ S["be_special"] << be_special S["default_slot"] << default_slot S["toggles"] << toggles + S["sound"] << sound S["UI_style_color"] << UI_style_color S["UI_style_alpha"] << UI_style_alpha S["randomslot"] << randomslot diff --git a/code/modules/client/preferences_toggles.dm b/code/modules/client/preferences_toggles.dm index 9e9c8218ef0..fc52d59c6ee 100644 --- a/code/modules/client/preferences_toggles.dm +++ b/code/modules/client/preferences_toggles.dm @@ -41,7 +41,7 @@ set category = "Preferences" set desc = "Toggle hearing a notification when admin PMs are recieved" if(!holder) return - prefs.toggles ^= SOUND_ADMINHELP + prefs.sound ^= SOUND_ADMINHELP prefs.save_preferences() usr << "You will [(prefs.toggles & SOUND_ADMINHELP) ? "now" : "no longer"] hear a sound when adminhelps arrive." feedback_add_details("admin_verb","AHS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! @@ -73,9 +73,9 @@ set name = "Hear/Silence LobbyMusic" set category = "Preferences" set desc = "Toggles hearing the GameLobby music" - prefs.toggles ^= SOUND_LOBBY + prefs.sound ^= SOUND_LOBBY prefs.save_preferences() - if(prefs.toggles & SOUND_LOBBY) + if(prefs.sound & SOUND_LOBBY) src << "You will now hear music in the game lobby." if(istype(mob, /mob/new_player)) playtitlemusic() @@ -89,18 +89,18 @@ set name = "Toggle player voices" set category = "Preferences" set desc = "Toggle hearing player voice sounds" - prefs.toggles ^= SOUND_VOICES + prefs.sound ^= SOUND_VOICES prefs.save_preferences() - src << "You will [(prefs.toggles & SOUND_VOICES) ? "now" : "no longer"] hear voices of players around you, or your own voice." + src << "You will [(prefs.sound & SOUND_VOICES) ? "now" : "no longer"] hear voices of players around you, or your own voice." feedback_add_details("admin_verb","TVoice") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /client/verb/togglemidis() set name = "Hear/Silence Midis" set category = "Preferences" set desc = "Toggles hearing sounds uploaded by admins" - prefs.toggles ^= SOUND_MIDI + prefs.sound ^= SOUND_MIDI prefs.save_preferences() - if(prefs.toggles & SOUND_MIDI) + if(prefs.sound & SOUND_MIDI) src << "You will now hear any sounds uploaded by admins." else var/sound/break_sound = sound(null, repeat = 0, wait = 0, channel = 777) @@ -133,9 +133,9 @@ set name = "Hear/Silence Ambience" set category = "Preferences" set desc = "Toggles hearing ambient sound effects" - prefs.toggles ^= SOUND_AMBIENCE + prefs.sound ^= SOUND_AMBIENCE prefs.save_preferences() - if(prefs.toggles & SOUND_AMBIENCE) + if(prefs.sound & SOUND_AMBIENCE) src << "You will now hear ambient sounds." else src << "You will no longer hear ambient sounds." diff --git a/code/modules/mob/living/say.dm b/code/modules/mob/living/say.dm index 30dd2d400ef..d72ec4df6cc 100644 --- a/code/modules/mob/living/say.dm +++ b/code/modules/mob/living/say.dm @@ -409,8 +409,8 @@ var/list/department_radio_keys = list( if(message_mode == null && fexists("sound/playervoices/[src.ckey].ogg")) if(M.client) if(M.client.prefs) - if(M.client.prefs.toggles & SOUND_VOICES) - playsound(src.loc, "sound/playervoices/[src.ckey].ogg", 70, 0, 5, 1) + if(M.client.prefs.sound & SOUND_VOICES) + playsound_local(src.loc, "sound/playervoices/[src.ckey].ogg", 70, 0, 5, 1) if(!istype(M, /mob/new_player)) if(M && M.stat == DEAD) if ((M.client.prefs.toggles & CHAT_GHOSTEARS) && M in onscreen) diff --git a/code/setup.dm b/code/setup.dm index 032bef27bf3..47e677e37ff 100644 --- a/code/setup.dm +++ b/code/setup.dm @@ -645,24 +645,25 @@ var/list/TAGGERLOCATIONS = list("Disposals", #define R_HOST 65535 //Preference toggles +#define CHAT_OOC 1 +#define CHAT_DEAD 2 +#define CHAT_GHOSTEARS 4 +#define CHAT_GHOSTSIGHT 8 +#define CHAT_PRAYER 16 +#define CHAT_RADIO 32 +#define CHAT_ATTACKLOGS 64 +#define CHAT_DEBUGLOGS 128 +#define CHAT_LOOC 256 +#define CHAT_GHOSTRADIO 512 + #define SOUND_ADMINHELP 1 #define SOUND_MIDI 2 #define SOUND_AMBIENCE 4 #define SOUND_LOBBY 8 -#define CHAT_OOC 16 -#define CHAT_DEAD 32 -#define CHAT_GHOSTEARS 64 -#define CHAT_GHOSTSIGHT 128 -#define CHAT_PRAYER 256 -#define CHAT_RADIO 512 -#define CHAT_ATTACKLOGS 1024 -#define CHAT_DEBUGLOGS 2048 -#define CHAT_LOOC 4096 -#define CHAT_GHOSTRADIO 8192 -#define SOUND_VOICES 16384 +#define SOUND_VOICES 16 - -#define TOGGLES_DEFAULT (SOUND_ADMINHELP|SOUND_MIDI|SOUND_AMBIENCE|SOUND_LOBBY|CHAT_OOC|CHAT_DEAD|CHAT_GHOSTEARS|CHAT_GHOSTSIGHT|CHAT_PRAYER|CHAT_RADIO|CHAT_ATTACKLOGS|CHAT_LOOC) +#define SOUND_DEFAULT (SOUND_ADMINHELP|SOUND_MIDI|SOUND_AMBIENCE|SOUND_LOBBY) +#define TOGGLES_DEFAULT (CHAT_OOC|CHAT_DEAD|CHAT_GHOSTEARS|CHAT_GHOSTSIGHT|CHAT_PRAYER|CHAT_RADIO|CHAT_ATTACKLOGS|CHAT_LOOC) #define BE_TRAITOR 1 #define BE_OPERATIVE 2