-
-
Notifications
You must be signed in to change notification settings - Fork 21k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed drag and drop not respecting type on exported arrays. #50805
Fixed drag and drop not respecting type on exported arrays. #50805
Conversation
I'm not sure that's the right "See also"... |
Lol, fixed. Sometimes github throws a fit when trying to autocomplete issues numbers and it puts the wrong one in when I paste the number. |
c9b6d9c
to
e519ef3
Compare
Rebased & retested, still works as intended. |
// 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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure that subtype_hint_string
will always be a valid object type?
What about these for example:
scene/main/canvas_item.cpp
959: ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "material", PROPERTY_HINT_RESOURCE_TYPE, "CanvasItemMaterial,ShaderMaterial"), "set_material", "get_material");
scene/resources/environment.cpp
1358: ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "adjustment_color_correction", PROPERTY_HINT_RESOURCE_TYPE, "Texture2D,Texture3D"), "set_adjustment_color_correction", "get_adjustment_color_correction");
Or possible use of the weird 17/17:RichTextEffect
syntax (currently seen on Variant::ARRAY
but who knows..).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah so this is for the array editor, those appear to just be normal properties. The "Subtype" is the first number before the /
I believe, and at the moment that is only ever for Variant::OBJECT.
(currently 21
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like discussed before this should really be changed, but for now this resolves it, lol.
Thanks! |
See #50718
Before: drag and drop of invalid type was allowed, and also created empty value in array.
cWuoR4dhIw.mp4
After: drag and drop not allowed in the first place.
Rc3HX4Ljvd.mp4