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.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/resources/iteminfo.cpp b/src/resources/iteminfo.cpp
index 255a9a7b3..990c78f45 100644
--- a/src/resources/iteminfo.cpp
+++ b/src/resources/iteminfo.cpp
@@ -81,3 +81,29 @@ std::map<int, int> &ItemInfo::addReplaceSprite(int sprite)
}
return it->second;
}
+
+void ItemInfo::setColorsList(std::string name)
+{
+ if (name.empty())
+ {
+ mColors = 0;
+ mColorList = "";
+ }
+ else
+ {
+ mColors = ColorDB::getColorsList(name);
+ mColorList = name;
+ }
+}
+
+std::string ItemInfo::getDyeColorsString(int color) const
+{
+ if (!mColors || mColorList.empty())
+ return "";
+
+ std::map <int, ColorDB::ItemColor>::iterator it = mColors->find(color);
+ if (it == mColors->end())
+ return "";
+
+ return it->second.color;
+} \ No newline at end of file