diff options
| author | Andreas Haas | 2017-08-15 22:21:53 +0200 |
|---|---|---|
| committer | GitHub | 2017-08-15 22:21:53 +0200 |
| commit | 2d0e7a521f4dee488f763929cea57c8888c2fb74 (patch) | |
| tree | e410359a3ef8c7fcf2fe9e20f0cac0e53e40e5e8 /editor/editor_file_system.cpp | |
| parent | 860816f3d3b8dda27c1f9774a08e0e0fc003a30f (diff) | |
| parent | 155402dc1b6b4e9113b0ffc737182ce1956efe97 (diff) | |
| download | godot-2d0e7a521f4dee488f763929cea57c8888c2fb74.tar.gz godot-2d0e7a521f4dee488f763929cea57c8888c2fb74.tar.zst godot-2d0e7a521f4dee488f763929cea57c8888c2fb74.zip | |
Diffstat (limited to 'editor/editor_file_system.cpp')
| -rw-r--r-- | editor/editor_file_system.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/editor/editor_file_system.cpp b/editor/editor_file_system.cpp index d873a55f6..2f4ac0270 100644 --- a/editor/editor_file_system.cpp +++ b/editor/editor_file_system.cpp @@ -339,6 +339,7 @@ bool EditorFileSystem::_update_scan_actions() { int idx = ia.dir->find_file_index(ia.file); ERR_CONTINUE(idx == -1); + _delete_internal_files(ia.dir->files[idx]->file); memdelete(ia.dir->files[idx]); ia.dir->files.remove(idx); @@ -838,6 +839,19 @@ void EditorFileSystem::_scan_fs_changes(EditorFileSystemDirectory *p_dir, const } } +void EditorFileSystem::_delete_internal_files(String p_file) { + if (FileAccess::exists(p_file + ".import")) { + List<String> paths; + ResourceFormatImporter::get_singleton()->get_internal_resource_path_list(p_file, &paths); + DirAccess *da = DirAccess::create(DirAccess::ACCESS_RESOURCES); + for (List<String>::Element *E = paths.front(); E; E = E->next()) { + da->remove(E->get()); + } + da->remove(p_file + ".import"); + memdelete(da); + } +} + void EditorFileSystem::_thread_func_sources(void *_userdata) { EditorFileSystem *efs = (EditorFileSystem *)_userdata; @@ -1192,6 +1206,7 @@ void EditorFileSystem::update_file(const String &p_file) { if (!FileAccess::exists(p_file)) { //was removed + _delete_internal_files(p_file); memdelete(fs->files[cpos]); fs->files.remove(cpos); call_deferred("emit_signal", "filesystem_changed"); //update later |
