The new option only works as intended if the engine that have TTS support apply their own settings. It cannot be globally implemented before and after runGame(), since the engines don't all use the same config manager variables (sometimes "tts_enabled_speech", "tts_enabled" or "tts_narrator, sometimes more than one of these).
In this screen, the UI is refreshed with many short sentences (e.g.
"Strength"), which are drawn very quickly. Since this causes TTS to
constantly start and stop, it introduces an unwanted lag, thus we
skip TTS in that screen
We now remove all color codes from strings, and only handle texts in
TTS if they contain at least one vowel. This allows us to skip texts
such as the one shown when talking to the alien in SQ5 room 500, where
a series of symbols is shown, as part of a joke
kDisplay is used to redraw parts of the UI, so it's not ideal to hook
TTS there, as it keeps spamming sentences that get redrawn in the UI
frequently, such as the intro text and the points in SQ5
This is based on the work done for GSoC by @taylorzhancher in PR #3256
Highlights:
- TTS has been hooked globally onto places where text is shown
- TTS is currently performed for textboxes and button texts
- TTS stops when text windows are disposed (which enhances the in-game
experience)
- No game-specific logic has been added
- This hasn't been extensively tested with all SCI16 games yet
- There will be cases that are not handled properly yet
- The TTS functions have been grouped under a SciTTS class