[Scummvm-git-logs] scummvm master -> 120ee778f2f9852df6b3cb3946d7ed03ad3e60d4

bluegr bluegr at gmail.com
Tue Mar 10 06:00:46 UTC 2020


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

Summary:
29c50bff95 ULTIMA8: Hook the menu Settings option to the ScummVM Options
120ee778f2 TSAGE: Fix crash clicking on Options sound button


Commit: 29c50bff95dc113db6394fa1f355bcd5c6f9ac02
    https://github.com/scummvm/scummvm/commit/29c50bff95dc113db6394fa1f355bcd5c6f9ac02
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2020-03-10T08:00:41+02:00

Commit Message:
ULTIMA8: Hook the menu Settings option to the ScummVM Options

Changed paths:
    engines/dialogs.cpp
    engines/dialogs.h
    engines/ultima/ultima8/gumps/menu_gump.cpp


diff --git a/engines/dialogs.cpp b/engines/dialogs.cpp
index 6e1f670d97..aaf30c8abf 100644
--- a/engines/dialogs.cpp
+++ b/engines/dialogs.cpp
@@ -48,19 +48,6 @@
 #include "gui/KeysDialog.h"
 #endif
 
-class ConfigDialog : public GUI::OptionsDialog {
-protected:
-#ifdef GUI_ENABLE_KEYSDIALOG
-	GUI::Dialog		*_keysDialog;
-#endif
-
-public:
-	ConfigDialog(bool subtitleControls);
-	~ConfigDialog() override;
-
-	void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data) override;
-};
-
 MainMenuDialog::MainMenuDialog(Engine *engine)
 	: GUI::Dialog("GlobalMenu"), _engine(engine) {
 	_backgroundType = GUI::ThemeEngine::kDialogBackgroundSpecial;
@@ -134,7 +121,7 @@ void MainMenuDialog::handleCommand(GUI::CommandSender *sender, uint32 cmd, uint3
 		save();
 		break;
 	case kOptionsCmd: {
-		ConfigDialog configDialog(_engine->hasFeature(Engine::kSupportsSubtitleOptions));
+		GUI::ConfigDialog configDialog(_engine->hasFeature(Engine::kSupportsSubtitleOptions));
 		configDialog.runModal();
 		break;
 	}
@@ -256,6 +243,8 @@ enum {
 	kKeysCmd = 'KEYS'
 };
 
+namespace GUI {
+
 // FIXME: We use the empty string as domain name here. This tells the
 // ConfigManager to use the 'default' domain for all its actions. We do that
 // to get as close as possible to editing the 'active' settings.
@@ -281,9 +270,15 @@ enum {
 // These changes will achieve two things at once: Allow us to get rid of using
 //  "" as value for the domain, and in fact provide a somewhat better user
 // experience at the same time.
-ConfigDialog::ConfigDialog(bool subtitleControls)
-	: GUI::OptionsDialog("", "GlobalConfig") {
+ConfigDialog::ConfigDialog(bool subtitleControls) : GUI::OptionsDialog("", "GlobalConfig") {
+	init(subtitleControls);
+}
 
+ConfigDialog::ConfigDialog() : GUI::OptionsDialog("", "GlobalConfig") {
+	init(g_engine->hasFeature(Engine::kSupportsSubtitleOptions));
+}
+
+void ConfigDialog::init(bool subtitleControls) {
 	// GUI:  Add tab widget
 	GUI::TabWidget *tab = new GUI::TabWidget(this, "GlobalConfig.TabWidget");
 
@@ -362,3 +357,5 @@ void ConfigDialog::handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32
 		GUI::OptionsDialog::handleCommand (sender, cmd, data);
 	}
 }
+
+} // End of namespace GUI
diff --git a/engines/dialogs.h b/engines/dialogs.h
index 941b255591..cfe3349f28 100644
--- a/engines/dialogs.h
+++ b/engines/dialogs.h
@@ -24,6 +24,7 @@
 #define GLOBAL_DIALOGS_H
 
 #include "gui/dialog.h"
+#include "gui/options.h"
 
 class Engine;
 
@@ -76,4 +77,24 @@ protected:
 	GUI::SaveLoadChooser *_saveDialog;
 };
 
+namespace GUI {
+
+class ConfigDialog : public OptionsDialog {
+private:
+	void init(bool subtitleControls);
+protected:
+#ifdef GUI_ENABLE_KEYSDIALOG
+	Dialog *_keysDialog;
+#endif
+
+public:
+	ConfigDialog(bool subtitleControls);
+	ConfigDialog();
+	~ConfigDialog() override;
+
+	void handleCommand(CommandSender *sender, uint32 cmd, uint32 data) override;
+};
+
+} // End of namespace GUI
+
 #endif
diff --git a/engines/ultima/ultima8/gumps/menu_gump.cpp b/engines/ultima/ultima8/gumps/menu_gump.cpp
index 68a88de4b0..7c3a009af1 100644
--- a/engines/ultima/ultima8/gumps/menu_gump.cpp
+++ b/engines/ultima/ultima8/gumps/menu_gump.cpp
@@ -46,6 +46,7 @@
 #include "ultima/ultima8/filesys/idata_source.h"
 #include "ultima/ultima8/filesys/odata_source.h"
 #include "ultima/ultima8/meta_engine.h"
+#include "engines/dialogs.h"
 
 namespace Ultima {
 namespace Ultima8 {
@@ -229,8 +230,9 @@ void MenuGump::selectEntry(int entry) {
 		U8SaveGump::showLoadSaveGump(this, entry == 3);
 		break;
 	case 4: {
-		// Options
-		// TODO: Show options
+		// Options - show the ScummVM options dialog
+		GUI::ConfigDialog dlg;
+		dlg.runModal();
 	}
 	break;
 	case 5: // Credits


Commit: 120ee778f2f9852df6b3cb3946d7ed03ad3e60d4
    https://github.com/scummvm/scummvm/commit/120ee778f2f9852df6b3cb3946d7ed03ad3e60d4
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2020-03-10T08:00:41+02:00

Commit Message:
TSAGE: Fix crash clicking on Options sound button

Changed paths:
    engines/tsage/dialogs.cpp


diff --git a/engines/tsage/dialogs.cpp b/engines/tsage/dialogs.cpp
index 3704ce1f04..cb2bf65190 100644
--- a/engines/tsage/dialogs.cpp
+++ b/engines/tsage/dialogs.cpp
@@ -21,11 +21,7 @@
  */
 
 #include "common/translation.h"
-
-#include "gui/dialog.h"
-#include "gui/options.h"
-#include "gui/widget.h"
-
+#include "engines/dialogs.h"
 #include "tsage/tsage.h"
 #include "tsage/core.h"
 #include "tsage/dialogs.h"
@@ -92,29 +88,6 @@ int MessageDialog::show2(const Common::String &message, const Common::String &bt
 
 /*--------------------------------------------------------------------------*/
 
-class ConfigDialog : public GUI::OptionsDialog {
-public:
-	ConfigDialog();
-};
-
-ConfigDialog::ConfigDialog() : GUI::OptionsDialog("", "GlobalConfig") {
-	//
-	// Sound controllers
-	//
-
-	addVolumeControls(this, "GlobalConfig.");
-	setVolumeSettingsState(true); // could disable controls by GUI options
-
-	//
-	// Add the buttons
-	//
-
-	new GUI::ButtonWidget(this, "GlobalConfig.Ok", _("~O~K"), 0, GUI::kOKCmd);
-	new GUI::ButtonWidget(this, "GlobalConfig.Cancel", _("~C~ancel"), 0, GUI::kCloseCmd);
-}
-
-/*--------------------------------------------------------------------------*/
-
 void ModalDialog::draw() {
 	// Set the palette for use in the dialog
 	setPalette();
@@ -192,7 +165,7 @@ void ModalDialog::drawFrame() {
 /*--------------------------------------------------------------------------*/
 
 void SoundDialog::execute() {
-	ConfigDialog *dlg = new ConfigDialog();
+	GUI::ConfigDialog *dlg = new GUI::ConfigDialog();
 	dlg->runModal();
 	delete dlg;
 	g_globals->_soundManager.syncSounds();




More information about the Scummvm-git-logs mailing list