diff options
Diffstat (limited to 'src/resources/iteminfo.cpp')
-rw-r--r-- | src/resources/iteminfo.cpp | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/src/resources/iteminfo.cpp b/src/resources/iteminfo.cpp index 49aadc23d..990c78f45 100644 --- a/src/resources/iteminfo.cpp +++ b/src/resources/iteminfo.cpp @@ -82,30 +82,28 @@ std::map<int, int> &ItemInfo::addReplaceSprite(int sprite) return it->second; } -std::string ItemInfo::getDyeString(int color) const +void ItemInfo::setColorsList(std::string name) { - if (mId == 1172) + if (name.empty()) { - if (color == 1) - return "W:#115511,22aa22,99dd99;R:#547000,a5dc00,d1ff46"; - if (color == 0) - return "W:#547000,a5dc00,d1ff46;R:#115511,22aa22,99dd99"; - if (color == 3) - return "W:#ffffff,000000,000000;R:#333333,333333,333333"; + mColors = 0; + mColorList = ""; + } + else + { + mColors = ColorDB::getColorsList(name); + mColorList = name; } - return ""; } std::string ItemInfo::getDyeColorsString(int color) const { - if (mId == 1172) - { - if (color == 1) - return "#115511,22aa22,99dd99;#547000,a5dc00,d1ff46"; - if (color == 0) - return "#547000,a5dc00,d1ff46;#115511,22aa22,99dd99"; - if (color == 3) - return "#ffffff,000000,000000;#333333,333333,333333"; - } - return ""; + 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 |