diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-01-11 03:40:57 +0200 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-01-11 03:40:57 +0200 |
commit | d3e3789ee54b7390b870a286c0bd7d74702a2aa2 (patch) | |
tree | 83635781f8a35926884504ff11311147f20cd1ac | |
parent | 987120463333c3e412927e49234173de0b894490 (diff) | |
download | plus-d3e3789ee54b7390b870a286c0bd7d74702a2aa2.tar.gz plus-d3e3789ee54b7390b870a286c0bd7d74702a2aa2.tar.bz2 plus-d3e3789ee54b7390b870a286c0bd7d74702a2aa2.tar.xz plus-d3e3789ee54b7390b870a286c0bd7d74702a2aa2.zip |
Add support for reading cutom tags from items.xml
-rw-r--r-- | src/resources/itemdb.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
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); |