mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
Display game messages in the UI
This commit is contained in:
+9
-1
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user