summaryrefslogtreecommitdiff
path: root/src/resources/iteminfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/resources/iteminfo.cpp')
-rw-r--r--src/resources/iteminfo.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/resources/iteminfo.cpp b/src/resources/iteminfo.cpp
index e9a550cda..78740522f 100644
--- a/src/resources/iteminfo.cpp
+++ b/src/resources/iteminfo.cpp
@@ -309,3 +309,15 @@ void ItemInfo::setSprite(const std::string &animationFile,
{
mAnimationFiles[static_cast<int>(gender) + race * 4] = animationFile;
}
+
+std::string ItemInfo::getColorName(const int idx) const
+{
+ if (!mColors)
+ return std::string();
+
+ const std::map <int, ColorDB::ItemColor>::const_iterator
+ it = mColors->find(idx);
+ if (it == mColors->end())
+ return std::string();
+ return it->second.name;
+}