-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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
GDScript: Add @export_custom
annotation
#72912
GDScript: Add @export_custom
annotation
#72912
Conversation
Looks good. But, it seems to me that |
I'll leave this on hold for now since it won't be merged for 4.0. I'm open to suggestions about the substitution syntax and what values are needed. |
I do prefer |
At first I was thinking on some array hints that require the element type on the hint string. But later I reconsidered as that might not really come from the variable type (unless there's a substitution for the element type). I'll probably remove the substitutions once I revisit this. This also comes because IINM the |
Just discovered this PR and felt stupid. As this was possible in 3.x and not in 4.x i thought it was a choice to reduce what was possible to do with exports. So I had made my own solution that i have been maintaining. I cleaned it a bit and published it here. For reference I was using it to create Inspector plugins as it is easy to set up an inspector plugin with it and it makes really clear code on the script side |
Postponed to 4.3 due to feature freeze. |
80aeb3c
to
5e248a9
Compare
I rebased this and removed the template substitutions. If they're needed we can find a good way to add them later. |
Should we allow specifying usage as well? Everything else from property's metadata can be defined by other means (name, type, class), but usage cannot. |
I guess it does make sense to specify the usage too. |
@export_custom
annotation
I think it's a nice addition. I also support the idea to allow specifying the usage flags. |
Note that users may accidentally remove |
@dalexeev I think they should behave exactly as properties added dynamically with |
@vnen Do you plan to work on this soon? 🙃 |
5e248a9
to
298087a
Compare
Added the usage flags. |
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.
Looks good to me. Needs a rebase.
Allows setting any arbitrary hint, hint string, and usage flags. Useful for more complex hints or potential future hints not available as a dedicated annotation.
298087a
to
8e52045
Compare
Updated to apply the suggestions and fix conflicts. |
Thanks! |
Is there any reason not to allow overriding |
For the same reason as |
Allows setting any arbitrary hint and hint string. Useful for more complex hints or potential future hints not available as a dedicated annotation.
Closes #61325
Supersedes #65935
Relates to #82122
Production edit: added relates to #82122