ENGINES: Change MetaEngine::findGame to return a plain game descriptor
This commit is contained in:
parent
cf1ebf2951
commit
8fb149e3c7
22 changed files with 77 additions and 70 deletions
|
@ -714,10 +714,10 @@ static void listTargets() {
|
|||
// FIXME: At this point, we should check for a "gameid" override
|
||||
// to find the proper desc. In fact, the platform probably should
|
||||
// be taken into account, too.
|
||||
Common::String gameid(name);
|
||||
GameDescriptor g = EngineMan.findGame(gameid);
|
||||
if (g.description().size() > 0)
|
||||
description = g.description();
|
||||
const Common::String &gameid = name;
|
||||
PlainGameDescriptor g = EngineMan.findGame(gameid);
|
||||
if (g.description)
|
||||
description = g.description;
|
||||
}
|
||||
|
||||
targets.push_back(Common::String::format("%-20s %s", name.c_str(), description.c_str()));
|
||||
|
@ -770,7 +770,7 @@ static Common::Error listSaves(const Common::String &target) {
|
|||
|
||||
// Find the plugin that will handle the specified gameid
|
||||
const Plugin *plugin = nullptr;
|
||||
GameDescriptor game = EngineMan.findGame(gameid, &plugin);
|
||||
EngineMan.findGame(gameid, &plugin);
|
||||
|
||||
if (!plugin) {
|
||||
// If the target was specified, treat this as an error, and otherwise skip it.
|
||||
|
@ -1276,8 +1276,8 @@ bool processSettings(Common::String &command, Common::StringMap &settings, Commo
|
|||
// domain (i.e. a target) matching this argument, or alternatively
|
||||
// whether there is a gameid matching that name.
|
||||
if (!command.empty()) {
|
||||
GameDescriptor gd = EngineMan.findGame(command);
|
||||
if (ConfMan.hasGameDomain(command) || !gd.gameid().empty()) {
|
||||
PlainGameDescriptor gd = EngineMan.findGame(command);
|
||||
if (ConfMan.hasGameDomain(command) || gd.gameId) {
|
||||
bool idCameFromCommandLine = false;
|
||||
|
||||
// WORKAROUND: Fix for bug #1719463: "DETECTOR: Launching
|
||||
|
|
|
@ -128,13 +128,13 @@ static const Plugin *detectPlugin() {
|
|||
printf("User picked target '%s' (gameid '%s')...\n", ConfMan.getActiveDomainName().c_str(), gameid.c_str());
|
||||
printf(" Looking for a plugin supporting this gameid... ");
|
||||
|
||||
GameDescriptor game = EngineMan.findGame(gameid, &plugin);
|
||||
PlainGameDescriptor game = EngineMan.findGame(gameid, &plugin);
|
||||
|
||||
if (plugin == 0) {
|
||||
printf("failed\n");
|
||||
warning("%s is an invalid gameid. Use the --list-games option to list supported gameid", gameid.c_str());
|
||||
} else {
|
||||
printf("%s\n Starting '%s'\n", plugin->getName(), game.description().c_str());
|
||||
printf("%s\n Starting '%s'\n", plugin->getName(), game.description);
|
||||
}
|
||||
|
||||
return plugin;
|
||||
|
@ -210,7 +210,10 @@ static Common::Error runGame(const Plugin *plugin, OSystem &system, const Common
|
|||
Common::String caption(ConfMan.get("description"));
|
||||
|
||||
if (caption.empty()) {
|
||||
caption = EngineMan.findGame(ConfMan.get("gameid")).description();
|
||||
PlainGameDescriptor game = EngineMan.findGame(ConfMan.get("gameid"));
|
||||
if (game.description) {
|
||||
caption = game.description;
|
||||
}
|
||||
}
|
||||
if (caption.empty())
|
||||
caption = ConfMan.getActiveDomainName(); // Use the domain (=target) name
|
||||
|
|
|
@ -458,13 +458,13 @@ DECLARE_SINGLETON(EngineManager);
|
|||
* For the uncached version, we first try to find the plugin using the gameId
|
||||
* and only if we can't find it there, we loop through the plugins.
|
||||
**/
|
||||
GameDescriptor EngineManager::findGame(const Common::String &gameName, const Plugin **plugin) const {
|
||||
GameDescriptor result;
|
||||
PlainGameDescriptor EngineManager::findGame(const Common::String &gameName, const Plugin **plugin) const {
|
||||
PlainGameDescriptor result;
|
||||
|
||||
// First look for the game using the plugins in memory. This is critical
|
||||
// for calls coming from inside games
|
||||
result = findGameInLoadedPlugins(gameName, plugin);
|
||||
if (!result.gameid().empty()) {
|
||||
if (result.gameId) {
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -472,7 +472,7 @@ GameDescriptor EngineManager::findGame(const Common::String &gameName, const Plu
|
|||
// by plugin
|
||||
if (PluginMan.loadPluginFromGameId(gameName)) {
|
||||
result = findGameInLoadedPlugins(gameName, plugin);
|
||||
if (!result.gameid().empty()) {
|
||||
if (result.gameId) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
@ -481,7 +481,7 @@ GameDescriptor EngineManager::findGame(const Common::String &gameName, const Plu
|
|||
PluginMan.loadFirstPlugin();
|
||||
do {
|
||||
result = findGameInLoadedPlugins(gameName, plugin);
|
||||
if (!result.gameid().empty()) {
|
||||
if (result.gameId) {
|
||||
// Update with new plugin file name
|
||||
PluginMan.updateConfigWithFileName(gameName);
|
||||
break;
|
||||
|
@ -494,10 +494,10 @@ GameDescriptor EngineManager::findGame(const Common::String &gameName, const Plu
|
|||
/**
|
||||
* Find the game within the plugins loaded in memory
|
||||
**/
|
||||
GameDescriptor EngineManager::findGameInLoadedPlugins(const Common::String &gameName, const Plugin **plugin) const {
|
||||
PlainGameDescriptor EngineManager::findGameInLoadedPlugins(const Common::String &gameName, const Plugin **plugin) const {
|
||||
// Find the GameDescriptor for this target
|
||||
const PluginList &plugins = getPlugins();
|
||||
GameDescriptor result;
|
||||
PlainGameDescriptor result;
|
||||
|
||||
if (plugin)
|
||||
*plugin = 0;
|
||||
|
@ -506,7 +506,7 @@ GameDescriptor EngineManager::findGameInLoadedPlugins(const Common::String &game
|
|||
|
||||
for (iter = plugins.begin(); iter != plugins.end(); ++iter) {
|
||||
result = (*iter)->get<MetaEngine>().findGame(gameName.c_str());
|
||||
if (!result.gameid().empty()) {
|
||||
if (result.gameId) {
|
||||
if (plugin)
|
||||
*plugin = *iter;
|
||||
return result;
|
||||
|
|
|
@ -602,14 +602,14 @@ GameList AdvancedMetaEngine::getSupportedGames() const {
|
|||
return GameList(_gameIds);
|
||||
}
|
||||
|
||||
GameDescriptor AdvancedMetaEngine::findGame(const char *gameId) const {
|
||||
PlainGameDescriptor AdvancedMetaEngine::findGame(const char *gameId) const {
|
||||
// First search the list of supported gameids for a match.
|
||||
const PlainGameDescriptor *g = findPlainGameDescriptor(gameId, _gameIds);
|
||||
if (g)
|
||||
return GameDescriptor(*g);
|
||||
return *g;
|
||||
|
||||
// No match found
|
||||
return GameDescriptor();
|
||||
return PlainGameDescriptor();
|
||||
}
|
||||
|
||||
AdvancedMetaEngine::AdvancedMetaEngine(const void *descs, uint descItemSize, const PlainGameDescriptor *gameIds, const ADExtraGuiOptionsMap *extraGuiOptions)
|
||||
|
|
|
@ -267,7 +267,7 @@ public:
|
|||
*/
|
||||
virtual GameList getSupportedGames() const;
|
||||
|
||||
virtual GameDescriptor findGame(const char *gameId) const;
|
||||
PlainGameDescriptor findGame(const char *gameId) const override;
|
||||
|
||||
DetectedGames detectGames(const Common::FSList &fslist) const override;
|
||||
|
||||
|
|
|
@ -99,7 +99,7 @@ public:
|
|||
_directoryGlobs = directoryGlobs;
|
||||
}
|
||||
|
||||
virtual GameDescriptor findGame(const char *gameId) const {
|
||||
PlainGameDescriptor findGame(const char *gameId) const override {
|
||||
return Engines::findGameID(gameId, _gameIds, obsoleteGameIDsTable);
|
||||
}
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@ public:
|
|||
_guiOptions = GUIO2(GUIO_NOSPEECH, GAMEOPTION_ORIGINAL_SAVELOAD);
|
||||
}
|
||||
|
||||
virtual GameDescriptor findGame(const char *gameId) const {
|
||||
PlainGameDescriptor findGame(const char *gameId) const override {
|
||||
return Engines::findGameID(gameId, _gameIds, obsoleteGameIDsTable);
|
||||
}
|
||||
|
||||
|
|
|
@ -38,6 +38,9 @@
|
|||
struct PlainGameDescriptor {
|
||||
const char *gameId;
|
||||
const char *description;
|
||||
|
||||
PlainGameDescriptor() : gameId(nullptr), description(nullptr) {}
|
||||
PlainGameDescriptor(const char *id, const char *desc) : gameId(id), description(desc) {}
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -66,7 +69,7 @@ enum GameSupportLevel {
|
|||
class GameDescriptor : public Common::StringMap {
|
||||
public:
|
||||
GameDescriptor();
|
||||
GameDescriptor(const PlainGameDescriptor &pgd, Common::String guioptions = Common::String());
|
||||
explicit GameDescriptor(const PlainGameDescriptor &pgd, Common::String guioptions = Common::String());
|
||||
GameDescriptor(const Common::String &gameid,
|
||||
const Common::String &description,
|
||||
Common::Language language = Common::UNK_LANG,
|
||||
|
|
|
@ -33,7 +33,7 @@ class GobMetaEngine : public AdvancedMetaEngine {
|
|||
public:
|
||||
GobMetaEngine();
|
||||
|
||||
virtual GameDescriptor findGame(const char *gameId) const;
|
||||
PlainGameDescriptor findGame(const char *gameId) const override;
|
||||
|
||||
ADDetectedGame fallbackDetect(const FileMap &allFiles, const Common::FSList &fslist) const override;
|
||||
|
||||
|
@ -59,7 +59,7 @@ GobMetaEngine::GobMetaEngine() :
|
|||
_guiOptions = GUIO1(GUIO_NOLAUNCHLOAD);
|
||||
}
|
||||
|
||||
GameDescriptor GobMetaEngine::findGame(const char *gameId) const {
|
||||
PlainGameDescriptor GobMetaEngine::findGame(const char *gameId) const {
|
||||
return Engines::findGameID(gameId, _gameIds, obsoleteGameIDsTable);
|
||||
}
|
||||
|
||||
|
|
|
@ -71,8 +71,8 @@ public:
|
|||
/** Returns a list of games supported by this engine. */
|
||||
virtual GameList getSupportedGames() const = 0;
|
||||
|
||||
/** Query the engine for a GameDescriptor for the specified gameid, if any. */
|
||||
virtual GameDescriptor findGame(const char *gameid) const = 0;
|
||||
/** Query the engine for a PlainGameDescriptor for the specified gameid, if any. */
|
||||
virtual PlainGameDescriptor findGame(const char *gameId) const = 0;
|
||||
|
||||
/**
|
||||
* Runs the engine's game detector on the given list of files, and returns a
|
||||
|
@ -267,8 +267,8 @@ public:
|
|||
*/
|
||||
class EngineManager : public Common::Singleton<EngineManager> {
|
||||
public:
|
||||
GameDescriptor findGameInLoadedPlugins(const Common::String &gameName, const Plugin **plugin = NULL) const;
|
||||
GameDescriptor findGame(const Common::String &gameName, const Plugin **plugin = NULL) const;
|
||||
PlainGameDescriptor findGameInLoadedPlugins(const Common::String &gameName, const Plugin **plugin = NULL) const;
|
||||
PlainGameDescriptor findGame(const Common::String &gameName, const Plugin **plugin = NULL) const;
|
||||
DetectionResults detectGames(const Common::FSList &fslist) const;
|
||||
const PluginList &getPlugins() const;
|
||||
};
|
||||
|
|
|
@ -55,7 +55,7 @@ void upgradeTargetIfNecessary(const ObsoleteGameID *obsoleteList) {
|
|||
}
|
||||
}
|
||||
|
||||
GameDescriptor findGameID(
|
||||
PlainGameDescriptor findGameID(
|
||||
const char *gameid,
|
||||
const PlainGameDescriptor *gameids,
|
||||
const ObsoleteGameID *obsoleteList
|
||||
|
@ -63,7 +63,7 @@ GameDescriptor findGameID(
|
|||
// First search the list of supported gameids for a match.
|
||||
const PlainGameDescriptor *g = findPlainGameDescriptor(gameid, gameids);
|
||||
if (g)
|
||||
return GameDescriptor(*g);
|
||||
return *g;
|
||||
|
||||
// If we didn't find the gameid in the main list, check if it
|
||||
// is an obsolete game id.
|
||||
|
@ -73,16 +73,16 @@ GameDescriptor findGameID(
|
|||
if (0 == scumm_stricmp(gameid, o->from)) {
|
||||
g = findPlainGameDescriptor(o->to, gameids);
|
||||
if (g && g->description)
|
||||
return GameDescriptor(gameid, "Obsolete game ID (" + Common::String(g->description) + ")");
|
||||
return PlainGameDescriptor(gameid, g->description);
|
||||
else
|
||||
return GameDescriptor(gameid, "Obsolete game ID");
|
||||
return PlainGameDescriptor(gameid, "Obsolete game ID");
|
||||
}
|
||||
o++;
|
||||
}
|
||||
}
|
||||
|
||||
// No match found
|
||||
return GameDescriptor();
|
||||
return PlainGameDescriptor();
|
||||
}
|
||||
|
||||
} // End of namespace Engines
|
||||
|
|
|
@ -66,7 +66,7 @@ void upgradeTargetIfNecessary(const ObsoleteGameID *obsoleteList);
|
|||
* Optionally can take a list of obsolete game ids into account in order
|
||||
* to support obsolete gameids.
|
||||
*/
|
||||
GameDescriptor findGameID(
|
||||
PlainGameDescriptor findGameID(
|
||||
const char *gameid,
|
||||
const PlainGameDescriptor *gameids,
|
||||
const ObsoleteGameID *obsoleteList = 0
|
||||
|
|
|
@ -105,7 +105,7 @@ public:
|
|||
_singleId = "saga";
|
||||
}
|
||||
|
||||
virtual GameDescriptor findGame(const char *gameId) const {
|
||||
PlainGameDescriptor findGame(const char *gameId) const override {
|
||||
return Engines::findGameID(gameId, _gameIds, obsoleteGameIDsTable);
|
||||
}
|
||||
|
||||
|
|
|
@ -960,7 +960,7 @@ public:
|
|||
|
||||
virtual bool hasFeature(MetaEngineFeature f) const;
|
||||
virtual GameList getSupportedGames() const;
|
||||
virtual GameDescriptor findGame(const char *gameid) const;
|
||||
PlainGameDescriptor findGame(const char *gameid) const override;
|
||||
virtual DetectedGames detectGames(const Common::FSList &fslist) const override;
|
||||
|
||||
virtual Common::Error createInstance(OSystem *syst, Engine **engine) const;
|
||||
|
@ -996,7 +996,7 @@ GameList ScummMetaEngine::getSupportedGames() const {
|
|||
return GameList(gameDescriptions);
|
||||
}
|
||||
|
||||
GameDescriptor ScummMetaEngine::findGame(const char *gameid) const {
|
||||
PlainGameDescriptor ScummMetaEngine::findGame(const char *gameid) const {
|
||||
return Engines::findGameID(gameid, gameDescriptions, obsoleteGameIDsTable);
|
||||
}
|
||||
|
||||
|
|
|
@ -78,7 +78,7 @@ public:
|
|||
virtual bool hasFeature(MetaEngineFeature f) const;
|
||||
virtual GameList getSupportedGames() const;
|
||||
virtual const ExtraGuiOptions getExtraGuiOptions(const Common::String &target) const;
|
||||
virtual GameDescriptor findGame(const char *gameid) const;
|
||||
PlainGameDescriptor findGame(const char *gameid) const override;
|
||||
DetectedGames detectGames(const Common::FSList &fslist) const override;
|
||||
|
||||
virtual Common::Error createInstance(OSystem *syst, Engine **engine) const;
|
||||
|
@ -112,7 +112,7 @@ bool Sky::SkyEngine::hasFeature(EngineFeature f) const {
|
|||
|
||||
GameList SkyMetaEngine::getSupportedGames() const {
|
||||
GameList games;
|
||||
games.push_back(skySetting);
|
||||
games.push_back(GameDescriptor(skySetting));
|
||||
return games;
|
||||
}
|
||||
|
||||
|
@ -135,10 +135,10 @@ const ExtraGuiOptions SkyMetaEngine::getExtraGuiOptions(const Common::String &ta
|
|||
return options;
|
||||
}
|
||||
|
||||
GameDescriptor SkyMetaEngine::findGame(const char *gameid) const {
|
||||
PlainGameDescriptor SkyMetaEngine::findGame(const char *gameid) const {
|
||||
if (0 == scumm_stricmp(gameid, skySetting.gameId))
|
||||
return skySetting;
|
||||
return GameDescriptor();
|
||||
return PlainGameDescriptor();
|
||||
}
|
||||
|
||||
DetectedGames SkyMetaEngine::detectGames(const Common::FSList &fslist) const {
|
||||
|
|
|
@ -88,7 +88,7 @@ public:
|
|||
|
||||
virtual bool hasFeature(MetaEngineFeature f) const;
|
||||
virtual GameList getSupportedGames() const;
|
||||
virtual GameDescriptor findGame(const char *gameid) const;
|
||||
PlainGameDescriptor findGame(const char *gameId) const override;
|
||||
DetectedGames detectGames(const Common::FSList &fslist) const override;
|
||||
virtual SaveStateList listSaves(const char *target) const;
|
||||
virtual int getMaximumSaveSlot() const;
|
||||
|
@ -127,20 +127,20 @@ GameList SwordMetaEngine::getSupportedGames() const {
|
|||
return games;
|
||||
}
|
||||
|
||||
GameDescriptor SwordMetaEngine::findGame(const char *gameid) const {
|
||||
if (0 == scumm_stricmp(gameid, sword1FullSettings.gameId))
|
||||
PlainGameDescriptor SwordMetaEngine::findGame(const char *gameId) const {
|
||||
if (0 == scumm_stricmp(gameId, sword1FullSettings.gameId))
|
||||
return sword1FullSettings;
|
||||
if (0 == scumm_stricmp(gameid, sword1DemoSettings.gameId))
|
||||
if (0 == scumm_stricmp(gameId, sword1DemoSettings.gameId))
|
||||
return sword1DemoSettings;
|
||||
if (0 == scumm_stricmp(gameid, sword1MacFullSettings.gameId))
|
||||
if (0 == scumm_stricmp(gameId, sword1MacFullSettings.gameId))
|
||||
return sword1MacFullSettings;
|
||||
if (0 == scumm_stricmp(gameid, sword1MacDemoSettings.gameId))
|
||||
if (0 == scumm_stricmp(gameId, sword1MacDemoSettings.gameId))
|
||||
return sword1MacDemoSettings;
|
||||
if (0 == scumm_stricmp(gameid, sword1PSXSettings.gameId))
|
||||
if (0 == scumm_stricmp(gameId, sword1PSXSettings.gameId))
|
||||
return sword1PSXSettings;
|
||||
if (0 == scumm_stricmp(gameid, sword1PSXDemoSettings.gameId))
|
||||
if (0 == scumm_stricmp(gameId, sword1PSXDemoSettings.gameId))
|
||||
return sword1PSXDemoSettings;
|
||||
return GameDescriptor();
|
||||
return PlainGameDescriptor();
|
||||
}
|
||||
|
||||
void Sword1CheckDirectory(const Common::FSList &fslist, bool *filesFound, bool recursion = false) {
|
||||
|
|
|
@ -94,7 +94,7 @@ public:
|
|||
virtual bool hasFeature(MetaEngineFeature f) const;
|
||||
virtual GameList getSupportedGames() const;
|
||||
virtual const ExtraGuiOptions getExtraGuiOptions(const Common::String &target) const;
|
||||
virtual GameDescriptor findGame(const char *gameid) const;
|
||||
PlainGameDescriptor findGame(const char *gameid) const override;
|
||||
virtual DetectedGames detectGames(const Common::FSList &fslist) const;
|
||||
virtual SaveStateList listSaves(const char *target) const;
|
||||
virtual int getMaximumSaveSlot() const;
|
||||
|
@ -135,14 +135,14 @@ const ExtraGuiOptions Sword2MetaEngine::getExtraGuiOptions(const Common::String
|
|||
return options;
|
||||
}
|
||||
|
||||
GameDescriptor Sword2MetaEngine::findGame(const char *gameid) const {
|
||||
PlainGameDescriptor Sword2MetaEngine::findGame(const char *gameid) const {
|
||||
const Sword2::GameSettings *g = Sword2::sword2_settings;
|
||||
while (g->gameid) {
|
||||
if (0 == scumm_stricmp(gameid, g->gameid))
|
||||
break;
|
||||
g++;
|
||||
}
|
||||
return GameDescriptor(g->gameid, g->description);
|
||||
return PlainGameDescriptor(g->gameid, g->description);
|
||||
}
|
||||
|
||||
bool isFullGame(const Common::FSList &fslist) {
|
||||
|
|
|
@ -600,13 +600,13 @@ void EventRecorder::setFileHeader() {
|
|||
return;
|
||||
}
|
||||
TimeDate t;
|
||||
GameDescriptor desc = EngineMan.findGame(ConfMan.getActiveDomainName());
|
||||
PlainGameDescriptor desc = EngineMan.findGame(ConfMan.getActiveDomainName());
|
||||
g_system->getTimeAndDate(t);
|
||||
if (_author.empty()) {
|
||||
setAuthor("Unknown Author");
|
||||
}
|
||||
if (_name.empty()) {
|
||||
g_eventRec.setName(Common::String::format("%.2d.%.2d.%.4d ", t.tm_mday, t.tm_mon, 1900 + t.tm_year) + desc.description());
|
||||
g_eventRec.setName(Common::String::format("%.2d.%.2d.%.4d ", t.tm_mday, t.tm_mon, 1900 + t.tm_year) + desc.description);
|
||||
}
|
||||
_playbackFile->getHeader().author = _author;
|
||||
_playbackFile->getHeader().notes = _desc;
|
||||
|
|
|
@ -95,7 +95,7 @@ protected:
|
|||
}
|
||||
};
|
||||
|
||||
EditGameDialog::EditGameDialog(const String &domain, const String &desc)
|
||||
EditGameDialog::EditGameDialog(const String &domain)
|
||||
: OptionsDialog(domain, "GameOptions") {
|
||||
// Retrieve all game specific options.
|
||||
const Plugin *plugin = nullptr;
|
||||
|
@ -106,7 +106,7 @@ EditGameDialog::EditGameDialog(const String &domain, const String &desc)
|
|||
gameId = domain;
|
||||
// Retrieve the plugin, since we need to access the engine's MetaEngine
|
||||
// implementation.
|
||||
EngineMan.findGame(gameId, &plugin);
|
||||
PlainGameDescriptor pgd = EngineMan.findGame(gameId, &plugin);
|
||||
if (plugin) {
|
||||
_engineOptions = plugin->get<MetaEngine>().getExtraGuiOptions(domain);
|
||||
} else {
|
||||
|
@ -120,8 +120,8 @@ EditGameDialog::EditGameDialog(const String &domain, const String &desc)
|
|||
|
||||
// GAME: Determine the description string
|
||||
String description(ConfMan.get("description", domain));
|
||||
if (description.empty() && !desc.empty()) {
|
||||
description = desc;
|
||||
if (description.empty() && pgd.description) {
|
||||
description = pgd.description;
|
||||
}
|
||||
|
||||
// GUI: Add tab widget
|
||||
|
|
|
@ -62,7 +62,7 @@ class EditGameDialog : public OptionsDialog {
|
|||
typedef Common::String String;
|
||||
typedef Common::Array<Common::String> StringArray;
|
||||
public:
|
||||
EditGameDialog(const String &domain, const String &desc);
|
||||
EditGameDialog(const String &domain);
|
||||
|
||||
void open();
|
||||
virtual void apply();
|
||||
|
|
|
@ -267,9 +267,9 @@ void LauncherDialog::updateListing() {
|
|||
if (gameid.empty())
|
||||
gameid = iter->_key;
|
||||
if (description.empty()) {
|
||||
GameDescriptor g = EngineMan.findGame(gameid);
|
||||
if (g.contains("description"))
|
||||
description = g.description();
|
||||
PlainGameDescriptor g = EngineMan.findGame(gameid);
|
||||
if (g.description)
|
||||
description = g.description;
|
||||
}
|
||||
|
||||
if (description.empty()) {
|
||||
|
@ -443,7 +443,8 @@ void LauncherDialog::editGame(int item) {
|
|||
String gameId(ConfMan.get("gameid", _domains[item]));
|
||||
if (gameId.empty())
|
||||
gameId = _domains[item];
|
||||
EditGameDialog editDialog(_domains[item], EngineMan.findGame(gameId).description());
|
||||
|
||||
EditGameDialog editDialog(_domains[item]);
|
||||
if (editDialog.runModal() > 0) {
|
||||
// User pressed OK, so make changes permanent
|
||||
|
||||
|
@ -612,7 +613,7 @@ bool LauncherDialog::doGameDetection(const Common::String &path) {
|
|||
Common::String domain = addGameToConf(result);
|
||||
|
||||
// Display edit dialog for the new entry
|
||||
EditGameDialog editDialog(domain, result.description());
|
||||
EditGameDialog editDialog(domain);
|
||||
if (editDialog.runModal() > 0) {
|
||||
// User pressed OK, so make changes permanent
|
||||
|
||||
|
|
|
@ -167,9 +167,9 @@ void RecorderDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 dat
|
|||
case kRecordCmd: {
|
||||
TimeDate t;
|
||||
Common::String gameId = ConfMan.get("gameid", _target);
|
||||
GameDescriptor desc = EngineMan.findGame(gameId);
|
||||
PlainGameDescriptor desc = EngineMan.findGame(gameId);
|
||||
g_system->getTimeAndDate(t);
|
||||
EditRecordDialog editDlg(_("Unknown Author"), Common::String::format("%.2d.%.2d.%.4d ", t.tm_mday, t.tm_mon, 1900 + t.tm_year) + desc.description(), "");
|
||||
EditRecordDialog editDlg(_("Unknown Author"), Common::String::format("%.2d.%.2d.%.4d ", t.tm_mday, t.tm_mon, 1900 + t.tm_year) + desc.description, "");
|
||||
if (editDlg.runModal() != kOKCmd) {
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue