-
-
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
Enhancements to signal definition #24013
Comments
AFAIK you are always specifying the number of arguments, just that in the empty case the number is 0.
I've purposefully omitted for the sake of limiting the feature-set in this initial implementation. Adding types in signals means that there should type-checking somewhere, and I'm not sure how to deal with that yet. It's probably needed to do runtime-checks since it's not always possible to detect the functions connected to a signal. I do plan to eventually tackle this though. |
You can declare some_signal and then do emit_signal("some_signal", arg1, arg2) that will compile and work |
Oh, this a problem with |
@vnen I imagine this breaking tons of scripts if it gets fixed |
So should be left for 4.0? |
Closing in favor of godotengine/godot-proposals#2557, as feature proposals are now tracked on the Godot proposals repository. |
Godot version:
custom 3.1 11d7738
Enhancement 1
It is currently possible to define a signal without specifying the signature of if (and by signature i mean the list of arguments)
In my experience having an argument list for a signal makes the overall code more readable and less prone to errors.
I would also like to add that the signal is not fired properly if there is a mismatch with the arguments it is emitted with and the arguments that are expected by a function connected to it, but this is not reflected in the signal definition (no need to specify the number of parameters)
Enhancement 2
It is not possible to define types of the signal arguments, which would be nice for readability.
The text was updated successfully, but these errors were encountered: