Display game messages in the UI

This commit is contained in:
Oliver Hamlet
2016-01-20 19:01:19 +00:00
parent 3d29fa6591
commit b1999822b1
2 changed files with 14 additions and 4 deletions
+9 -1
View File
@@ -915,6 +915,10 @@ namespace loot {
});
YAML::Node node;
// Store global messages in case they have changed.
node["globalMessages"] = GetGeneralMessages();
for (const auto &plugin : plugins) {
YAML::Node pluginNode;
@@ -929,7 +933,7 @@ namespace loot {
pluginNode[key] = pair.second;
}
node.push_back(pluginNode);
node["plugins"].push_back(pluginNode);
}
_lootState.incrementUnappliedChangeCounter();
@@ -954,6 +958,10 @@ namespace loot {
messages.insert(end(messages),
begin(metadataListMessages),
end(metadataListMessages));
auto gameMessages = _lootState.CurrentGame().GetMessages();
messages.insert(end(messages),
begin(gameMessages),
end(gameMessages));
try {
BOOST_LOG_TRIVIAL(info) << "Using message language: " << _lootState.getLanguage().Name();
+5 -3
View File
@@ -103,11 +103,13 @@ function onSortPlugins() {
return;
}
/* Check if sorted load order differs from current load order. */
const loadOrderIsUnchanged = result.every((plugin, index) => {
const loadOrderIsUnchanged = result.plugins.every((plugin, index) => {
return plugin.name === loot.game.plugins[index].name;
});
if (loadOrderIsUnchanged) {
result.forEach((plugin) => {
loot.game.globalMessages = result.globalMessages;
result.plugins.forEach((plugin) => {
const existingPlugin = loot.game.plugins.find((item) => {
return item.name === plugin.name;
});
@@ -125,7 +127,7 @@ function onSortPlugins() {
}
loot.game.oldLoadOrder = loot.game.plugins;
loot.game.loadOrder = [];
result.forEach((plugin) => {
result.plugins.forEach((plugin) => {
let existingPlugin = loot.game.plugins.find((item) => {
return item.name === plugin.name;
});