| 87 | } |
| 88 | |
| 89 | void SkinExportSerializer::writeSkin(pugi::xml_node _parent, DataPtr _data) |
| 90 | { |
| 91 | pugi::xml_node node = _parent.append_child("Resource"); |
| 92 | node.append_attribute("type").set_value("ResourceSkin"); |
| 93 | node.append_attribute("name").set_value(_data->getPropertyValue("Name").c_str()); |
| 94 | node.append_attribute("size").set_value( |
| 95 | MyGUI::IntCoord::parse(_data->getPropertyValue("Size")).size().print().c_str()); |
| 96 | const std::string& textureName = _data->getPropertyValue("Texture"); |
| 97 | if (!textureName.empty()) |
| 98 | node.append_attribute("texture").set_value(textureName.c_str()); |
| 99 | |
| 100 | Data::VectorData childs = DataUtility::getChildsByType(_data, "Region", false); |
| 101 | sortByAlign(childs); |
| 102 | for (const auto& child : childs) |
| 103 | writeRegion(node, _data, child, false); |
| 104 | |
| 105 | childs = DataUtility::getChildsByType(_data, "RegionText", false); |
| 106 | for (const auto& child : childs) |
| 107 | writeRegion(node, _data, child, true); |
| 108 | } |
| 109 | |
| 110 | void SkinExportSerializer::writeRegion(pugi::xml_node _parent, DataPtr _parentData, DataPtr _data, bool _text) |
| 111 | { |