From 1240589615918547fab96a8b9315a66d068e712e Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 20 Aug 2015 22:41:22 +0300 Subject: Add support for reading iconColors palette field from items. --- src/resources/db/itemdb.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'src/resources/db/itemdb.cpp') 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")); -- cgit v1.2.3-70-g09d2