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

Method parseSkin

Tools/SkinEditor/SkinExportSerializer.cpp:56–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54 }
55
56 void SkinExportSerializer::parseSkin(pugi::xml_node _node)
57 {
58 DataPtr data = Data::CreateInstance();
59 data->setType(DataTypeManager::getInstance().getType("Skin"));
60 data->setPropertyValue("Name", _node.attribute("name").value());
61 data->setPropertyValue("Texture", _node.attribute("texture").value());
62
63 DataManager::getInstance().getRoot()->addChild(data);
64
65 SkinDataUtility::CreateSkinData(data);
66 fillStateData(data, _node);
67
68 DataPtr state = getChildData(data, "State", "Normal");
69 std::string_view value;
70 if (state != nullptr)
71 value = state->getPropertyValue("Point");
72 MyGUI::IntPoint point = MyGUI::IntPoint::parse(value);
73 MyGUI::IntSize size = MyGUI::IntSize::parse(_node.attribute("size").value());
74
75 data->setPropertyValue("Size", MyGUI::IntCoord(point.left, point.top, size.width, size.height).print());
76
77 fillSeparatorData(data, _node);
78
79 MyGUI::IntRect separators = SkinDataUtility::getSeparatorsOffset(data);
80 SkinDataUtility::VectorCoord coords = SkinDataUtility::getRegions(size, separators);
81 SkinDataUtility::fillRegionCoords(data, coords);
82
83 SkinDataUtility::RectVisible visible = SkinDataUtility::getSeparatorsVisible(data);
84 SkinDataUtility::fillRegionEnable(data, visible);
85
86 fillRegionData(data, _node);
87 }
88
89 void SkinExportSerializer::writeSkin(pugi::xml_node _parent, DataPtr _data)
90 {

Callers

nothing calls this directly

Calls 10

parseFunction · 0.50
IntCoordFunction · 0.50
setTypeMethod · 0.45
getTypeMethod · 0.45
setPropertyValueMethod · 0.45
valueMethod · 0.45
attributeMethod · 0.45
addChildMethod · 0.45
getRootMethod · 0.45
printMethod · 0.45

Tested by

no test coverage detected