File tree Expand file tree Collapse file tree 3 files changed +15
-1
lines changed
Expand file tree Collapse file tree 3 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -5844,7 +5844,11 @@ PopupMenu *EditorNode::get_export_as_menu() {
58445844}
58455845
58465846void EditorNode::_dropped_files (const Vector<String> &p_files) {
5847- String to_path = ProjectSettings::get_singleton ()->globalize_path (FileSystemDock::get_singleton ()->get_current_directory ());
5847+ String to_path = FileSystemDock::get_singleton ()->get_folder_path_at_mouse_position ();
5848+ if (to_path.is_empty ()) {
5849+ to_path = FileSystemDock::get_singleton ()->get_current_directory ();
5850+ }
5851+ to_path = ProjectSettings::get_singleton ()->globalize_path (to_path);
58485852
58495853 _add_dropped_files_recursive (p_files, to_path);
58505854
Original file line number Diff line number Diff line change @@ -2799,6 +2799,15 @@ void FileSystemDock::remove_resource_tooltip_plugin(const Ref<EditorResourceTool
27992799 tooltip_plugins.remove_at (index);
28002800}
28012801
2802+ String FileSystemDock::get_folder_path_at_mouse_position () const {
2803+ TreeItem *item = tree->get_item_at_position (tree->get_local_mouse_position ());
2804+ if (!item) {
2805+ return String ();
2806+ }
2807+ String fpath = item->get_metadata (0 );
2808+ return fpath.get_base_dir ();
2809+ }
2810+
28022811Control *FileSystemDock::create_tooltip_for_path (const String &p_path) const {
28032812 if (p_path == " Favorites" ) {
28042813 // No tooltip for the "Favorites" group.
Original file line number Diff line number Diff line change @@ -381,6 +381,7 @@ class FileSystemDock : public VBoxContainer {
381381
382382 String get_current_path () const ;
383383 String get_current_directory () const ;
384+ String get_folder_path_at_mouse_position () const ;
384385
385386 void navigate_to_path (const String &p_path);
386387 void focus_on_path ();
You can’t perform that action at this time.
0 commit comments