bool HierarchyTreePlatformNode::Load(YamlNode* platform) { YamlNode* width = platform->Get(WIDTH_NODE); YamlNode* height = platform->Get(HEIGHT_NODE); if (!width || !height) return false; bool result = true; SetSize(width->AsInt(), height->AsInt()); ActivatePlatform(); YamlNode* screens = platform->Get(SCREENS_NODE); if (screens) { for (int i = 0; i < screens->GetCount(); i++) { YamlNode* screen = screens->Get(i); if (!screen) continue; String screenName = screen->AsString(); QString screenPath = QString(SCREEN_PATH).arg(GetResourceFolder()).arg(QString::fromStdString(screenName)); HierarchyTreeScreenNode* screenNode = new HierarchyTreeScreenNode(this, QString::fromStdString(screenName)); result &= screenNode->Load(screenPath); AddTreeNode(screenNode); } } return result; }