From 1c02ae101bbabd2174399a6cff82ff6ce6311716 Mon Sep 17 00:00:00 2001 From: LostDragonist Date: Fri, 15 Feb 2019 00:36:31 -0600 Subject: Improve game selection when multiple games are possible --- src/main.cpp | 23 +++++++++++++--- src/organizer_en.ts | 75 +++++++++++++++++++---------------------------------- 2 files changed, 47 insertions(+), 51 deletions(-) (limited to 'src') diff --git a/src/main.cpp b/src/main.cpp index 0f6d7048..275845e2 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -377,13 +377,30 @@ MOBase::IPluginGame *determineCurrentGame(QString const &moPath, QSettings &sett if (!gamePath.isEmpty()) { QDir gameDir(gamePath); + QList possibleGames; for (IPluginGame * const game : plugins.plugins()) { if (game->looksValid(gameDir)) { - return selectGame(settings, gameDir, game); + possibleGames.append(game); + //return selectGame(settings, gameDir, game); + } + } + if (possibleGames.count() > 1) { + SelectionDialog browseSelection(QObject::tr("Please select the game to manage"), nullptr, QSize(32, 32)); + for (IPluginGame *game : possibleGames) { + QString path = game->gameDirectory().absolutePath(); + browseSelection.addChoice(game->gameIcon(), game->gameName(), path, QVariant::fromValue(game)); } + if (browseSelection.exec() == QDialog::Accepted) { + return selectGame(settings, gameDir, browseSelection.getChoiceData().value()); + } else { + reportError(QObject::tr("Canceled finding game in \"%1\".").arg(gamePath)); + } + } else if(possibleGames.count() == 1) { + return selectGame(settings, gameDir, possibleGames[0]); + } else { + reportError(QObject::tr("No game identified in \"%1\". The directory is required to contain " + "the game binary.").arg(gamePath)); } - reportError(QObject::tr("No game identified in \"%1\". The directory is required to contain " - "the game binary.").arg(gamePath)); } } diff --git a/src/organizer_en.ts b/src/organizer_en.ts index dd4d365e..ed614df7 100644 --- a/src/organizer_en.ts +++ b/src/organizer_en.ts @@ -1945,10 +1945,6 @@ p, li { white-space: pre-wrap; } This button will be highlighted if MO discovered potential problems in your setup and provide tips on how to fix them. - This button will be highlighted if MO discovered potential problems in your setup and provide tips on how to fix them. - -!Work in progress! -Right now this has very limited functionality @@ -3318,13 +3314,11 @@ Click OK to restart MO now. invalid content type: %1 - invalid content type %1 invalid mod index: %1 - invalid mod index %1 @@ -4091,19 +4085,16 @@ p, li { white-space: pre-wrap; } Overwrites loose files - Overwrites files Overwritten loose files - Overwritten files Loose files Overwrites & Overwritten - Overwrites & Overwritten @@ -4452,7 +4443,6 @@ p, li { white-space: pre-wrap; } mod not found: %1 - mod "%1" not found @@ -4642,7 +4632,6 @@ Continue? mod not found: %1 - %1 not found @@ -4752,7 +4741,6 @@ Continue? Plugin not found: %1 - esp not found: %1 @@ -4897,7 +4885,6 @@ p, li { white-space: pre-wrap; } invalid profile name: %1 - invalid profile name %1 @@ -4939,7 +4926,6 @@ p, li { white-space: pre-wrap; } invalid mod index: %1 - invalid index %1 @@ -5306,13 +5292,11 @@ p, li { white-space: pre-wrap; } invalid category index: %1 - invalid index %1 invalid category id: %1 - invalid category id %1 @@ -5433,8 +5417,6 @@ If the folder was still in use, restart MO and try again. Enter a new name or select one from the suggested list: (This is just a name for the Instance and can be whatever you wish, the actual game selection will happen on the next screen regardless of chosen name) - Enter a new name or select one from the suggested list: -(This is just the name of the Instance, not the game selection) @@ -5528,7 +5510,6 @@ If the folder was still in use, restart MO and try again. file not found: %1 - %1 not found @@ -6029,23 +6010,24 @@ If you use pre-releases, never contact me directly by e-mail or via private mess - - Reset Colors + + + When this is enabled, the color defined for a separator will be shown on the mod list scrollbar at the location of the separator. This can be useful for quick navigation between separator sections or to a specific separator section. - - Is overwritten (loose files) + + Show mod list separator colors on the scrollbar - - Mod Contains selected Plugin + + Plugin is Contained in selected Mod - - Plugin is Contained in selected Mod + + Is overwritten (loose files) @@ -6054,14 +6036,13 @@ If you use pre-releases, never contact me directly by e-mail or via private mess - - - When this is enabled, the color defined for a separator will be shown on the mod list scrollbar at the location of the separator. This can be useful for quick navigation between separator sections or to a specific separator section. + + Reset Colors - - Show mod list separator colors on the scrollbar + + Mod Contains selected Plugin @@ -6413,19 +6394,19 @@ tl;dr-version: If Nexus-features don't work, insert the current version num - - If checked, files (i.e. esps, esms and bsas) belonging to the core game can not be disabled in the UI. (default: on) + + Enforces that inactive ESPs and ESMs are never loaded. - - If checked, files (i.e. esps, esms and bsas) belonging to the core game can not be disabled in the UI. (default: on) -Uncheck this if you want to use Mod Organizer with total conversions (like Nehrim) but be aware that the game will crash if required files are not enabled. + + It seems that the Games occasionally load ESP or ESM files even if they haven't been activated as plugins. +I don't yet know what the circumstances are, but user reports imply it is in some cases unwanted. If this is checked, ESPs and ESMs not checked in the List are invisible to the game and can not be loaded. - - Force-enable game files + + Hide inactive ESPs/ESMs @@ -6447,19 +6428,19 @@ If you disable this feature, MO will only display official DLCs this way. Please - - Enforces that inactive ESPs and ESMs are never loaded. + + If checked, files (i.e. esps, esms and bsas) belonging to the core game can not be disabled in the UI. (default: on) - - It seems that the Games occasionally load ESP or ESM files even if they haven't been activated as plugins. -I don't yet know what the circumstances are, but user reports imply it is in some cases unwanted. If this is checked, ESPs and ESMs not checked in the List are invisible to the game and can not be loaded. + + If checked, files (i.e. esps, esms and bsas) belonging to the core game can not be disabled in the UI. (default: on) +Uncheck this if you want to use Mod Organizer with total conversions (like Nehrim) but be aware that the game will crash if required files are not enabled. - - Hide inactive ESPs/ESMs + + Force-enable game files @@ -6476,7 +6457,6 @@ I don't yet know what the circumstances are, but user reports imply it is i Enable parsing of Archives. This is an Experimental Feature. Has negative effects on performance and known incorrectness. - Enable parsing of Archives. Has negative effects on performance. @@ -6487,7 +6467,6 @@ I don't yet know what the circumstances are, but user reports imply it is i Enable parsing of Archives (Experimental Feature) - Enable parsing of Archives -- cgit v1.3.1