diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2019-07-01 09:55:42 -0400 |
|---|---|---|
| committer | isanae <14251494+isanae@users.noreply.github.com> | 2019-07-01 09:55:42 -0400 |
| commit | 553a4d12a7891a463b87406ec1550b874518b001 (patch) | |
| tree | 1d3d0ad79b146f52d76ebe94f940022b2cdd3251 /src/main.cpp | |
| parent | 5e27a96a27a351701182d493c64de698aaac4ae8 (diff) | |
show supported games in error dialog when browsing for a binary
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp index f74a9cf4..f08e5ad3 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -371,8 +371,25 @@ MOBase::IPluginGame *determineCurrentGame(QString const &moPath, QSettings &sett } else if(possibleGames.count() == 1) { return selectGame(settings, gameDir, possibleGames[0]); } else { - reportError(gameConfigured ? QObject::tr("%1 not identified in \"%2\". The directory is required to contain the game binary.").arg(gameName).arg(gamePath) - : QObject::tr("No game identified in \"%1\". The directory is required to contain the game binary.").arg(gamePath)); + if (gameConfigured) { + reportError(QObject::tr("%1 not identified in \"%2\". The directory is required to contain the game binary.").arg(gameName).arg(gamePath)); + } else { + QString supportedGames; + + for (IPluginGame * const game : plugins.plugins<IPluginGame>()) { + supportedGames += "<li>" + game->gameName() + "</li>"; + } + + QString text = QObject::tr( + "No game identified in \"%1\". The directory is required to " + "contain the game binary.<br><br>" + "<b>These are the games supported by Mod Organizer:</b>" + "<ul>%2</ul>") + .arg(gamePath) + .arg(supportedGames); + + reportError(text); + } } } } |
