diff --git a/code/__DEFINES/preferences.dm b/code/__DEFINES/preferences.dm index 54fd59307f4..eb5fad0ff27 100644 --- a/code/__DEFINES/preferences.dm +++ b/code/__DEFINES/preferences.dm @@ -7,9 +7,10 @@ #define SOUND_BUZZ 64 #define SOUND_INSTRUMENTS 128 #define SOUND_MENTORHELP 256 -#define SOUND_DISCO 512 +#define SOUND_DISCO 512 +#define SOUND_AI_VOICE 1024 -#define SOUND_DEFAULT (SOUND_ADMINHELP|SOUND_MIDI|SOUND_AMBIENCE|SOUND_LOBBY|SOUND_HEARTBEAT|SOUND_BUZZ|SOUND_INSTRUMENTS|SOUND_MENTORHELP|SOUND_DISCO) +#define SOUND_DEFAULT (SOUND_ADMINHELP|SOUND_MIDI|SOUND_AMBIENCE|SOUND_LOBBY|SOUND_HEARTBEAT|SOUND_BUZZ|SOUND_INSTRUMENTS|SOUND_MENTORHELP|SOUND_DISCO|SOUND_AI_VOICE) #define CHAT_OOC 1 #define CHAT_DEAD 2 diff --git a/code/modules/client/preference/preferences_toggles.dm b/code/modules/client/preference/preferences_toggles.dm index d5e4b2bf3fe..3914b43b8c7 100644 --- a/code/modules/client/preference/preferences_toggles.dm +++ b/code/modules/client/preference/preferences_toggles.dm @@ -36,6 +36,16 @@ to_chat(usr, "You will [(prefs.toggles & CHAT_RADIO) ? "now" : "no longer"] see radio chatter from radios or speakers") feedback_add_details("admin_verb","THR") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! +/client/verb/toggle_ai_voice_annoucements() + set name = "Hear/Silence AI Voice Announcements" + set category = "Preferences" + set desc = "Toggle hearing AI annoucements in voice form or in text form" + if(!holder) return + prefs.sound ^= SOUND_AI_VOICE + prefs.save_preferences(src) + to_chat(usr, "[(prefs.sound & SOUND_AI_VOICE) ? "You will now hear AI announcements." : "AI annoucements will now be converted to text."] ") + feedback_add_details("admin_verb","TAIvoice") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! + /client/proc/toggleadminhelpsound() set name = "Hear/Silence Admin Bwoinks" set category = "Preferences" diff --git a/code/modules/mob/living/silicon/ai/say.dm b/code/modules/mob/living/silicon/ai/say.dm index 36f248cd2c2..24cf464234b 100644 --- a/code/modules/mob/living/silicon/ai/say.dm +++ b/code/modules/mob/living/silicon/ai/say.dm @@ -134,6 +134,22 @@ var/const/VOX_PATH = "sound/vox_fem/" for(var/word in words) play_vox_word(word, src.z, null) + ai_voice_announcement_to_text(words, src) + + +/proc/ai_voice_announcement_to_text(words, ai) + var/mob/living/silicon/ai/AI = ai + var/words_string = jointext(words, " ") + var/formatted_message = "

A.I. Announcement

" + formatted_message += "
[words_string]" + formatted_message += "
-[AI]" + + for(var/mob/M in GLOB.player_list) + if(M.client && !(M.client.prefs.sound & SOUND_AI_VOICE)) + var/turf/T = get_turf(M) + if(T && T.z == AI.z && M.can_hear()) + M << 'sound/misc/notice2.ogg' + to_chat(M, formatted_message) /proc/play_vox_word(word, z_level, mob/only_listener) @@ -149,7 +165,7 @@ var/const/VOX_PATH = "sound/vox_fem/" if(!only_listener) // Play voice for all mobs in the z level for(var/mob/M in GLOB.player_list) - if(M.client) + if(M.client && M.client.prefs.sound & SOUND_AI_VOICE) var/turf/T = get_turf(M) if(T && T.z == z_level && M.can_hear()) M << voice