diff options
Diffstat (limited to 'editor/filesystem_dock.cpp')
| -rw-r--r-- | editor/filesystem_dock.cpp | 44 |
1 files changed, 20 insertions, 24 deletions
diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp index a47bbd321d..224f4c2041 100644 --- a/editor/filesystem_dock.cpp +++ b/editor/filesystem_dock.cpp @@ -47,7 +47,7 @@ #include "editor/editor_string_names.h" #include "editor/gui/editor_dir_dialog.h" #include "editor/gui/editor_scene_tabs.h" -#include "editor/import/resource_importer_scene.h" +#include "editor/import/scene_import_settings.h" #include "editor/import_dock.h" #include "editor/plugins/editor_resource_tooltip_plugins.h" #include "editor/scene_create_dialog.h" @@ -756,6 +756,14 @@ void FileSystemDock::_navigate_to_path(const String &p_path, bool p_select_in_fa void FileSystemDock::navigate_to_path(const String &p_path) { file_list_search_box->clear(); _navigate_to_path(p_path); + + // Ensure that the FileSystem dock is visible. + if (get_window() == get_tree()->get_root()) { + TabContainer *tab_container = (TabContainer *)get_parent_control(); + tab_container->set_current_tab(tab_container->get_tab_idx_from_control((Control *)this)); + } else { + get_window()->grab_focus(); + } } void FileSystemDock::_file_list_thumbnail_done(const String &p_path, const Ref<Texture2D> &p_preview, const Ref<Texture2D> &p_small_preview, const Variant &p_udata) { @@ -1192,32 +1200,12 @@ void FileSystemDock::_select_file(const String &p_path, bool p_select_in_favorit String resource_type = ResourceLoader::get_resource_type(fpath); - if (resource_type == "PackedScene") { - bool is_imported = false; - - { - List<String> importer_exts; - ResourceImporterScene::get_scene_singleton()->get_recognized_extensions(&importer_exts); - String extension = fpath.get_extension(); - for (const String &E : importer_exts) { - if (extension.nocasecmp_to(E) == 0) { - is_imported = true; - break; - } - } - } - - if (is_imported) { - ResourceImporterScene::get_scene_singleton()->show_advanced_options(fpath); - } else { - EditorNode::get_singleton()->open_request(fpath); - } - } else if (resource_type == "AnimationLibrary") { + if (resource_type == "PackedScene" || resource_type == "AnimationLibrary") { bool is_imported = false; { List<String> importer_exts; - ResourceImporterScene::get_animation_singleton()->get_recognized_extensions(&importer_exts); + ResourceImporterScene::get_scene_importer_extensions(&importer_exts); String extension = fpath.get_extension(); for (const String &E : importer_exts) { if (extension.nocasecmp_to(E) == 0) { @@ -1228,7 +1216,7 @@ void FileSystemDock::_select_file(const String &p_path, bool p_select_in_favorit } if (is_imported) { - ResourceImporterScene::get_animation_singleton()->show_advanced_options(fpath); + SceneImportSettingsDialog::get_singleton()->open_settings(p_path, resource_type == "AnimationLibrary"); } else { EditorNode::get_singleton()->open_request(fpath); } @@ -3484,6 +3472,14 @@ void FileSystemDock::_file_sort_popup(int p_id) { set_file_sort((FileSortOption)p_id); } +const HashMap<String, Color> &FileSystemDock::get_folder_colors() const { + return folder_colors; +} + +Dictionary FileSystemDock::get_assigned_folder_colors() const { + return assigned_folder_colors; +} + MenuButton *FileSystemDock::_create_file_menu_button() { MenuButton *button = memnew(MenuButton); button->set_flat(true); |
