-
-
Notifications
You must be signed in to change notification settings - Fork 20.9k
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
Improve area/body_shape_entered/exited signals parameter names and doc #53054
Conversation
Hey! Thanks for contributing.
|
8f02676
to
7ecf3c9
Compare
Sure, squashing is done. |
Thanks for the squash and fixup!
It is IMO unlikely to be backported to 3.x as all these changes break compatability by changing method argument names, which we generally try to avoid in minor releases AFAIK. (This PR is somewhat relevant to #16863) |
Alright, thanks for the feedback. I'm surprised that the name of arguments is considered to be part of the signature. Languages usually only work by position, unless they have named arguments. I mean, I can change the parameter name of a signal's function and everything seems to still work. Anwyays, it's very minimal so probably not worth the time for the possible merge conflicts |
No, thats actually a good point - I spent too much time with Python recently, where this is more of a concern. :) I'll add a backport request label for now optimistically, let's see if someone disagrees :P |
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 great, thanks!
Just left a comment for a minor improvement in the documentation, otherwise it should be good to go.
Also, some class names have changed on master, so we won't be able to cherry-pick the commit directly. Feel free to open a separate PR with the equivalent changes on the 3.x branch. |
3c7c07c
to
ca33ceb
Compare
Added the change and squashed everything together |
@MaxLap Thanks! My comment was probably not clear enough, but I meant to suggest the same change for all the occurences of |
ca33ceb
to
54390da
Compare
Lol, my bad. Your comment was perfectly fine and I understood it, but I forgot in 5 seconds. Not my proudest moment xD Done. Changed all "actual node" this time :) |
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.
No worries :) I've added comments on a few last things to fix before merging.
Fix some typoed names from the doc Add _index to "index" parameters of *_shape_* signals, this is both in doc and in the template. This makes the code, signature and doc easier to understand Add method to get Node from the _index params of those signals. This was not as easy to find as one would expect. Putting this information where it is needed will help.
54390da
to
b66fdb8
Compare
Good catches. Fixed the 3D and the missing "node". |
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 all good!
Congrats on your first merged PR! Please let me know if you're up for doing the 3.x version, otherwise I can take care of it. |
I can do it tomorrow. Is there any diff other than |
Thanks! Some file names are also different, but I think that should be it. |
Here is the PR for 3.x: #53848 |
This is improving the documentation (and, I believe, the signal templates) for these signals:
Here are the improvements, I made a separate commit per improvement:
body_id
orarea_id
instead of the_rid
that is written elsewhere_index
suffix to thebody_shape
,area_shape
andlocal_shape
parameters. This has 2 benefits:var body_shape: Node = body.shape_owner_get_owner(body_shape_index)
. Before,body_shape
would have been taken by theint
parameter._index
arguments.It took me a while to find it when I needed it, and when I did, I wasn't sure if that was valid for more recent Godot versions until I tried it.
All of those changes would also be great improvements for Godot 3.3 documentation (and maybe farther back, but I am not familiar with older versions)