mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-24 12:37:26 +01:00
Merge pull request #12616 from SteelSlayer/ai-voice-to-text-pref
Adds a "Hear/Silence AI Voice Announcements" verb to the preferences tab
This commit is contained in:
@@ -36,6 +36,15 @@
|
||||
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"
|
||||
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"
|
||||
|
||||
@@ -135,6 +135,22 @@ var/announcing_vox = 0 // Stores the time of the last announcement
|
||||
for(var/word in words)
|
||||
play_vox_word(word, src.z, null)
|
||||
|
||||
ai_voice_announcement_to_text(words)
|
||||
|
||||
|
||||
/mob/living/silicon/ai/proc/ai_voice_announcement_to_text(words)
|
||||
var/words_string = jointext(words, " ")
|
||||
var/formatted_message = "<h1 class='alert'>A.I. Announcement</h1>"
|
||||
formatted_message += "<br><span class='alert'>[words_string]</span>"
|
||||
formatted_message += "<br><span class='alert'> -[src]</span>"
|
||||
|
||||
for(var/player in GLOB.player_list)
|
||||
var/mob/M = player
|
||||
if(M.client && !(M.client.prefs.sound & SOUND_AI_VOICE))
|
||||
var/turf/T = get_turf(M)
|
||||
if(T && T.z == z && M.can_hear())
|
||||
SEND_SOUND(M, 'sound/misc/notice2.ogg')
|
||||
to_chat(M, formatted_message)
|
||||
|
||||
/proc/play_vox_word(word, z_level, mob/only_listener)
|
||||
|
||||
@@ -150,7 +166,7 @@ var/announcing_vox = 0 // Stores the time of the last announcement
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user