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

Method deserialization

MyGUIEngine/src/MyGUI_ResourceSkin.cpp:22–188  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20 }
21
22 void ResourceSkin::deserialization(xml::ElementPtr _node, Version _version)
23 {
24 Base::deserialization(_node, _version);
25
26 const std::string& stateCategory = SubWidgetManager::getInstance().getStateCategoryName();
27
28 // парсим атрибуты скина
29 std::string name;
30 std::string texture;
31 std::string tmp;
32 IntSize size;
33 _node->findAttribute("name", name);
34 _node->findAttribute("texture", texture);
35 if (_node->findAttribute("size", tmp))
36 size = IntSize::parse(tmp);
37
38 LanguageManager& localizator = LanguageManager::getInstance();
39
40 // вспомогательный класс для биндинга сабскинов
41 SubWidgetBinding bind;
42
43 // tags replacement support for Skins
44 if (_version >= Version(1, 1))
45 {
46 texture = localizator.replaceTags(texture);
47 }
48
49 setInfo(size, texture);
50
51 // проверяем маску
52 if (_node->findAttribute("mask", tmp))
53 addProperty("MaskPick", tmp);
54
55 // берем детей и крутимся, цикл с саб скинами
56 xml::ElementEnumerator basis = _node->getElementEnumerator();
57 while (basis.next())
58 {
59 if (basis->getName() == "Property")
60 {
61 // загружаем свойства
62 std::string key;
63 std::string value;
64 if (!basis->findAttribute("key", key))
65 continue;
66 if (!basis->findAttribute("value", value))
67 continue;
68
69 // tags replacement support for Skins
70 if (_version >= Version(1, 1))
71 {
72 value = localizator.replaceTags(value);
73 }
74
75 // добавляем свойство
76 addProperty(key, value);
77 }
78 else if (basis->getName() == "Child")
79 {

Callers

nothing calls this directly

Calls 12

addPropertyFunction · 0.85
findAttributeMethod · 0.80
replaceTagsMethod · 0.80
getElementEnumeratorMethod · 0.80
addParamMethod · 0.80
deserializationFunction · 0.50
parseFunction · 0.50
nextMethod · 0.45
createMethod · 0.45
createObjectMethod · 0.45
currentMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected