diff options
| author | Bastien Bouclet | 2018-05-06 12:57:08 +0200 |
|---|---|---|
| committer | Bastien Bouclet | 2018-05-10 09:04:23 +0200 |
| commit | 8fb149e3c7603f023dfccf2b2056a9a2fda431c2 (patch) | |
| tree | a758cefc70a784a65045d09d96f44ed1c16abbb8 /gui | |
| parent | cf1ebf29516bd74927fd7b632b72fd8973f72e98 (diff) | |
| download | scummvm-rg350-8fb149e3c7603f023dfccf2b2056a9a2fda431c2.tar.gz scummvm-rg350-8fb149e3c7603f023dfccf2b2056a9a2fda431c2.tar.bz2 scummvm-rg350-8fb149e3c7603f023dfccf2b2056a9a2fda431c2.zip | |
ENGINES: Change MetaEngine::findGame to return a plain game descriptor
Diffstat (limited to 'gui')
| -rw-r--r-- | gui/EventRecorder.cpp | 4 | ||||
| -rw-r--r-- | gui/editgamedialog.cpp | 8 | ||||
| -rw-r--r-- | gui/editgamedialog.h | 2 | ||||
| -rw-r--r-- | gui/launcher.cpp | 11 | ||||
| -rw-r--r-- | gui/recorderdialog.cpp | 4 |
5 files changed, 15 insertions, 14 deletions
diff --git a/gui/EventRecorder.cpp b/gui/EventRecorder.cpp index 849405410a..560df0ec35 100644 --- a/gui/EventRecorder.cpp +++ b/gui/EventRecorder.cpp @@ -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; diff --git a/gui/editgamedialog.cpp b/gui/editgamedialog.cpp index 4192c4058a..c4cf6e7800 100644 --- a/gui/editgamedialog.cpp +++ b/gui/editgamedialog.cpp @@ -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 diff --git a/gui/editgamedialog.h b/gui/editgamedialog.h index a317e364c6..06a8514dd5 100644 --- a/gui/editgamedialog.h +++ b/gui/editgamedialog.h @@ -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(); diff --git a/gui/launcher.cpp b/gui/launcher.cpp index b14be6c11e..f257c53e11 100644 --- a/gui/launcher.cpp +++ b/gui/launcher.cpp @@ -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 diff --git a/gui/recorderdialog.cpp b/gui/recorderdialog.cpp index cd89b58f00..7a2cd048f4 100644 --- a/gui/recorderdialog.cpp +++ b/gui/recorderdialog.cpp @@ -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; } |
