Makes TTS blips/enabled into one pref (#76558)

## About The Pull Request


![image](https://github.com/tgstation/tgstation/assets/53777086/6b06c212-060e-415f-b1fd-a6ac9f651627)

I actually do not know how to test this locally as I don't know how to
set TTS up, hope it works.

## Why It's Good For The Game

It's 2 buttons, one only works depending on the other, I don't think it
makes sense.

## Changelog

🆑
qol: The TTS and TTS Blips option is now one choiced preference.
/🆑
This commit is contained in:
John Willard
2023-07-22 04:50:07 -07:00
committed by GitHub
parent c685e48834
commit ec6b206ac5
7 changed files with 43 additions and 24 deletions
@@ -0,0 +1,12 @@
/// Previously, tts enabled/blip were individual buttons
/// PR #76558 changed them to one dropdown choice.
/// This migration transfers the player's existing preferences into the new dropdown
/datum/preferences/proc/update_tts_blip_prefs()
var/sound_blips_enabled = savefile.get_entry("sound_tts_blips")
if(sound_blips_enabled)
write_preference(GLOB.preference_entries[/datum/preference/choiced/sound_tts], TTS_SOUND_BLIPS)
return
var/tts_enabled = savefile.get_entry("sound_tts")
if(!tts_enabled)
write_preference(GLOB.preference_entries[/datum/preference/choiced/sound_tts], TTS_SOUND_OFF)
+6 -6
View File
@@ -28,16 +28,16 @@
savefile_key = "sound_instruments"
savefile_identifier = PREFERENCE_PLAYER
/datum/preference/toggle/sound_tts
/datum/preference/choiced/sound_tts
category = PREFERENCE_CATEGORY_GAME_PREFERENCES
savefile_key = "sound_tts"
savefile_identifier = PREFERENCE_PLAYER
/datum/preference/toggle/sound_tts_blips
category = PREFERENCE_CATEGORY_GAME_PREFERENCES
savefile_key = "sound_tts_blips"
savefile_identifier = PREFERENCE_PLAYER
default_value = FALSE
/datum/preference/choiced/sound_tts/init_possible_values()
return list(TTS_SOUND_ENABLED, TTS_SOUND_BLIPS, TTS_SOUND_OFF)
/datum/preference/choiced/sound_tts/create_default_value()
return TTS_SOUND_ENABLED
/datum/preference/numeric/sound_tts_volume
category = PREFERENCE_CATEGORY_GAME_PREFERENCES
+4 -1
View File
@@ -5,7 +5,7 @@
// You do not need to raise this if you are adding new values that have sane defaults.
// Only raise this value when changing the meaning/format/name/layout of an existing value
// where you would want the updater procs below to run
#define SAVEFILE_VERSION_MAX 43
#define SAVEFILE_VERSION_MAX 44
/*
SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Carn
@@ -91,6 +91,9 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
if (current_version < 41)
migrate_preferences_to_tgui_prefs_menu()
if (current_version < 44)
update_tts_blip_prefs()
/datum/preferences/proc/update_character(current_version, list/save_data)
if (current_version < 41)
migrate_character_to_tgui_prefs_menu()