bool Menu::LoadElements(const std::string& path) { File f; if(!f.Open(path)) { ReportError("Menu elements path file not found: " + path + "\n"); } GUIElement* me = nullptr; std::string str; Vec2r pos, dimensions; while(!f.EndOf()) { if(!f.GetString(&str)) { ReportError("Menu loading error, Menu element name not found!"); continue; } me = TheGUIFactory::Instance()->Create(str); assert(me); me->Load(&f, this); m_elements.push_back(me); } return true; }