Fix cyclic interaction error message issues

The message was duplicating on unfixed sorts, and it wasn't being
displayed in an error message dialog.
This commit is contained in:
Oliver Hamlet
2016-03-11 18:11:50 +00:00
parent bc8283c63c
commit 7cc24721bb
2 changed files with 8 additions and 5 deletions
+4 -3
View File
@@ -101,6 +101,10 @@ namespace loot {
indexMap.clear();
oldLoadOrder.clear();
// Clear any existing game-specific messages, as these only relate to
// state that has been changed by sorting.
game.ClearMessages();
progressCallback(boost::locale::translate("Building plugin graph..."));
BuildPluginGraph(game, language);
@@ -153,9 +157,6 @@ namespace loot {
plugins.push_back(graph[vertex]);
}
// Clear any existing game-specific messages, as these only relate to
// state that has been changed by sorting.
game.ClearMessages();
game.SetLoadOrderSorted(true);
return plugins;
+4 -2
View File
@@ -102,8 +102,10 @@ function onSortPlugins() {
loot.game.globalMessages = result.globalMessages;
if (!result.plugins) {
loot.Dialog.closeProgress();
return;
const message = result.globalMessages.find((item) => {
return item.content[0].str.startsWith('Cyclic interaction detected');
});
throw new Error(loot.l10n.translate('Failed to sort plugins. Details: ' + message.content[0].str));
}
/* Check if sorted load order differs from current load order. */