From ae51c95555884dc5aba64c76648eeeb9a2bbb0c3 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 16 Aug 2015 22:19:04 +0300 Subject: Add attribute cardColor to items in items.xml. --- src/resources/db/itemdb.cpp | 3 +++ src/resources/iteminfo.cpp | 1 + src/resources/iteminfo.h | 7 +++++++ 3 files changed, 11 insertions(+) (limited to 'src/resources') diff --git a/src/resources/db/itemdb.cpp b/src/resources/db/itemdb.cpp index 9cd687768..2f593e551 100644 --- a/src/resources/db/itemdb.cpp +++ b/src/resources/db/itemdb.cpp @@ -299,6 +299,7 @@ void ItemDB::loadXmlFile(const std::string &fileName, int &tagNum) const std::string typeStr = XML::getProperty(node, "type", "other"); const int weight = XML::getProperty(node, "weight", 0); const int view = XML::getProperty(node, "view", 0); + const int cardColor = XML::getProperty(node, "cardColor", -1); std::string name = XML::langProperty(node, "name", ""); std::string image = XML::getProperty(node, "image", ""); @@ -366,6 +367,8 @@ void ItemDB::loadXmlFile(const std::string &fileName, int &tagNum) itemInfo->setPet(pet); itemInfo->setProtected(XML::getBoolProperty( node, "sellProtected", false)); + if (cardColor != -1) + itemInfo->setCardColor(fromInt(cardColor, ItemColor)); switch (itemInfo->getType()) { diff --git a/src/resources/iteminfo.cpp b/src/resources/iteminfo.cpp index 52e238a5d..ade20ef0b 100644 --- a/src/resources/iteminfo.cpp +++ b/src/resources/iteminfo.cpp @@ -61,6 +61,7 @@ ItemInfo::ItemInfo() : mTags(), mColorsList(nullptr), mColorsListName(), + mCardColor(ItemColor_zero), mHitEffectId(-1), mCriticalHitEffectId(-1), mMissEffectId(-1), diff --git a/src/resources/iteminfo.h b/src/resources/iteminfo.h index 5d7b2f15f..27191f92e 100644 --- a/src/resources/iteminfo.h +++ b/src/resources/iteminfo.h @@ -228,6 +228,12 @@ class ItemInfo final int getPet() const { return mPet; } + void setCardColor(const ItemColor color) + { mCardColor = color; } + + ItemColor getCardColor() const + { return mCardColor; } + /** Effects to be shown when weapon attacks - see also effects.xml */ std::string mMissileParticleFile; @@ -320,6 +326,7 @@ class ItemInfo final std::map mTags; const std::map *mColorsList; std::string mColorsListName; + ItemColor mCardColor; int mHitEffectId; int mCriticalHitEffectId; int mMissEffectId; -- cgit v1.2.3-70-g09d2