From d3e3789ee54b7390b870a286c0bd7d74702a2aa2 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 11 Jan 2011 03:40:57 +0200 Subject: Add support for reading cutom tags from items.xml --- src/resources/itemdb.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src') diff --git a/src/resources/itemdb.cpp b/src/resources/itemdb.cpp index a590dcac1..49ba7bd9e 100644 --- a/src/resources/itemdb.cpp +++ b/src/resources/itemdb.cpp @@ -210,6 +210,11 @@ void ItemDB::load() std::string drawBefore = XML::getProperty(node, "drawBefore", ""); std::string drawAfter = XML::getProperty(node, "drawAfter", ""); + std::string tags[3]; + tags[0] = XML::getProperty(node, "tag", XML::getProperty(node, "tag1", "")); + tags[1] = XML::getProperty(node, "tag2", ""); + tags[2] = XML::getProperty(node, "tag3", ""); + int drawPriority = XML::getProperty(node, "drawPriority", 0); int attackRange = XML::getProperty(node, "attack-range", 0); @@ -237,6 +242,18 @@ void ItemDB::load() itemInfo->addTag(mTags["Equipment"]); break; } + for (int f = 0; f < 3; f++) + { + if (tags[f] != "") + { + if (mTags.find(tags[f]) == mTags.end()) + { + mTagNames.push_back(tags[f]); + mTags[tags[f]] = tagNum ++; + } + itemInfo->addTag(mTags[tags[f]]); + } + } itemInfo->setView(view); itemInfo->setWeight(weight); -- cgit v1.2.3-70-g09d2