diff --git a/soh/assets/custom/accessibility/texts/kaleidoscope_eng.json b/soh/assets/custom/accessibility/texts/kaleidoscope_eng.json index 10b016b32..a89c12889 100644 --- a/soh/assets/custom/accessibility/texts/kaleidoscope_eng.json +++ b/soh/assets/custom/accessibility/texts/kaleidoscope_eng.json @@ -12,6 +12,8 @@ "equipped": "$0 - Equipped", "save_prompt": "Would you like to save?", "game_saved": "Game saved", + "game_over": "Game Over", + "continue_game": "Continue playing?", "assigned_to": "Assigned to $0", "0": "Deku Stick - $0", "1": "Deku Nut - $0", diff --git a/soh/assets/custom/accessibility/texts/kaleidoscope_fra.json b/soh/assets/custom/accessibility/texts/kaleidoscope_fra.json index 820eb4cbc..116c19a41 100644 --- a/soh/assets/custom/accessibility/texts/kaleidoscope_fra.json +++ b/soh/assets/custom/accessibility/texts/kaleidoscope_fra.json @@ -10,8 +10,10 @@ "equip_menu": "Equipment", "overworld": "Surmonde", "equipped": "$0 - Équipé", - "save_prompt": "Voulez-vous sauvegarder?", + "save_prompt": "Voulez-vous sauvegarder ?", "game_saved": "Jeu sauvegardé", + "game_over": "Game Over", + "continue_game": "Continuer la partie ?", "assigned_to": "Assigné au $0", "0": "Bâton Mojo - $0", "1": "Noix Mojo - $0", diff --git a/soh/assets/custom/accessibility/texts/kaleidoscope_ger.json b/soh/assets/custom/accessibility/texts/kaleidoscope_ger.json index 630d933fc..649790da3 100644 --- a/soh/assets/custom/accessibility/texts/kaleidoscope_ger.json +++ b/soh/assets/custom/accessibility/texts/kaleidoscope_ger.json @@ -10,8 +10,10 @@ "equip_menu": "Ausrüstung", "overworld": "Überwelt", "equipped": "$0 - Ausgerüstet", - "save_prompt": "Spielstand sichern?", + "save_prompt": "Spielstand sichern ?", "game_saved": "Spielstand gesichert", + "game_over": "Game Over", + "continue_game": "Spiel fortsetzen ?", "assigned_to": "$0 zugeordnet", "0": "Deku-Stab - $0", "1": "Deku-Nuß - $0", diff --git a/soh/soh/Enhancements/tts/tts.cpp b/soh/soh/Enhancements/tts/tts.cpp index 0fde40656..0b46cd18f 100644 --- a/soh/soh/Enhancements/tts/tts.cpp +++ b/soh/soh/Enhancements/tts/tts.cpp @@ -228,6 +228,68 @@ void RegisterOnKaleidoscopeUpdateHook() { return; } + // Game over + prompts + if (pauseCtx->state >= 0xC && pauseCtx->state <= 0x10) { + // Reset prompt tracker after state change + if (prevState != pauseCtx->state) { + prevPromptChoice = -1; + } + + switch (pauseCtx->state) { + // Game over in full alpha + case 0xC: { + // Fire once on state change + if (prevState != pauseCtx->state) { + auto translation = GetParameritizedText("game_over", TEXT_BANK_KALEIDO, nullptr); + SpeechSynthesizer::Instance->Speak(translation.c_str(), GetLanguageCode()); + } + break; + } + // Prompt for save + case 0xE: { + if (prevPromptChoice != pauseCtx->promptChoice) { + auto prompt = GetParameritizedText(pauseCtx->promptChoice == 0 ? "yes" : "no", TEXT_BANK_MISC, nullptr); + if (prevPromptChoice == -1) { + auto translation = GetParameritizedText("save_prompt", TEXT_BANK_KALEIDO, nullptr); + SpeechSynthesizer::Instance->Speak((translation + " - " + prompt).c_str(), GetLanguageCode()); + } else { + SpeechSynthesizer::Instance->Speak(prompt.c_str(), GetLanguageCode()); + } + + prevPromptChoice = pauseCtx->promptChoice; + } + break; + } + // Game saved + case 0xF: { + // Fire once on state change + if (prevState != pauseCtx->state) { + auto translation = GetParameritizedText("game_saved", TEXT_BANK_KALEIDO, nullptr); + SpeechSynthesizer::Instance->Speak(translation.c_str(), GetLanguageCode()); + } + break; + } + // Prompt to continue playing + case 0x10: { + if (prevPromptChoice != pauseCtx->promptChoice) { + auto prompt = GetParameritizedText(pauseCtx->promptChoice == 0 ? "yes" : "no", TEXT_BANK_MISC, nullptr); + if (prevPromptChoice == -1) { + auto translation = GetParameritizedText("continue_game", TEXT_BANK_KALEIDO, nullptr); + SpeechSynthesizer::Instance->Speak((translation + " - " + prompt).c_str(), GetLanguageCode()); + } else { + SpeechSynthesizer::Instance->Speak(prompt.c_str(), GetLanguageCode()); + } + + prevPromptChoice = pauseCtx->promptChoice; + } + break; + } + } + + prevState = pauseCtx->state; + return; + } + // Announce page when // Kaleido pages are rotating and page halfway rotated // Or Kaleido was just opened