summaryrefslogtreecommitdiff
path: root/src/resources/db/itemdb.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-08-20 22:41:22 +0300
committerAndrei Karas <akaras@inbox.ru>2015-08-20 22:41:22 +0300
commit1240589615918547fab96a8b9315a66d068e712e (patch)
tree4e361d32b965973e28a70d4c6b8c352fb2cb0a61 /src/resources/db/itemdb.cpp
parentf23abf81cd21907117bf4edf0d814d8bef950e13 (diff)
downloadplus-1240589615918547fab96a8b9315a66d068e712e.tar.gz
plus-1240589615918547fab96a8b9315a66d068e712e.tar.bz2
plus-1240589615918547fab96a8b9315a66d068e712e.tar.xz
plus-1240589615918547fab96a8b9315a66d068e712e.zip
Add support for reading iconColors palette field from items.
Diffstat (limited to 'src/resources/db/itemdb.cpp')
-rw-r--r--src/resources/db/itemdb.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/resources/db/itemdb.cpp b/src/resources/db/itemdb.cpp
index 2f593e551..784a0e619 100644
--- a/src/resources/db/itemdb.cpp
+++ b/src/resources/db/itemdb.cpp
@@ -319,12 +319,19 @@ void ItemDB::loadXmlFile(const std::string &fileName, int &tagNum)
node, "maxFloorOffset", mapTileSize, 0, mapTileSize);
std::string useButton = XML::langProperty(node, "useButton", "");
std::string useButton2 = XML::langProperty(node, "useButton2", "");
- std::string colors;
- colors = XML::getProperty(node, "colors", "");
+ std::string colors = XML::getProperty(node, "colors", "");
+ std::string iconColors = XML::getProperty(node, "iconColors", "");
+ if (iconColors.empty())
+ iconColors = colors;
// check for empty hair palete
- if (colors.empty() && id <= -1 && id > -100)
- colors = "hair";
+ if (id <= -1 && id > -100)
+ {
+ if (colors.empty())
+ colors = "hair";
+ if (iconColors.empty())
+ iconColors = "hair";
+ }
std::string tags[3];
tags[0] = XML::getProperty(node, "tag",
@@ -425,6 +432,7 @@ void ItemDB::loadXmlFile(const std::string &fileName, int &tagNum)
itemInfo->setDrawAfter(-1, parseSpriteName(drawAfter));
itemInfo->setDrawPriority(-1, drawPriority);
itemInfo->setColorsList(colors);
+ itemInfo->setIconColorsList(iconColors);
itemInfo->setMaxFloorOffset(maxFloorOffset);
itemInfo->setPickupCursor(XML::getProperty(
node, "pickupCursor", "pickup"));