summaryrefslogtreecommitdiff
path: root/src/resources/iteminfo.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-03-03 02:50:03 +0200
committerAndrei Karas <akaras@inbox.ru>2011-03-03 02:50:03 +0200
commitde51eaa43e05c2126fc1eef2a7e115843f972547 (patch)
tree286a05a069e048247f90c7595f1b8939be784608 /src/resources/iteminfo.cpp
parentd4c08d3bf69410a35a50875de50cc6fe74b3bf3e (diff)
parent8627c7745f47492ab349da6a74e98e3d5813418f (diff)
downloadmv-de51eaa43e05c2126fc1eef2a7e115843f972547.tar.gz
mv-de51eaa43e05c2126fc1eef2a7e115843f972547.tar.bz2
mv-de51eaa43e05c2126fc1eef2a7e115843f972547.tar.xz
mv-de51eaa43e05c2126fc1eef2a7e115843f972547.zip
Merge branch 'coloritems'
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