summaryrefslogtreecommitdiff
path: root/src/resources
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-05-31 17:31:46 +0300
committerAndrei Karas <akaras@inbox.ru>2012-05-31 17:31:46 +0300
commit02677a3b9b3abefb84e24023697466c892c6ded4 (patch)
tree4e563d4fb0af1a8fb8e99a5b97c58281a21d3182 /src/resources
parentd4e5b8fb2b9b72e750845b874f3e60d3aea31543 (diff)
downloadmanaplus-02677a3b9b3abefb84e24023697466c892c6ded4.tar.gz
manaplus-02677a3b9b3abefb84e24023697466c892c6ded4.tar.bz2
manaplus-02677a3b9b3abefb84e24023697466c892c6ded4.tar.xz
manaplus-02677a3b9b3abefb84e24023697466c892c6ded4.zip
Add support for each hair style own palete.
Diffstat (limited to 'src/resources')
-rw-r--r--src/resources/colordb.cpp25
-rw-r--r--src/resources/colordb.h2
-rw-r--r--src/resources/itemdb.cpp13
-rw-r--r--src/resources/iteminfo.h2
4 files changed, 13 insertions, 29 deletions
diff --git a/src/resources/colordb.cpp b/src/resources/colordb.cpp
index 66c8de0a2..2b9a21500 100644
--- a/src/resources/colordb.cpp
+++ b/src/resources/colordb.cpp
@@ -155,31 +155,6 @@ void ColorDB::unload()
mLoaded = false;
}
-std::string &ColorDB::getHairColor(int id)
-{
- if (!mLoaded)
- load();
-
- ColorListsIterator it = mColorLists.find("hair");
- if (it == mColorLists.end())
- {
- logger->log1("ColorDB: Error, hair colors list empty");
- return mFail;
- }
-
- ColorIterator i = (*it).second.find(id);
-
- if (i == (*it).second.end())
- {
- logger->log("ColorDB: Error, unknown dye ID# %d", id);
- return mFail;
- }
- else
- {
- return i->second.color;
- }
-}
-
std::string &ColorDB::getHairColorName(int id)
{
if (!mLoaded)
diff --git a/src/resources/colordb.h b/src/resources/colordb.h
index ade4227f8..27ca6173a 100644
--- a/src/resources/colordb.h
+++ b/src/resources/colordb.h
@@ -68,8 +68,6 @@ namespace ColorDB
*/
void unload();
- std::string &getHairColor(int id);
-
std::string &getHairColorName(int id);
int getHairSize();
diff --git a/src/resources/itemdb.cpp b/src/resources/itemdb.cpp
index 8d4cf8002..cf05a28f0 100644
--- a/src/resources/itemdb.cpp
+++ b/src/resources/itemdb.cpp
@@ -213,9 +213,20 @@ void ItemDB::load()
// std::string removeSprite = XML::getProperty(node, "removeSprite", "");
std::string colors;
if (serverVersion >= 1)
+ {
colors = XML::getProperty(node, "colors", "");
+
+ // check for empty hair palete
+ if (colors.empty() && id <= -1 && id > -100)
+ colors = "hair";
+ }
else
- colors = "";
+ {
+ if (id <= -1 && id > -100)
+ colors = "hair";
+ else
+ colors = "";
+ }
std::string tags[3];
tags[0] = XML::getProperty(node, "tag",
diff --git a/src/resources/iteminfo.h b/src/resources/iteminfo.h
index 9d1f94954..33727b136 100644
--- a/src/resources/iteminfo.h
+++ b/src/resources/iteminfo.h
@@ -244,7 +244,7 @@ class ItemInfo
SpriteToItemMap *getSpriteToItemReplaceMap(int directions) const;
- std::string getDyeString(int color) const;
+// std::string getDyeString(int color) const;
std::string getDyeColorsString(int color) const;