mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
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:
@@ -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;
|
||||
|
||||
@@ -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. */
|
||||
|
||||
Reference in New Issue
Block a user