Files
Bubberstation/code/modules/client/preferences/voice.dm
T
Watermelon914 fc854e7076 Removes TTS voice disable option (#76530)
## About The Pull Request
Removes the TTS voice disable option, which was already unavailable on
TG as it was set to off by default. The reason this was added was so
that downstreams could toggle the config on or off.

## Why It's Good For The Game
I think this option fundamentally undermines the TTS system because it
allows individual players to disable their voice globally, meaning that
players who have TTS enabled will not be able to hear them.

This worsens the experience for players who have TTS enabled and it's
not something I want to include as an option. If players don't like
their voice, they can turn TTS off for themselves so that they don't
hear the voices. If players don't want to customize their voice, they
can quickly choose a random voice, and we can take directions in the
future to make voice randomization consistent with gender so that a male
does not get randomly assigned a female voice and vice versa.

This option is already unavailable on TG servers because it was
primarily added for downstreams, but I don't think giving downstreams
the option to undermine the TTS system is the right direction to take.
Downstreams are still completely free to code this option on their own
codebase.

---------

Co-authored-by: Watermelon914 <3052169-Watermelon914@users.noreply.gitlab.com>
2023-07-07 06:31:12 -04:00

46 lines
1.5 KiB
Plaintext

/// TTS voice preference
/datum/preference/choiced/voice
savefile_identifier = PREFERENCE_CHARACTER
savefile_key = "tts_voice"
category = PREFERENCE_CATEGORY_NON_CONTEXTUAL
/datum/preference/choiced/voice/is_accessible(datum/preferences/preferences)
if(!SStts.tts_enabled)
return FALSE
return ..()
/datum/preference/choiced/voice/init_possible_values()
if(SStts.tts_enabled)
return SStts.available_speakers
if(fexists("data/cached_tts_voices.json"))
var/list/text_data = rustg_file_read("data/cached_tts_voices.json")
var/list/cached_data = json_decode(text_data)
if(!cached_data)
return list("invalid")
return cached_data
return list("invalid")
/datum/preference/choiced/voice/apply_to_human(mob/living/carbon/human/target, value)
if(SStts.tts_enabled && !(value in SStts.available_speakers))
value = pick(SStts.available_speakers) // As a failsafe
target.voice = value
/datum/preference/numeric/tts_voice_pitch
savefile_identifier = PREFERENCE_CHARACTER
savefile_key = "tts_voice_pitch"
category = PREFERENCE_CATEGORY_NON_CONTEXTUAL
minimum = -12
maximum = 12
/datum/preference/numeric/tts_voice_pitch/is_accessible(datum/preferences/preferences)
if(!SStts.tts_enabled || !SStts.pitch_enabled)
return FALSE
return ..()
/datum/preference/numeric/tts_voice_pitch/create_default_value()
return 0
/datum/preference/numeric/tts_voice_pitch/apply_to_human(mob/living/carbon/human/target, value)
if(SStts.tts_enabled && SStts.pitch_enabled)
target.pitch = value