mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-11-25 02:42:18 -05:00
Add TTS for Game Over menu (#3338)
This commit is contained in:
parent
7e9efeeadb
commit
f1f04a5583
@ -12,6 +12,8 @@
|
|||||||
"equipped": "$0 - Equipped",
|
"equipped": "$0 - Equipped",
|
||||||
"save_prompt": "Would you like to save?",
|
"save_prompt": "Would you like to save?",
|
||||||
"game_saved": "Game saved",
|
"game_saved": "Game saved",
|
||||||
|
"game_over": "Game Over",
|
||||||
|
"continue_game": "Continue playing?",
|
||||||
"assigned_to": "Assigned to $0",
|
"assigned_to": "Assigned to $0",
|
||||||
"0": "Deku Stick - $0",
|
"0": "Deku Stick - $0",
|
||||||
"1": "Deku Nut - $0",
|
"1": "Deku Nut - $0",
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
"equipped": "$0 - Équipé",
|
"equipped": "$0 - Équipé",
|
||||||
"save_prompt": "Voulez-vous sauvegarder ?",
|
"save_prompt": "Voulez-vous sauvegarder ?",
|
||||||
"game_saved": "Jeu sauvegardé",
|
"game_saved": "Jeu sauvegardé",
|
||||||
|
"game_over": "Game Over",
|
||||||
|
"continue_game": "Continuer la partie ?",
|
||||||
"assigned_to": "Assigné au $0",
|
"assigned_to": "Assigné au $0",
|
||||||
"0": "Bâton Mojo - $0",
|
"0": "Bâton Mojo - $0",
|
||||||
"1": "Noix Mojo - $0",
|
"1": "Noix Mojo - $0",
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
"equipped": "$0 - Ausgerüstet",
|
"equipped": "$0 - Ausgerüstet",
|
||||||
"save_prompt": "Spielstand sichern ?",
|
"save_prompt": "Spielstand sichern ?",
|
||||||
"game_saved": "Spielstand gesichert",
|
"game_saved": "Spielstand gesichert",
|
||||||
|
"game_over": "Game Over",
|
||||||
|
"continue_game": "Spiel fortsetzen ?",
|
||||||
"assigned_to": "$0 zugeordnet",
|
"assigned_to": "$0 zugeordnet",
|
||||||
"0": "Deku-Stab - $0",
|
"0": "Deku-Stab - $0",
|
||||||
"1": "Deku-Nuß - $0",
|
"1": "Deku-Nuß - $0",
|
||||||
|
@ -228,6 +228,68 @@ void RegisterOnKaleidoscopeUpdateHook() {
|
|||||||
return;
|
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
|
// Announce page when
|
||||||
// Kaleido pages are rotating and page halfway rotated
|
// Kaleido pages are rotating and page halfway rotated
|
||||||
// Or Kaleido was just opened
|
// Or Kaleido was just opened
|
||||||
|
Loading…
Reference in New Issue
Block a user