[Scummvm-git-logs] scummvm master -> b3e15d584e0aea738c46557e323049fd51d63fc3

criezy noreply at scummvm.org
Sun Jun 5 13:15:36 UTC 2022


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
b3e15d584e Engines: Properly initialize TTSManager for unsupported gamae dialogs


Commit: b3e15d584e0aea738c46557e323049fd51d63fc3
    https://github.com/scummvm/scummvm/commit/b3e15d584e0aea738c46557e323049fd51d63fc3
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2022-06-05T14:15:31+01:00

Commit Message:
Engines: Properly initialize TTSManager for unsupported gamae dialogs

This fixes bug #11550: TTS: Language is wrong for unsupported game warning

Changed paths:
    engines/engine.cpp


diff --git a/engines/engine.cpp b/engines/engine.cpp
index 6b05b9408bd..41d00be5574 100644
--- a/engines/engine.cpp
+++ b/engines/engine.cpp
@@ -707,21 +707,41 @@ void Engine::openMainMenuDialog() {
 
 bool Engine::warnUserAboutUnsupportedGame(Common::String msg) {
 	if (ConfMan.getBool("enable_unsupported_game_warning")) {
+		Common::TextToSpeechManager *ttsMan = g_system->getTextToSpeechManager();
+		if (ttsMan != nullptr) {
+			ttsMan->pushState();
+			g_gui.initTextToSpeech();
+		}
+
 		GUI::MessageDialog alert(!msg.empty() ? _("WARNING: ") + Common::U32String(msg) + _(" Shall we still run the game?") :
 				 _("WARNING: The game you are about to start is"
 			" not yet fully supported by ScummVM. As such, it is likely to be"
 			" unstable, and any saved game you make might not work in future"
 			" versions of ScummVM."), _("Start anyway"), _("Cancel"));
-		return alert.runModal() == GUI::kMessageOK;
+		int status = alert.runModal();
+
+		if (ttsMan != nullptr)
+			ttsMan->popState();
+
+		return status == GUI::kMessageOK;
 	}
 	return true;
 }
 
 void Engine::errorUnsupportedGame(Common::String extraMsg) {
+	Common::TextToSpeechManager *ttsMan = g_system->getTextToSpeechManager();
+	if (ttsMan != nullptr) {
+		ttsMan->pushState();
+		g_gui.initTextToSpeech();
+	}
+
 	Common::String message = extraMsg.empty() ? _("This game is not supported.") : _("This game is not supported for the following reason:\n\n");
 	message += _(extraMsg);
 	message += "\n\n";
 	GUI::MessageDialog(message).runModal();
+
+	if (ttsMan != nullptr)
+		ttsMan->popState();
 }
 
 uint32 Engine::getTotalPlayTime() const {




More information about the Scummvm-git-logs mailing list