Load the previously loaded project and scene on startup

(read from an ini file)
This commit is contained in:
2023-01-14 21:44:48 +01:00
parent 145338d666
commit 282844b905
11 changed files with 85 additions and 49 deletions

View File

@ -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;
}
};
}