-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Add a "callback" keyword #24320
Comments
Might be easy to do once #20318 is in place. |
More seriously, that's yet another use case that would be better with annotations instead of a keyword. |
I don't see how useful this would be. It only makes sense if you have a lot of functions and signals in the same script, at which point you might consider splitting the script into more dedicated libraries. It's also often the case that you have a function to connect to a specific signal so even if it shows up in such list you would only use it once. I'm also not fond of adding keywords to GDScript just to provide a help in the editor. If this becomes a thing then it should have a practical meaning in the language. For instance, we could make that only |
@vnen I agree with @akien-mga , they should be annotations, that can possibly be kicked out on export. I disagree with what you said about splitting in different libraries: if you take a look into a call function track interface, even the simplest Node (a bare node) has already 20-30 methods in the list. But, on the other hand, I am not sure how i would feel if i had to declare a function in my script only to forward a function to the editor. Maybe the functions not marked as export or callback could be folded, so still accessible but not crowding your screen. |
functions can already be used like callbacks, i'm confused |
Note the wording in the OP:
The idea is to make an editor-only aid, so as to not get flooded by functions such as |
Well, they are categorized so the script methods show first. You also might want to call those base functions of the Node, how to choose which ones can be called or not? I also think that usually you already know the function you want to call so you can just use the search (which is focused by default already). Besides that, I also fear that is a feature that will confuse users (does the function need to be a |
@vnen I see your point. I'd say then that the problems outweight the gain, so we can close this :) |
Godot version:
11d7738
Issue description:
Add a editor-specific keyword (similar to export or even export) for marking functions as callbacks, so that only callbacks show up when connecting a signal and making a function track in the animation player.
Related to #24316
The text was updated successfully, but these errors were encountered: