From 9c52e6525e338da2170a86e57cefc0fe1c6701e3 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 4 Mar 2016 03:25:31 +0300 Subject: Add parameters support for quest texts in quests.xml Example: test {@@1} Parameters cant be translated. --- src/gui/windows/questswindow.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/gui/windows/questswindow.cpp') diff --git a/src/gui/windows/questswindow.cpp b/src/gui/windows/questswindow.cpp index 9e46cca50..080c0bdd2 100644 --- a/src/gui/windows/questswindow.cpp +++ b/src/gui/windows/questswindow.cpp @@ -233,6 +233,17 @@ void QuestsWindow::loadQuest(const int var, const XmlNodePtr node) std::string str = translator->getStr(data); replaceItemLinks(str); + for (int f = 1; f < 100; f ++) + { + const std::string key = strprintf("text%d", f); + const std::string val = XML::getProperty(dataNode, + key.c_str(), + ""); + if (val.empty()) + break; + const std::string param = strprintf("{@@%d}", f); + replaceAll(str, param, val); + } if (xmlNameEqual(dataNode, "text")) { quest->texts.push_back(QuestItemText(str, -- cgit v1.2.3-70-g09d2