[Scummvm-git-logs] scummvm master -> 7a10e3ea307004dd99f044205a4386341f5fb24a

sev- noreply at scummvm.org
Fri Jan 20 09:03:44 UTC 2023


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

Summary:
90c0c805d4 ENGINES: Add feature flag for quit dialog override
aae1cac682 GUI: Only show the quit dialog in absence of an engine GUI override
e8dfcb42f6 SCUMM: GUI: Implement ScummVM quit confirmation override
7a10e3ea30 SCUMM: Update Original GUI checkbox description


Commit: 90c0c805d4c73897474b75e02427b47a089d00f0
    https://github.com/scummvm/scummvm/commit/90c0c805d4c73897474b75e02427b47a089d00f0
Author: AndywinXp (andywinxp at gmail.com)
Date: 2023-01-20T10:03:37+01:00

Commit Message:
ENGINES: Add feature flag for quit dialog override

This signals the outside world that the engine has implemented its own GUI
and quit confirmation prompts, so that ScummVM won't show the general
ones on top of those.

Changed paths:
    engines/engine.h


diff --git a/engines/engine.h b/engines/engine.h
index f3adff10e4e..0caa0375059 100644
--- a/engines/engine.h
+++ b/engines/engine.h
@@ -300,7 +300,12 @@ public:
 		 *
 		 * This enables the help button in the main menu.
 		 */
-		 kSupportsHelp
+		 kSupportsHelp,
+
+		/**
+		 * The engine provides overrides to the quit and exit to launcher dialogs.
+		 */
+		kSupportsQuitDialogOverride,
 	};
 
 


Commit: aae1cac682e783cea72b6c362ea17b5da5bb0da9
    https://github.com/scummvm/scummvm/commit/aae1cac682e783cea72b6c362ea17b5da5bb0da9
Author: AndywinXp (andywinxp at gmail.com)
Date: 2023-01-20T10:03:37+01:00

Commit Message:
GUI: Only show the quit dialog in absence of an engine GUI override

Changed paths:
    backends/events/default/default-events.cpp


diff --git a/backends/events/default/default-events.cpp b/backends/events/default/default-events.cpp
index f23a54bb53e..4a02bb270c2 100644
--- a/backends/events/default/default-events.cpp
+++ b/backends/events/default/default-events.cpp
@@ -180,7 +180,7 @@ bool DefaultEventManager::pollEvent(Common::Event &event) {
 		break;
 
 	case Common::EVENT_RETURN_TO_LAUNCHER:
-		if (ConfMan.getBool("confirm_exit")) {
+		if (g_engine && !g_engine->hasFeature(Engine::kSupportsQuitDialogOverride) && ConfMan.getBool("confirm_exit")) {
 			if (_confirmExitDialogActive) {
 				forwardEvent = false;
 				break;
@@ -204,7 +204,7 @@ bool DefaultEventManager::pollEvent(Common::Event &event) {
 		break;
 
 	case Common::EVENT_QUIT:
-		if (g_engine && ConfMan.getBool("confirm_exit")) {
+		if (g_engine && !g_engine->hasFeature(Engine::kSupportsQuitDialogOverride) && ConfMan.getBool("confirm_exit")) {
 			if (_confirmExitDialogActive) {
 				forwardEvent = false;
 				break;


Commit: e8dfcb42f60bd8d1649be8a1e7b2e4d1ed3f04db
    https://github.com/scummvm/scummvm/commit/e8dfcb42f60bd8d1649be8a1e7b2e4d1ed3f04db
Author: AndywinXp (andywinxp at gmail.com)
Date: 2023-01-20T10:03:37+01:00

Commit Message:
SCUMM: GUI: Implement ScummVM quit confirmation override

Now, the original GUI will ask you for confirmation only if the "confirm_exit" config
flag is active.

Changed paths:
    engines/scumm/gfx_gui.cpp
    engines/scumm/metaengine.cpp


diff --git a/engines/scumm/gfx_gui.cpp b/engines/scumm/gfx_gui.cpp
index d2be33059e9..4e20d034f08 100644
--- a/engines/scumm/gfx_gui.cpp
+++ b/engines/scumm/gfx_gui.cpp
@@ -813,7 +813,9 @@ int ScummEngine::getInternalGUIControlFromCoordinates(int x, int y) {
 #ifdef ENABLE_SCUMM_7_8
 void ScummEngine_v7::queryQuit(bool returnToLauncher) {
 	if (isUsingOriginalGUI()) {
-		if (_game.version == 8 && !(_game.features & GF_DEMO)) {
+		if (_game.version == 8 && !(_game.features & GF_DEMO) &&
+			(ConfMan.hasKey("confirm_exit") && ConfMan.getBool("confirm_exit"))) {
+
 			int boxWidth, strWidth;
 			int ctrlId;
 			char yesLabelPtr[512];
@@ -1507,20 +1509,24 @@ void ScummEngine::queryQuit(bool returnToLauncher) {
 		localizedYesKey = msgLabelPtr[Common::strnlen(msgLabelPtr, sizeof(msgLabelPtr)) - 1];
 		msgLabelPtr[Common::strnlen(msgLabelPtr, sizeof(msgLabelPtr)) - 1] = '\0';
 
-		_system->setFeatureState(OSystem::kFeatureVirtualKeyboard, true);
-
 		// "Are you sure you want to quit?  (Y/N)"
 		Common::KeyState ks;
-		if (_game.version > 4) {
-			ks = showBannerAndPause(0, -1, msgLabelPtr);
-		} else if (_game.version < 3) {
-			ks = printMessageAndPause(msgLabelPtr, 0, -1, true);
+		if (ConfMan.hasKey("confirm_exit") && ConfMan.getBool("confirm_exit")) {
+			_system->setFeatureState(OSystem::kFeatureVirtualKeyboard, true);
+
+			if (_game.version > 4) {
+				ks = showBannerAndPause(0, -1, msgLabelPtr);
+			} else if (_game.version < 3) {
+				ks = printMessageAndPause(msgLabelPtr, 0, -1, true);
+			} else {
+				ks = showOldStyleBannerAndPause(msgLabelPtr, 12, -1);
+			}
+
+			_system->setFeatureState(OSystem::kFeatureVirtualKeyboard, false);
 		} else {
-			ks = showOldStyleBannerAndPause(msgLabelPtr, 12, -1);
+			ks = Common::KeyCode(localizedYesKey);
 		}
 
-		_system->setFeatureState(OSystem::kFeatureVirtualKeyboard, false);
-
 		if (tolower(localizedYesKey) == ks.ascii || toupper(localizedYesKey) == ks.ascii ||
 			(ks.keycode == Common::KEYCODE_c && ks.hasFlags(Common::KBD_CTRL)) ||
 			(ks.keycode == Common::KEYCODE_x && ks.hasFlags(Common::KBD_ALT))) {
diff --git a/engines/scumm/metaengine.cpp b/engines/scumm/metaengine.cpp
index f688f7e515e..72fd88469a9 100644
--- a/engines/scumm/metaengine.cpp
+++ b/engines/scumm/metaengine.cpp
@@ -241,7 +241,8 @@ bool ScummEngine::hasFeature(EngineFeature f) const {
 		(
 			f == kSupportsChangingOptionsDuringRuntime &&
 			Common::String(_game.guioptions).contains(GUIO_AUDIO_OVERRIDE)
-		);
+		) ||
+		(f == kSupportsQuitDialogOverride && _useOriginalGUI);
 }
 
 


Commit: 7a10e3ea307004dd99f044205a4386341f5fb24a
    https://github.com/scummvm/scummvm/commit/7a10e3ea307004dd99f044205a4386341f5fb24a
Author: AndywinXp (andywinxp at gmail.com)
Date: 2023-01-20T10:03:37+01:00

Commit Message:
SCUMM: Update Original GUI checkbox description

This notifies the user that in order to get the quit confirmation
dialogs, the "Ask for confirmation on exit" toggle has to be active.

Changed paths:
    engines/scumm/dialogs.cpp
    engines/scumm/metaengine.cpp


diff --git a/engines/scumm/dialogs.cpp b/engines/scumm/dialogs.cpp
index f356ec6ffda..551cd13daee 100644
--- a/engines/scumm/dialogs.cpp
+++ b/engines/scumm/dialogs.cpp
@@ -1048,7 +1048,10 @@ GUI::CheckboxWidget *ScummOptionsContainerWidget::createEnhancementsCheckbox(Gui
 }
 
 GUI::CheckboxWidget *ScummOptionsContainerWidget::createOriginalGUICheckbox(GuiObject *boss, const Common::String &name) {
-	return new GUI::CheckboxWidget(boss, name, _("Enable the original GUI and Menu"), _("Allow the game to use the in-engine graphical interface and the original save/load menu."));
+	return new GUI::CheckboxWidget(boss, name,
+		_("Enable the original GUI and Menu"),
+		_("Allow the game to use the in-engine graphical interface and the original save/load menu. Use it together with the \"Ask for confirmation on exit\" for a more complete experience.")
+	);
 }
 
 void ScummOptionsContainerWidget::updateAdjustmentSlider(GUI::SliderWidget *slider, GUI::StaticTextWidget *value) {
diff --git a/engines/scumm/metaengine.cpp b/engines/scumm/metaengine.cpp
index 72fd88469a9..45b7fdc8c5b 100644
--- a/engines/scumm/metaengine.cpp
+++ b/engines/scumm/metaengine.cpp
@@ -664,7 +664,8 @@ static const ExtraGuiOption audioOverride {
 
 static const ExtraGuiOption enableOriginalGUI = {
 	_s("Enable the original GUI and Menu"),
-	_s("Allow the game to use the in-engine graphical interface and the original save/load menu."),
+	_s("Allow the game to use the in-engine graphical interface and the original save/load menu. \
+		Use it together with the \"Ask for confirmation on exit\" for a more complete experience."),
 	"original_gui",
 	true,
 	0,




More information about the Scummvm-git-logs mailing list