diff options
Diffstat (limited to 'src/resources/db/itemdb.cpp')
-rw-r--r-- | src/resources/db/itemdb.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/resources/db/itemdb.cpp b/src/resources/db/itemdb.cpp index 0cad05f39..080254bb0 100644 --- a/src/resources/db/itemdb.cpp +++ b/src/resources/db/itemdb.cpp @@ -139,6 +139,19 @@ static std::string useButtonFromItemType(const ItemType::Type &type) return std::string(); } +static std::string useButton2FromItemType(const ItemType::Type &type) +{ + const size_t sz = sizeof(itemTypeMap) / sizeof(itemTypeMap[0]); + for (size_t f = 0; f < sz; f ++) + { + const ItemTypeMap &item = itemTypeMap[f]; + if (item.type == type) + return gettext(item.useButton2.c_str()); + } + logger->log("Unknown item type"); + return std::string(); +} + static void initStatic() { mConstructed = true; @@ -257,6 +270,7 @@ void ItemDB::loadXmlFile(const std::string &fileName, int &tagNum) const int maxFloorOffset = XML::getIntProperty( node, "maxFloorOffset", mapTileSize, 0, mapTileSize); std::string useButton = XML::getProperty(node, "useButton", ""); + std::string useButton2 = XML::getProperty(node, "useButton2", ""); std::string colors; if (serverVersion >= 1) { @@ -308,6 +322,9 @@ void ItemDB::loadXmlFile(const std::string &fileName, int &tagNum) if (useButton.empty()) useButton = useButtonFromItemType(itemInfo->getType()); itemInfo->setUseButton(useButton); + if (useButton2.empty()) + useButton2 = useButton2FromItemType(itemInfo->getType()); + itemInfo->setUseButton2(useButton2); itemInfo->addTag(mTags["All"]); itemInfo->setPet(pet); itemInfo->setProtected(XML::getBoolProperty( |