GLK: Show unknown variant dialog for unknown detection entries

This commit is contained in:
Paul Gilbert 2019-06-23 12:42:00 -07:00
parent b2b78f48f0
commit a53e00597b
8 changed files with 66 additions and 64 deletions

View file

@ -86,13 +86,15 @@ bool AdvSysMetaEngine::detectGames(const Common::FSList &fslist, DetectedGames &
gameList.push_back(gd);
} else {
if (gDebugLevel > 0) {
// Print an entry suitable for putting into the detection_tables.h
debug("ENTRY0(\"%s\", \"%s\", %u),", filename.c_str(), md5.c_str(), (uint)filesize);
}
const PlainGameDescriptor &desc = ADVSYS_GAME_LIST[0];
DetectedGame gd(desc.gameId, desc.description, Common::UNK_LANG, Common::kPlatformUnknown);
gd.canBeAdded = true;
gd.hasUnknownFiles = true;
FileProperties fp;
fp.md5 = md5;
fp.size = filesize;
gd.matchedFiles[file->getName()] = fp;
gameList.push_back(gd);
}
}

View file

@ -73,18 +73,15 @@ bool Alan2MetaEngine::detectGames(const Common::FSList &fslist, DetectedGames &g
DetectedGame gd;
if (!p->_gameId) {
if (gDebugLevel > 0) {
// Print an entry suitable for putting into the detection_tables.h, using the
// name of the parent folder the game is in as the presumed game Id
Common::String fname = filename;
const char *dot = strchr(fname.c_str(), '.');
if (dot)
fname = Common::String(fname.c_str(), dot);
debug("ENTRY0(\"%s\", \"%s\", %u),", fname.c_str(), md5.c_str(), (uint)filesize);
}
const PlainGameDescriptor &desc = ALAN2_GAME_LIST[0];
gd = DetectedGame(desc.gameId, desc.description, Common::UNK_LANG, Common::kPlatformUnknown);
gd.canBeAdded = true;
gd.hasUnknownFiles = true;
FileProperties fp;
fp.md5 = md5;
fp.size = filesize;
gd.matchedFiles[filename] = fp;
} else {
PlainGameDescriptor gameDesc = findGame(p->_gameId);
gd = DetectedGame(p->_gameId, gameDesc.description, Common::EN_ANY, Common::kPlatformUnknown);

View file

@ -120,22 +120,15 @@ bool FrotzMetaEngine::detectGames(const Common::FSList &fslist, DetectedGames &g
if (filename.hasSuffixIgnoreCase(".dat") || filename.hasSuffixIgnoreCase(".zip") || emptyBlorb)
continue;
if (gDebugLevel > 0) {
// Print an entry suitable for putting into the detection_tables.h, using the
// name of the parent folder the game is in as the presumed game Id
Common::String folderName = file->getParent().getName();
if (folderName.hasSuffix("\\"))
folderName.deleteLastChar();
Common::String fname = filename;
const char *dot = strchr(fname.c_str(), '.');
if (dot)
fname = Common::String(fname.c_str(), dot);
debug("ENTRY0(\"%s\", %s, \"%s\", %u),",
fname.c_str(), strlen(serial) ? serial : "nullptr", md5.c_str(), (uint)filesize);
}
const PlainGameDescriptor &desc = ZCODE_GAME_LIST[0];
gd = DetectedGame(desc.gameId, desc.description, Common::UNK_LANG, Common::kPlatformUnknown);
gd.canBeAdded = true;
gd.hasUnknownFiles = true;
FileProperties fp;
fp.md5 = md5;
fp.size = filesize;
gd.matchedFiles[filename] = fp;
} else {
GameDescriptor gameDesc = findGame(p->_gameId);
gd = DetectedGame(p->_gameId, gameDesc._description, p->_language, Common::kPlatformUnknown, p->_extra);

View file

@ -81,21 +81,15 @@ bool GlulxeMetaEngine::detectGames(const Common::FSList &fslist, DetectedGames &
DetectedGame gd;
if (!p->_gameId) {
if (gDebugLevel > 0) {
// Print an entry suitable for putting into the detection_tables.h, using the
// name of the parent folder the game is in as the presumed game Id
Common::String folderName = file->getParent().getName();
if (folderName.hasSuffix("\\"))
folderName.deleteLastChar();
Common::String fname = filename;
const char *dot = strchr(fname.c_str(), '.');
if (dot)
fname = Common::String(fname.c_str(), dot);
debug("ENTRY0(\"%s\", \"%s\", %u),", fname.c_str(), md5.c_str(), (uint)filesize);
}
const PlainGameDescriptor &desc = GLULXE_GAME_LIST[0];
gd = DetectedGame(desc.gameId, desc.description, Common::UNK_LANG, Common::kPlatformUnknown);
gd.canBeAdded = true;
gd.hasUnknownFiles = true;
FileProperties fp;
fp.md5 = md5;
fp.size = filesize;
gd.matchedFiles[filename] = fp;
} else {
PlainGameDescriptor gameDesc = findGame(p->_gameId);
gd = DetectedGame(p->_gameId, gameDesc.description, p->_language, Common::kPlatformUnknown, p->_extra);

View file

@ -76,13 +76,15 @@ bool HugoMetaEngine::detectGames(const Common::FSList &fslist, DetectedGames &ga
DetectedGame gd;
if (!p->_gameId) {
if (gDebugLevel > 0) {
// Print an entry suitable for putting into the detection_tables.h
debug("ENTRY0(\"%s\", \"%s\", %u),", filename.c_str(), md5.c_str(), (uint)filesize);
}
const PlainGameDescriptor &desc = HUGO_GAME_LIST[0];
gd = DetectedGame(desc.gameId, desc.description, Common::UNK_LANG, Common::kPlatformUnknown);
gd.canBeAdded = true;
gd.hasUnknownFiles = true;
FileProperties fp;
fp.md5 = md5;
fp.size = filesize;
gd.matchedFiles[filename] = fp;
} else {
PlainGameDescriptor gameDesc = findGame(p->_gameId);
gd = DetectedGame(p->_gameId, gameDesc.description, p->_language, Common::kPlatformUnknown, p->_extra);

View file

@ -81,13 +81,15 @@ bool MagneticMetaEngine::detectGames(const Common::FSList &fslist, DetectedGames
DetectedGame gd;
if (!p->_gameId) {
if (gDebugLevel > 0) {
// Print an entry suitable for putting into the detection_tables.h
debug("ENTRY0(\"%s\", \"%s\", %u),", filename.c_str(), md5.c_str(), (uint)filesize);
}
const PlainGameDescriptor &desc = MAGNETIC_GAME_LIST[0];
gd = DetectedGame(desc.gameId, desc.description, Common::UNK_LANG, Common::kPlatformUnknown);
gd.canBeAdded = true;
gd.hasUnknownFiles = true;
FileProperties fp;
fp.md5 = md5;
fp.size = filesize;
gd.matchedFiles[filename] = fp;
} else {
PlainGameDescriptor gameDesc = findGame(p->_gameId);
gd = DetectedGame(p->_gameId, gameDesc.description, p->_language, Common::kPlatformUnknown, p->_extra);

View file

@ -77,14 +77,28 @@ bool ScottMetaEngine::detectGames(const Common::FSList &fslist, DetectedGames &g
while (p->_md5 && p->_filesize != filesize && md5 != p->_md5)
++p;
if (p->_filesize) {
DetectedGame gd;
if (!p->_gameId) {
if (!isBlorb && filename.hasSuffixIgnoreCase(".dat"))
continue;
const PlainGameDescriptor &desc = SCOTT_GAME_LIST[0];
gd = DetectedGame(desc.gameId, desc.description, Common::UNK_LANG, Common::kPlatformUnknown);
gd.canBeAdded = true;
gd.hasUnknownFiles = true;
FileProperties fp;
fp.md5 = md5;
fp.size = filesize;
gd.matchedFiles[filename] = fp;
} else {
// Found a match
PlainGameDescriptor gameDesc = findGame(p->_gameId);
DetectedGame gd(p->_gameId, gameDesc.description, Common::EN_ANY, Common::kPlatformUnknown);
gd.addExtraEntry("filename", file->getName());
gameList.push_back(gd);
}
gameList.push_back(gd);
}
return !gameList.empty();

View file

@ -106,17 +106,15 @@ bool TADSMetaEngine::detectGames(const Common::FSList &fslist, DetectedGames &ga
DetectedGame gd;
if (!p->_gameId) {
if (gDebugLevel > 0) {
// Print an entry suitable for putting into the detection_tables.h
Common::String fname = filename;
const char *dot = strchr(fname.c_str(), '.');
if (dot)
fname = Common::String(fname.c_str(), dot);
debug("TADS%d ENTRY0(\"%s\", \"%s\", %u),", tadsVersion, fname.c_str(), md5.c_str(), (uint)filesize);
}
const GameDescriptor &desc = tadsVersion == 2 ? TADS2_GAME_LIST[0] : TADS3_GAME_LIST[0];
gd = DetectedGame(desc._gameId, desc._description, Common::UNK_LANG, Common::kPlatformUnknown);
gd.canBeAdded = true;
gd.hasUnknownFiles = true;
FileProperties fp;
fp.md5 = md5;
fp.size = filesize;
gd.matchedFiles[filename] = fp;
} else {
PlainGameDescriptor gameDesc = findGame(p->_gameId);
gd = DetectedGame(p->_gameId, gameDesc.description, p->_language, Common::kPlatformUnknown, p->_extra);