-
-
Notifications
You must be signed in to change notification settings - Fork 21.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
Add NodePath::slice
method
#81822
Add NodePath::slice
method
#81822
Conversation
033a8e0
to
30db713
Compare
PS: I'd love if someone could double check my index gymnastics. I tried to be pretty comprehensive with my test cases and was able to catch a few errors that way, but it never hurts to have another pair of eyes. In particular, if anyone can think of a way to make the logic a bit simpler, I'd be very grateful :) |
30db713
to
7c61a57
Compare
7c61a57
to
d996b9e
Compare
NodePath::slice
method
d996b9e
to
589038f
Compare
Maybe add a |
Were you thinking of adding this as an exposed method or just for internal use? |
Initially as just a c++ one, unless also adding a way to access any of the names, surnames or otherwise, with one operation, for convenience |
589038f
to
cd221c1
Compare
That's not a bad idea and might simplify some of the existing code. That said, I think I'll leave that to a different PR. I've added a |
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.
This looks good to me, it covers my use cases well with slice(0, x)
, and I think it's a good addition to NodePath.
Thanks! |
Added
slice(begin : int, end : int = INT_MAX)
toNodePath
.Example usage:
Closes godotengine/godot-proposals#7148.
Supersedes #78638.