update voxel fragments lua api & replace structure.save command with fragment.save & add 'export' entry point

This commit is contained in:
MihailRis
2024-10-14 19:39:58 +03:00
parent cc6891dde8
commit fd2bd15658
9 changed files with 117 additions and 40 deletions
+8
View File
@@ -18,6 +18,7 @@ static inline auto SCREENSHOTS_FOLDER = std::filesystem::u8path("screenshots");
static inline auto CONTENT_FOLDER = std::filesystem::u8path("content");
static inline auto WORLDS_FOLDER = std::filesystem::u8path("worlds");
static inline auto CONFIG_FOLDER = std::filesystem::u8path("config");
static inline auto EXPORT_FOLDER = std::filesystem::u8path("export");
static inline auto CONTROLS_FILE = std::filesystem::u8path("controls.toml");
static inline auto SETTINGS_FILE = std::filesystem::u8path("settings.toml");
@@ -51,6 +52,10 @@ void EnginePaths::prepare() {
if (!fs::is_directory(contentFolder)) {
fs::create_directories(contentFolder);
}
auto exportFolder = userFilesFolder / EXPORT_FOLDER;
if (!fs::is_directory(exportFolder)) {
fs::create_directories(exportFolder);
}
}
std::filesystem::path EnginePaths::getUserFilesFolder() const {
@@ -187,6 +192,9 @@ std::filesystem::path EnginePaths::resolve(
if (prefix == "world") {
return currentWorldFolder / fs::u8path(filename);
}
if (prefix == "export") {
return userFilesFolder / EXPORT_FOLDER / fs::u8path(filename);
}
if (contentPacks) {
for (auto& pack : *contentPacks) {