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

OMGPizzaGuy 48367439+OMGPizzaGuy at users.noreply.github.com
Fri Jan 29 02:16:09 UTC 2021


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:
24e18d64a9 ULTIMA8: Add engine option for replacing the game font with ttf rendering
e1658d2b8b ULTIMA8: Add original save/load engine option


Commit: 24e18d64a9b1aee7f3381df033b665593144bcf8
    https://github.com/scummvm/scummvm/commit/24e18d64a9b1aee7f3381df033b665593144bcf8
Author: Matthew Jimenez (matthew.jimenez at outlook.com)
Date: 2021-01-28T20:16:04-06:00

Commit Message:
ULTIMA8: Add engine option for replacing the game font with ttf rendering

Changed paths:
    engines/ultima/detection.cpp
    engines/ultima/detection_tables.h
    engines/ultima/ultima8/games/game_data.cpp
    engines/ultima/ultima8/ultima8.cpp


diff --git a/engines/ultima/detection.cpp b/engines/ultima/detection.cpp
index 419797ded3..77e121b7b3 100644
--- a/engines/ultima/detection.cpp
+++ b/engines/ultima/detection.cpp
@@ -22,7 +22,10 @@
 
 #include "base/plugins.h"
 
+#include "common/translation.h"
+
 #include "ultima/detection.h"
+#include "ultima/detection_tables.h"
 
 namespace Ultima {
 
@@ -45,12 +48,21 @@ static const PlainGameDescriptor ULTIMA_GAMES[] = {
 	{ 0, 0 }
 };
 
-} // End of namespace Ultima
+static const ADExtraGuiOptionsMap optionsList[] = {
+    GAMEOPTION_OVERRIDE_FONTS,
+	{
+        _s("Enable font replacement"),
+        _s("Replaces game fonts with rendered fonts"),
+        "overridefonts",
+        false
+	},
+    AD_EXTRA_GUI_OPTIONS_TERMINATOR
+};
 
-#include "ultima/detection_tables.h"
+} // End of namespace Ultima
 
 UltimaMetaEngineDetection::UltimaMetaEngineDetection() : AdvancedMetaEngineDetection(Ultima::GAME_DESCRIPTIONS,
-	        sizeof(Ultima::UltimaGameDescription), Ultima::ULTIMA_GAMES) {
+	        sizeof(Ultima::UltimaGameDescription), Ultima::ULTIMA_GAMES, Ultima::optionsList) {
 	static const char *const DIRECTORY_GLOBS[2] = { "usecode", 0 };
 	_maxScanDepth = 2;
 	_directoryGlobs = DIRECTORY_GLOBS;
diff --git a/engines/ultima/detection_tables.h b/engines/ultima/detection_tables.h
index 2ad1230b33..00faa7a6a4 100644
--- a/engines/ultima/detection_tables.h
+++ b/engines/ultima/detection_tables.h
@@ -22,6 +22,8 @@
 
 namespace Ultima {
 
+#define GAMEOPTION_OVERRIDE_FONTS GUIO_GAMEOPTIONS1
+
 static const UltimaGameDescription GAME_DESCRIPTIONS[] = {
 #ifndef RELEASE_BUILD
 	{
@@ -248,7 +250,7 @@ static const UltimaGameDescription GAME_DESCRIPTIONS[] = {
 			Common::EN_ANY,
 			Common::kPlatformDOS,
 			ADGF_NO_FLAGS,
-			GUIO1(GUIO_NOMIDI)
+			GUIO2(GUIO_NOMIDI, GAMEOPTION_OVERRIDE_FONTS)
 		},
 		GAME_ULTIMA8,
 		0
@@ -263,7 +265,7 @@ static const UltimaGameDescription GAME_DESCRIPTIONS[] = {
 			Common::EN_ANY,
 			Common::kPlatformDOS,
 			ADGF_NO_FLAGS,
-			GUIO1(GUIO_NOMIDI)
+			GUIO2(GUIO_NOMIDI, GAMEOPTION_OVERRIDE_FONTS)
 		},
 		GAME_ULTIMA8,
 		0
@@ -278,7 +280,7 @@ static const UltimaGameDescription GAME_DESCRIPTIONS[] = {
 			Common::EN_ANY,
 			Common::kPlatformDOS,
 			ADGF_NO_FLAGS,
-			GUIO1(GUIO_NOMIDI)
+			GUIO2(GUIO_NOMIDI, GAMEOPTION_OVERRIDE_FONTS)
 		},
 		GAME_ULTIMA8,
 		0
@@ -292,7 +294,7 @@ static const UltimaGameDescription GAME_DESCRIPTIONS[] = {
 			Common::FR_FRA,
 			Common::kPlatformDOS,
 			ADGF_NO_FLAGS,
-			GUIO1(GUIO_NOMIDI)
+			GUIO2(GUIO_NOMIDI, GAMEOPTION_OVERRIDE_FONTS)
 		},
 		GAME_ULTIMA8,
 		0
@@ -306,7 +308,7 @@ static const UltimaGameDescription GAME_DESCRIPTIONS[] = {
 			Common::DE_DEU,
 			Common::kPlatformDOS,
 			ADGF_NO_FLAGS,
-			GUIO1(GUIO_NOMIDI)
+			GUIO2(GUIO_NOMIDI, GAMEOPTION_OVERRIDE_FONTS)
 		},
 		GAME_ULTIMA8,
 		0
@@ -321,7 +323,7 @@ static const UltimaGameDescription GAME_DESCRIPTIONS[] = {
 			Common::DE_DEU,
 			Common::kPlatformDOS,
 			ADGF_NO_FLAGS,
-			GUIO1(GUIO_NOMIDI)
+			GUIO2(GUIO_NOMIDI, GAMEOPTION_OVERRIDE_FONTS)
 		},
 		GAME_ULTIMA8,
 		0
@@ -335,7 +337,7 @@ static const UltimaGameDescription GAME_DESCRIPTIONS[] = {
 			Common::ES_ESP,
 			Common::kPlatformDOS,
 			ADGF_NO_FLAGS,
-			GUIO1(GUIO_NOMIDI)
+			GUIO2(GUIO_NOMIDI, GAMEOPTION_OVERRIDE_FONTS)
 		},
 		GAME_ULTIMA8,
 		0
@@ -349,7 +351,7 @@ static const UltimaGameDescription GAME_DESCRIPTIONS[] = {
 			Common::JA_JPN,
 			Common::kPlatformDOS,
 			ADGF_NO_FLAGS,
-			GUIO1(GUIO_NOMIDI)
+			GUIO2(GUIO_NOMIDI, GAMEOPTION_OVERRIDE_FONTS)
 		},
 		GAME_ULTIMA8,
 		0
diff --git a/engines/ultima/ultima8/games/game_data.cpp b/engines/ultima/ultima8/games/game_data.cpp
index d72c39fe83..ddd0af37b6 100644
--- a/engines/ultima/ultima8/games/game_data.cpp
+++ b/engines/ultima/ultima8/games/game_data.cpp
@@ -20,6 +20,8 @@
  *
  */
 
+#include "common/config-manager.h"
+
 #include "ultima/ultima8/misc/pent_include.h"
 #include "ultima/ultima8/misc/util.h"
 #include "ultima/ultima8/games/game_data.h"
@@ -373,7 +375,6 @@ void GameData::setupFontOverrides() {
 }
 
 void GameData::setupJPOverrides() {
-	SettingManager *settingman = SettingManager::get_instance();
 	ConfigFileManager *config = ConfigFileManager::get_instance();
 	FontManager *fontmanager = FontManager::get_instance();
 	KeyMap jpkeyvals;
@@ -400,22 +401,19 @@ void GameData::setupJPOverrides() {
 		}
 	}
 
-	bool ttfoverrides = false;
-	settingman->get("ttf", ttfoverrides);
-	if (ttfoverrides)
+	bool overridefonts = ConfMan.getBool("overridefonts");
+	if (overridefonts)
 		setupTTFOverrides("language/fontoverride", true);
 }
 
 void GameData::setupTTFOverrides(const char *configkey, bool SJIS) {
 	ConfigFileManager *config = ConfigFileManager::get_instance();
-	SettingManager *settingman = SettingManager::get_instance();
 	FontManager *fontmanager = FontManager::get_instance();
 	KeyMap ttfkeyvals;
 	KeyMap::const_iterator iter;
 
-	bool ttfoverrides = false;
-	settingman->get("ttf", ttfoverrides);
-	if (!ttfoverrides) return;
+	bool overridefonts = ConfMan.getBool("overridefonts");
+	if (!overridefonts) return;
 
 	ttfkeyvals = config->listKeyValues(configkey);
 	for (iter = ttfkeyvals.begin(); iter != ttfkeyvals.end(); ++iter) {
diff --git a/engines/ultima/ultima8/ultima8.cpp b/engines/ultima/ultima8/ultima8.cpp
index b5e86738ef..04506f3d4c 100644
--- a/engines/ultima/ultima8/ultima8.cpp
+++ b/engines/ultima/ultima8/ultima8.cpp
@@ -329,8 +329,8 @@ bool Ultima8Engine::startupGame() {
 
 	_game = Game::createGame(getGameInfo());
 
-	_settingMan->setDefault("ttf", false);
-	_settingMan->get("ttf", _ttfOverrides);
+	ConfMan.registerDefault("overridefonts", false);
+	_ttfOverrides = ConfMan.getBool("overridefonts");
 
 	_settingMan->setDefault("frameSkip", false);
 	_settingMan->get("frameSkip", _frameSkip);


Commit: e1658d2b8b58b46d6ffccbd9ceb3463b75c5227b
    https://github.com/scummvm/scummvm/commit/e1658d2b8b58b46d6ffccbd9ceb3463b75c5227b
Author: Matthew Jimenez (matthew.jimenez at outlook.com)
Date: 2021-01-28T20:16:04-06:00

Commit Message:
ULTIMA8: Add original save/load engine option

Changed paths:
    engines/ultima/detection.cpp
    engines/ultima/detection_tables.h
    engines/ultima/ultima8/gumps/u8_save_gump.cpp
    engines/ultima/ultima8/ultima8.cpp
    engines/ultima/ultima8/ultima8.h


diff --git a/engines/ultima/detection.cpp b/engines/ultima/detection.cpp
index 77e121b7b3..d3cfa5f860 100644
--- a/engines/ultima/detection.cpp
+++ b/engines/ultima/detection.cpp
@@ -49,12 +49,23 @@ static const PlainGameDescriptor ULTIMA_GAMES[] = {
 };
 
 static const ADExtraGuiOptionsMap optionsList[] = {
-    GAMEOPTION_OVERRIDE_FONTS,
 	{
-        _s("Enable font replacement"),
-        _s("Replaces game fonts with rendered fonts"),
-        "overridefonts",
-        false
+		GAMEOPTION_ORIGINAL_SAVELOAD,
+		{
+			_s("Use original save/load screens"),
+			_s("Use the original save/load screens instead of the ScummVM ones"),
+			"originalsaveload",
+			false
+		}
+	},
+    {
+		GAMEOPTION_OVERRIDE_FONTS,
+		{
+			_s("Enable font replacement"),
+			_s("Replaces game fonts with rendered fonts"),
+			"overridefonts",
+			false
+		}
 	},
     AD_EXTRA_GUI_OPTIONS_TERMINATOR
 };
diff --git a/engines/ultima/detection_tables.h b/engines/ultima/detection_tables.h
index 00faa7a6a4..8f293411d6 100644
--- a/engines/ultima/detection_tables.h
+++ b/engines/ultima/detection_tables.h
@@ -22,7 +22,8 @@
 
 namespace Ultima {
 
-#define GAMEOPTION_OVERRIDE_FONTS GUIO_GAMEOPTIONS1
+#define GAMEOPTION_ORIGINAL_SAVELOAD GUIO_GAMEOPTIONS1
+#define GAMEOPTION_OVERRIDE_FONTS GUIO_GAMEOPTIONS2
 
 static const UltimaGameDescription GAME_DESCRIPTIONS[] = {
 #ifndef RELEASE_BUILD
@@ -250,7 +251,7 @@ static const UltimaGameDescription GAME_DESCRIPTIONS[] = {
 			Common::EN_ANY,
 			Common::kPlatformDOS,
 			ADGF_NO_FLAGS,
-			GUIO2(GUIO_NOMIDI, GAMEOPTION_OVERRIDE_FONTS)
+			GUIO3(GUIO_NOMIDI, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_OVERRIDE_FONTS)
 		},
 		GAME_ULTIMA8,
 		0
@@ -265,7 +266,7 @@ static const UltimaGameDescription GAME_DESCRIPTIONS[] = {
 			Common::EN_ANY,
 			Common::kPlatformDOS,
 			ADGF_NO_FLAGS,
-			GUIO2(GUIO_NOMIDI, GAMEOPTION_OVERRIDE_FONTS)
+			GUIO3(GUIO_NOMIDI, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_OVERRIDE_FONTS)
 		},
 		GAME_ULTIMA8,
 		0
@@ -280,7 +281,7 @@ static const UltimaGameDescription GAME_DESCRIPTIONS[] = {
 			Common::EN_ANY,
 			Common::kPlatformDOS,
 			ADGF_NO_FLAGS,
-			GUIO2(GUIO_NOMIDI, GAMEOPTION_OVERRIDE_FONTS)
+			GUIO3(GUIO_NOMIDI, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_OVERRIDE_FONTS)
 		},
 		GAME_ULTIMA8,
 		0
@@ -294,7 +295,7 @@ static const UltimaGameDescription GAME_DESCRIPTIONS[] = {
 			Common::FR_FRA,
 			Common::kPlatformDOS,
 			ADGF_NO_FLAGS,
-			GUIO2(GUIO_NOMIDI, GAMEOPTION_OVERRIDE_FONTS)
+			GUIO3(GUIO_NOMIDI, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_OVERRIDE_FONTS)
 		},
 		GAME_ULTIMA8,
 		0
@@ -308,7 +309,7 @@ static const UltimaGameDescription GAME_DESCRIPTIONS[] = {
 			Common::DE_DEU,
 			Common::kPlatformDOS,
 			ADGF_NO_FLAGS,
-			GUIO2(GUIO_NOMIDI, GAMEOPTION_OVERRIDE_FONTS)
+			GUIO3(GUIO_NOMIDI, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_OVERRIDE_FONTS)
 		},
 		GAME_ULTIMA8,
 		0
@@ -323,7 +324,7 @@ static const UltimaGameDescription GAME_DESCRIPTIONS[] = {
 			Common::DE_DEU,
 			Common::kPlatformDOS,
 			ADGF_NO_FLAGS,
-			GUIO2(GUIO_NOMIDI, GAMEOPTION_OVERRIDE_FONTS)
+			GUIO3(GUIO_NOMIDI, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_OVERRIDE_FONTS)
 		},
 		GAME_ULTIMA8,
 		0
@@ -337,7 +338,7 @@ static const UltimaGameDescription GAME_DESCRIPTIONS[] = {
 			Common::ES_ESP,
 			Common::kPlatformDOS,
 			ADGF_NO_FLAGS,
-			GUIO2(GUIO_NOMIDI, GAMEOPTION_OVERRIDE_FONTS)
+			GUIO3(GUIO_NOMIDI, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_OVERRIDE_FONTS)
 		},
 		GAME_ULTIMA8,
 		0
@@ -351,7 +352,7 @@ static const UltimaGameDescription GAME_DESCRIPTIONS[] = {
 			Common::JA_JPN,
 			Common::kPlatformDOS,
 			ADGF_NO_FLAGS,
-			GUIO2(GUIO_NOMIDI, GAMEOPTION_OVERRIDE_FONTS)
+			GUIO3(GUIO_NOMIDI, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_OVERRIDE_FONTS)
 		},
 		GAME_ULTIMA8,
 		0
diff --git a/engines/ultima/ultima8/gumps/u8_save_gump.cpp b/engines/ultima/ultima8/gumps/u8_save_gump.cpp
index 195ad54b10..f606b3f553 100644
--- a/engines/ultima/ultima8/gumps/u8_save_gump.cpp
+++ b/engines/ultima/ultima8/gumps/u8_save_gump.cpp
@@ -31,6 +31,7 @@
 #include "ultima/ultima8/gumps/paged_gump.h"
 #include "ultima/ultima8/world/get_object.h"
 #include "ultima/ultima8/world/actors/main_actor.h"
+#include "common/config-manager.h"
 #include "common/savefile.h"
 #include "common/translation.h"
 
@@ -321,6 +322,12 @@ Gump *U8SaveGump::showLoadSaveGump(Gump *parent, bool save) {
 			return nullptr;
 	}
 
+	if (!ConfMan.getBool("originalsaveload")) {
+		// ScummVM save screen
+		Ultima8Engine::get_instance()->scummVMSaveLoadDialog(save);
+		return nullptr;
+	}
+
 	PagedGump *gump = new PagedGump(34, -38, 3, 35);
 	gump->InitGump(parent);
 
diff --git a/engines/ultima/ultima8/ultima8.cpp b/engines/ultima/ultima8/ultima8.cpp
index 04506f3d4c..77c269ad5f 100644
--- a/engines/ultima/ultima8/ultima8.cpp
+++ b/engines/ultima/ultima8/ultima8.cpp
@@ -20,6 +20,8 @@
  *
  */
 
+#include "common/translation.h"
+#include "gui/saveload.h"
 #include "image/png.h"
 
  // TODO: !! a lot of these includes are just for some hacks... clean up sometime
@@ -843,6 +845,37 @@ void Ultima8Engine::writeSaveInfo(Common::WriteStream *ws) {
 	_game->writeSaveInfo(ws);
 }
 
+bool Ultima8Engine::scummVMSaveLoadDialog(bool isSave) {
+	GUI::SaveLoadChooser *dialog;
+	Common::String desc;
+	int slot;
+
+	if (isSave) {
+		dialog = new GUI::SaveLoadChooser(_("Save game:"), _("Save"), true);
+
+		slot = dialog->runModalWithCurrentTarget();
+		desc = dialog->getResultString();
+
+		if (desc.empty()) {
+			desc = dialog->createDefaultSaveDescription(slot);
+		}
+	} else {
+		dialog = new GUI::SaveLoadChooser(_("Load game:"), _("Load"), false);
+		slot = dialog->runModalWithCurrentTarget();
+	}
+
+	delete dialog;
+
+	if (slot < 0)
+		return false;
+
+	if (isSave) {
+		return saveGameState(slot, desc).getCode() == Common::kNoError;
+	} else {
+		return loadGameState(slot).getCode() == Common::kNoError;
+	}
+}
+
 bool Ultima8Engine::canSaveGameStateCurrently(bool isAutosave) {
 	if (_desktopGump->FindGump<ModalGump>() || _avatarInStasis)
 		// Can't save when a modal gump is open, or avatar in statsis  during cutscenes
diff --git a/engines/ultima/ultima8/ultima8.h b/engines/ultima/ultima8/ultima8.h
index 2e79a042e8..10811c2656 100644
--- a/engines/ultima/ultima8/ultima8.h
+++ b/engines/ultima/ultima8/ultima8.h
@@ -278,6 +278,11 @@ public:
 	 */
 	void syncSoundSettings() override;
 
+	/**
+	 * Open the ScummVM save/load screens
+	 */
+	bool scummVMSaveLoadDialog(bool isSave);
+
 	/**
 	 * Returns true if a savegame can be loaded
 	 */




More information about the Scummvm-git-logs mailing list