1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-10 13:00:37 +00:00

Make the project data directory customizable.

This commit is contained in:
ne0fhyk
2021-09-10 08:32:29 -07:00
parent f930d54140
commit 3e44a6375e
7 changed files with 37 additions and 12 deletions

View File

@@ -200,6 +200,20 @@ EditorPaths::EditorPaths() {
paths_valid = false;
}
}
// Check that the project data directory '.gdignore' file exists
String project_data_gdignore_file_path = project_data_dir.plus_file(".gdignore");
if (!FileAccess::exists(project_data_gdignore_file_path)) {
// Add an empty .gdignore file to avoid scan.
FileAccessRef f = FileAccess::open(project_data_gdignore_file_path, FileAccess::WRITE);
if (f) {
f->store_line("");
f->close();
} else {
ERR_PRINT("Failed to create file " + project_data_gdignore_file_path);
}
}
Engine::get_singleton()->set_shader_cache_path(project_data_dir);
// Editor metadata dir.