MCPcopy Create free account
hub / github.com/MyGUI/mygui / writeSkin

Method writeSkin

Tools/SkinEditor/SkinExportSerializer.cpp:89–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers 1

generateSkinMethod · 0.80

Calls 8

parseFunction · 0.50
append_childMethod · 0.45
set_valueMethod · 0.45
append_attributeMethod · 0.45
c_strMethod · 0.45
printMethod · 0.45
sizeMethod · 0.45
emptyMethod · 0.45

Tested by 1

generateSkinMethod · 0.64