summaryrefslogtreecommitdiff
path: root/src/resources/settingsmanager.cpp
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-03-04 16:29:14 +0100
committerThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-03-04 20:20:52 +0100
commit5c7f9d1d216fd1edca231ed274ac3077cb34909f (patch)
tree234405f8f9d0b422a02d8cc44854aaa6992cf2d9 /src/resources/settingsmanager.cpp
parentd5ebad4e74da011777f9ba1a13fbb37d18c827b9 (diff)
downloadmana-5c7f9d1d216fd1edca231ed274ac3077cb34909f.tar.gz
mana-5c7f9d1d216fd1edca231ed274ac3077cb34909f.tar.bz2
mana-5c7f9d1d216fd1edca231ed274ac3077cb34909f.tar.xz
mana-5c7f9d1d216fd1edca231ed274ac3077cb34909f.zip
Fixed character display
This change fixes hair style to take into account "race", which makes the faces visible again. Hair colors should also be fixed now, with partial support for itemcolors.xml added. The Mana client now also supports per-character gender, and it now hides the hair style and color buttons on character creation, when there are none to choose from. Closes #43
Diffstat (limited to 'src/resources/settingsmanager.cpp')
-rw-r--r--src/resources/settingsmanager.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/resources/settingsmanager.cpp b/src/resources/settingsmanager.cpp
index 28c08617..eceedcf4 100644
--- a/src/resources/settingsmanager.cpp
+++ b/src/resources/settingsmanager.cpp
@@ -68,7 +68,7 @@ namespace SettingsManager
loadFile("npcs.xml");
loadFile("emotes.xml");
loadFile("status-effects.xml");
- loadFile("hair.xml");
+ loadFile("itemcolors.xml");
loadFile("units.xml");
}
@@ -194,6 +194,20 @@ namespace SettingsManager
{
hairDB.readHairColorNode(childNode, filename);
}
+ else if (xmlStrEqual(childNode->name, BAD_CAST "list"))
+ {
+ // todo: consider if we need a "color DB", but in tmwa clientdata
+ // I only see hair colors in the itemcolors.xml file.
+ const std::string name = XML::getProperty(childNode, "name", std::string());
+ if (name == "hair")
+ {
+ for_each_xml_child_node(hairColorNode, childNode)
+ {
+ if (xmlStrEqual(hairColorNode->name, BAD_CAST "color"))
+ hairDB.readHairColorNode(hairColorNode, filename);
+ }
+ }
+ }
else if (xmlStrEqual(childNode->name, BAD_CAST "item"))
{
itemDb->readItemNode(childNode, filename);