Merge pull request #28920 from hmumm/dragging-directory-adds-it-to-script

Directories can now be dragged into the script editor
This commit is contained in:
Max Hilbrunner 2019-05-17 19:51:18 +02:00 committed by GitHub
commit 580b0c651d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -1266,7 +1266,8 @@ bool ScriptTextEditor::can_drop_data_fw(const Point2 &p_point, const Variant &p_
Dictionary d = p_data; Dictionary d = p_data;
if (d.has("type") && (String(d["type"]) == "resource" || if (d.has("type") && (String(d["type"]) == "resource" ||
String(d["type"]) == "files" || String(d["type"]) == "files" ||
String(d["type"]) == "nodes")) { String(d["type"]) == "nodes" ||
String(d["type"]) == "files_and_dirs")) {
return true; return true;
} }
@ -1328,7 +1329,7 @@ void ScriptTextEditor::drop_data_fw(const Point2 &p_point, const Variant &p_data
te->insert_text_at_cursor(res->get_path()); te->insert_text_at_cursor(res->get_path());
} }
if (d.has("type") && String(d["type"]) == "files") { if (d.has("type") && (String(d["type"]) == "files" || String(d["type"]) == "files_and_dirs")) {
Array files = d["files"]; Array files = d["files"];