From 69f890ff11a15cc2c1aa651801a872505ab08c81 Mon Sep 17 00:00:00 2001 From: ne0fhyk Date: Fri, 10 Sep 2021 08:32:29 -0700 Subject: Provide a getter for the project data directory. --- editor/editor_file_system.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'editor/editor_file_system.cpp') diff --git a/editor/editor_file_system.cpp b/editor/editor_file_system.cpp index aa89a14725..5542d808d8 100644 --- a/editor/editor_file_system.cpp +++ b/editor/editor_file_system.cpp @@ -2147,6 +2147,10 @@ Error EditorFileSystem::_resource_import(const String &p_path) { } bool EditorFileSystem::_should_skip_directory(const String &p_path) { + if (p_path == ProjectSettings::get_singleton()->get_project_data_path()) { + return true; + } + if (FileAccess::exists(p_path.plus_file("project.godot"))) { // skip if another project inside this return true; @@ -2212,7 +2216,7 @@ void EditorFileSystem::move_group_file(const String &p_path, const String &p_new } ResourceUID::ID EditorFileSystem::_resource_saver_get_resource_id_for_path(const String &p_path, bool p_generate) { - if (!p_path.is_resource_file() || p_path.begins_with("res://.godot")) { + if (!p_path.is_resource_file() || p_path.begins_with(ProjectSettings::get_singleton()->get_project_data_path())) { //saved externally (configuration file) or internal file, do not assign an ID. return ResourceUID::INVALID_ID; } @@ -2270,17 +2274,18 @@ bool EditorFileSystem::_scan_extensions() { } } + String extension_list_config_file = NativeExtension::get_extension_list_config_file(); if (extensions.size()) { if (extensions_added.size() || extensions_removed.size()) { //extensions were added or removed - FileAccessRef f = FileAccess::open(NativeExtension::EXTENSION_LIST_CONFIG_FILE, FileAccess::WRITE); + FileAccessRef f = FileAccess::open(extension_list_config_file, FileAccess::WRITE); for (const String &E : extensions) { f->store_line(E); } } } else { - if (loaded_extensions.size() || FileAccess::exists(NativeExtension::EXTENSION_LIST_CONFIG_FILE)) { //extensions were removed + if (loaded_extensions.size() || FileAccess::exists(extension_list_config_file)) { //extensions were removed DirAccessRef da = DirAccess::create(DirAccess::ACCESS_RESOURCES); - da->remove(NativeExtension::EXTENSION_LIST_CONFIG_FILE); + da->remove(extension_list_config_file); } } -- cgit v1.2.3