Implemented message content substitution support.

As in issue #202.
This commit is contained in:
Oliver Hamlet
2014-10-23 15:59:01 +01:00
parent 03feb8904a
commit 2529826d7e
+14
View File
@@ -225,6 +225,20 @@ namespace YAML {
return false;
}
// Make any substitutions at this point.
if (node["subs"]) {
std::vector<std::string> subs = node["subs"].as<std::vector<std::string>>();
for (auto& mc : content) {
boost::format f(mc.Str());
for (const auto& sub : subs) {
f = f % sub;
}
mc = loot::MessageContent(f.str(), mc.Language());
}
}
std::string condition;
if (node["condition"])
condition = node["condition"].as<std::string>();