From 04847ef5f98d9a20a72286c44cc26302ec82dec5 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Fri, 19 Apr 2019 15:54:33 -0300 Subject: Added ability for multiple images to be imported as an atlas This adds support for groups in the import system, which point to a single file. Add property hint for saving files in file field --- editor/filesystem_dock.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'editor/filesystem_dock.cpp') diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp index c32cd1de50..aade606412 100644 --- a/editor/filesystem_dock.cpp +++ b/editor/filesystem_dock.cpp @@ -1257,6 +1257,10 @@ void FileSystemDock::_rename_operation_confirm() { return; } + if (EditorFileSystem::get_singleton()->is_group_file(old_path)) { + EditorFileSystem::get_singleton()->move_group_file(old_path, new_path); + } + //Present a more user friendly warning for name conflict DirAccess *da = DirAccess::create(DirAccess::ACCESS_RESOURCES); #if defined(WINDOWS_ENABLED) || defined(UWP_ENABLED) @@ -1354,6 +1358,16 @@ void FileSystemDock::_move_operation_confirm(const String &p_to_path, bool overw } } + //check groups + for (int i = 0; i < to_move.size(); i++) { + + print_line("is group: " + to_move[i].path + ": " + itos(EditorFileSystem::get_singleton()->is_group_file(to_move[i].path))); + if (to_move[i].is_file && EditorFileSystem::get_singleton()->is_group_file(to_move[i].path)) { + print_line("move to: " + p_to_path.plus_file(to_move[i].path.get_file())); + EditorFileSystem::get_singleton()->move_group_file(to_move[i].path, p_to_path.plus_file(to_move[i].path.get_file())); + } + } + Map file_renames; Map folder_renames; bool is_moved = false; -- cgit v1.2.3