mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
Display a game message if a cyclic error occurs
The message is displayed as a general message in the UI until the next successful sort, giving users something to refer to if they try to fix the issue. Fixes #421.
This commit is contained in:
+9
-1
@@ -953,7 +953,15 @@ namespace loot {
|
||||
}
|
||||
catch (loot::error& e) {
|
||||
BOOST_LOG_TRIVIAL(error) << "Failed to sort plugins. Details: " << e.what();
|
||||
callback->Failure(e.code(), (boost::format(loc::translate("Failed to sort plugins. Details: %1%")) % e.what()).str());
|
||||
if (e.code() == error::sorting_error) {
|
||||
_lootState.CurrentGame().AppendMessage(Message(Message::error, e.what()));
|
||||
|
||||
YAML::Node node;
|
||||
node["globalMessages"] = GetGeneralMessages();
|
||||
callback->Success(JSON::stringify(node));
|
||||
}
|
||||
else
|
||||
callback->Failure(e.code(), (boost::format(loc::translate("Failed to sort plugins. Details: %1%")) % e.what()).str());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -101,6 +101,11 @@ function onSortPlugins() {
|
||||
|
||||
loot.game.globalMessages = result.globalMessages;
|
||||
|
||||
if (!result.plugins) {
|
||||
loot.Dialog.closeProgress();
|
||||
return;
|
||||
}
|
||||
|
||||
/* Check if sorted load order differs from current load order. */
|
||||
const loadOrderIsUnchanged = result.plugins.every((plugin, index) => {
|
||||
return plugin.name === loot.game.plugins[index].name;
|
||||
|
||||
Reference in New Issue
Block a user