[Scummvm-git-logs] scummvm master -> 2685673d4838fc036ee8da6d1f0044e816774ce3

rvanlaar noreply at scummvm.org
Wed Mar 16 08:23:27 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:
2685673d48 DIRECTOR: show modal when exitLock is set


Commit: 2685673d4838fc036ee8da6d1f0044e816774ce3
    https://github.com/scummvm/scummvm/commit/2685673d4838fc036ee8da6d1f0044e816774ce3
Author: Roland van Laar (roland at rolandvanlaar.nl)
Date: 2022-03-16T09:23:13+01:00

Commit Message:
DIRECTOR: show modal when exitLock is set

Implement conditions for the modal to show:
- reset the QUIT event to prevent the modal from closing immediately
- only show the modal when exitLock is set by the program

Changed paths:
    engines/director/events.cpp


diff --git a/engines/director/events.cpp b/engines/director/events.cpp
index cc3d8a278ed..2cd0b52057f 100644
--- a/engines/director/events.cpp
+++ b/engines/director/events.cpp
@@ -84,10 +84,16 @@ bool DirectorEngine::processEvents(bool captureClick) {
 }
 
 void DirectorEngine::processEventQUIT() {
-	Common::U32String message = _("The game wants to prevents you from quitting. Do you want to quit?");
-	GUI::MessageDialog dialog(message, _("OK"), _("Cancel"));
-	int result = dialog.runModal();
-	if (result == GUI::kMessageOK) {
+	if (g_lingo->_exitLock) {
+		Common::U32String message = _("The game wants to prevents you from quitting. Do you want to quit?");
+		GUI::MessageDialog dialog(message, _("OK"), _("Cancel"));
+
+		g_system->getEventManager()->resetQuit(); // Clear the quit event
+
+		int result = dialog.runModal();
+		if (result == GUI::kMessageOK)
+			_stage->getCurrentMovie()->getScore()->_playState = kPlayStopped;
+	} else {
 		_stage->getCurrentMovie()->getScore()->_playState = kPlayStopped;
 	}
 }




More information about the Scummvm-git-logs mailing list