Merge pull request #50805 from EricEzaM/fix-exported-arrays-drag-and-drop-types

This commit is contained in:
Rémi Verschelde 2021-10-01 16:17:57 +02:00 committed by GitHub
commit 93cb71cca9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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") {