Load the previously loaded project and scene on startup
(read from an ini file)
This commit is contained in:
@ -13,6 +13,15 @@ void Project::SaveProject(std::filesystem::path path, Project& project)
|
||||
projectYAML << YAML::Key << "Project" << YAML::Value << project.Name;
|
||||
projectYAML << YAML::Key << "Directory" << YAML::Value << path.parent_path().u8string();
|
||||
projectYAML << YAML::EndMap;
|
||||
projectYAML << YAML::BeginMap;
|
||||
|
||||
|
||||
projectYAML << YAML::Key << "Scenes" << YAML::Value << YAML::BeginSeq;
|
||||
for (auto scene : project.Scenes) {
|
||||
projectYAML << scene->name;
|
||||
}
|
||||
projectYAML << YAML::EndSeq;
|
||||
|
||||
std::ofstream projectFile;
|
||||
|
||||
projectFile.open(path.u8string());
|
||||
@ -56,10 +65,12 @@ namespace YAML {
|
||||
return false;
|
||||
rhs.setName(node["Project"].as<std::string>());
|
||||
rhs.setProjectDirectory(node["Directory"].as<std::string>());
|
||||
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
}
|
Reference in New Issue
Block a user