summaryrefslogtreecommitdiff
path: root/src/utils/itemxmlutils.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2018-02-13 01:54:28 +0300
committerAndrei Karas <akaras@inbox.ru>2018-02-13 04:28:32 +0300
commitacba95ebb0119e7b0f9ef01d9bf3577582857253 (patch)
treeb5346c2a5642456e793b28487020cf1c727d8f07 /src/utils/itemxmlutils.cpp
parent0a47f5c44ddd5fb5157d116ffe0f5ee5f4207eb0 (diff)
downloadplus-acba95ebb0119e7b0f9ef01d9bf3577582857253.tar.gz
plus-acba95ebb0119e7b0f9ef01d9bf3577582857253.tar.bz2
plus-acba95ebb0119e7b0f9ef01d9bf3577582857253.tar.xz
plus-acba95ebb0119e7b0f9ef01d9bf3577582857253.zip
Add clan window.
For now can be opened only by chat command /clan.
Diffstat (limited to 'src/utils/itemxmlutils.cpp')
-rw-r--r--src/utils/itemxmlutils.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/utils/itemxmlutils.cpp b/src/utils/itemxmlutils.cpp
index cbf642c4f..2f849b8ce 100644
--- a/src/utils/itemxmlutils.cpp
+++ b/src/utils/itemxmlutils.cpp
@@ -54,3 +54,28 @@ void readItemStatsString(std::string &effect,
value.c_str()));
}
}
+
+void readItemStatsVector(STD_VECTOR<std::string> &effect,
+ XmlNodeConstPtr node,
+ const ItemFieldInfos &fields)
+{
+ if (translator == nullptr)
+ return;
+
+ FOR_EACH (ItemFieldInfos::const_iterator, it, fields)
+ {
+ const std::string fieldName = (*it).first;
+ const ItemFieldType *const field = (*it).second;
+
+ std::string value = XML::getProperty(node,
+ fieldName.c_str(),
+ "");
+ if (value.empty())
+ continue;
+ if (field->sign && isDigit(value))
+ value = std::string("+").append(value);
+ const std::string format = translator->getStr(field->description);
+ effect.push_back(strprintf(format.c_str(),
+ value.c_str()));
+ }
+}