diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-10-01 16:17:57 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-01 16:17:57 +0200 |
commit | 93cb71cca950dc8a52b6c669b8a6ea699a9fc7f0 (patch) | |
tree | 8c604ee9b86655c9aa36c54c7cd09d08ff776fb1 | |
parent | 928c002f223b67bd6fd1c55d65e37a6d5c4e3a94 (diff) | |
parent | e519ef31f28622ff47d5fcb4f0d67f0de94903c2 (diff) |
Merge pull request #50805 from EricEzaM/fix-exported-arrays-drag-and-drop-types
-rw-r--r-- | editor/editor_properties_array_dict.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/editor/editor_properties_array_dict.cpp b/editor/editor_properties_array_dict.cpp index 9cecb62c66..9b5dc8851c 100644 --- a/editor/editor_properties_array_dict.cpp +++ b/editor/editor_properties_array_dict.cpp @@ -429,6 +429,12 @@ void EditorPropertyArray::_button_draw() { bool EditorPropertyArray::_is_drop_valid(const Dictionary &p_drag_data) const { String allowed_type = Variant::get_type_name(subtype); + // When the subtype is of type Object, an additional subtype may be specified in the hint string + // (e.g. Resource, Texture2D, ShaderMaterial, etc). We want the allowed type to be that, not just "Object". + if (subtype == Variant::OBJECT && subtype_hint_string != "") { + allowed_type = subtype_hint_string; + } + Dictionary drag_data = p_drag_data; if (drag_data.has("type") && String(drag_data["type"]) == "files") { |