-
-
Notifications
You must be signed in to change notification settings - Fork 21.7k
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 Node.get_tree_string
and Node.get_tree_string_pretty
#77072
Conversation
I will soon resolve the conflicts |
get_tree_string()
to Node classget_tree_string()
to Node class
get_tree_string()
to Node classget_tree_string()
to Node class
fa7d9b8
to
9e68592
Compare
All conflicts are resolved! It's ready to be verified and merged! |
scene/main/node.cpp
Outdated
new_prefix = last ? String::utf8(" ") : String::utf8(" ┃ "); | ||
data.children_cache[i]->_print_tree_pretty(prefix + new_prefix, i == data.children_cache.size() - 1); | ||
return_tree += data.children[i]->_get_tree_string_pretty(prefix + new_prefix, i == data.children.size() - 1); |
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.
You need to use children_cache
as in the current source, children
is a HashMap
not a vector
When rebasing make sure to check the current state of the code to make sure you work with how it works currently, I would recommend rewriting your additions onto the current code to make sure you don't miss anything
String new_prefix = last ? String::utf8(" ┖╴") : String::utf8(" ┠╴"); | ||
print_line(prefix + new_prefix + String(get_name())); | ||
_update_children_cache(); |
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 line also has to be kept, and added to the other functions that examine the tree
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.
what other functions?
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.
_get_tree_string
in this case
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.
line 2153 only or both 2153 and 2152?
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.
Only the second, you have to update the children cache
You should have seen some of these when doing the rebase and resolving conflicts
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.
done, thanks
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 sorry I forgot something
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 sorry I forgot something
it depens
should I replace children by children_cache in all the 2 functions or only on these 2 lines?
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.
Look at the original code
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.
I think it's done
(actually compiling local)
Also I really recommend compiling the code locally to be able to do updates to documentation and test the functionality |
9e68592
to
247b460
Compare
scene/main/node.cpp
Outdated
for (uint32_t i = 0; i < data.children_cache.size(); i++) { | ||
String return_tree = ""; | ||
return_tree += prefix + new_prefix + String(get_name()) + "\n"; | ||
for (int i = 0; i < data.children.size(); i++) { |
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.
You're still using children here, see the code you're replacing, just keep the original line here to get it correct
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.
As I said above, I'd recommend restoring all the original code and then adding your changes again to avoid overwriting or ignoring important code
247b460
to
8c1a950
Compare
8c1a950
to
fe69ffb
Compare
fe69ffb
to
3105678
Compare
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.
Other than the wording in the documentation it looks good to me
3105678
to
5190ec9
Compare
Reviewed before membership, will re-review
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 save for the following
done |
(really) done |
get_tree_string()
to Node classNode.get_tree_string()
Node.get_tree_string()
Node.get_tree_string
and Node.get_tree_string_pretty
Could you please squash your commits into one? Make sure that the final commit has a short but descriptive message (the title of this PR is a good option). See this documentation, if you need help with squashing. |
4512a0c
to
5401524
Compare
I think it's ok |
It's squashed, but you still need to update the message. And it would also be a good idea to remove extra lines left from squashing from the commit's description:
|
how can I do that? |
|
You can use |
…to complement printing methods
5401524
to
bd575c5
Compare
is it better like this? |
Yep, it's fine now! |
sorry for asking, but can you estimate the time remaining until the PR is merged? I'm new (hello, New) and I have no idea on that |
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.
Juan approved ™
fuck |
I clicked the wrong button |
TvT |
@YuriSizov does the fact I deleted the branch affects the merge? |
@vPumpking Calm down! 🙃 It has been merged an hour ago, so you are free to delete your branch now. Also, thanks and congrats on your first merged PR! |
add
get_tree_string()
andget_tree_string_pretty
to Node classsee #73421 for details
get_tree_string()
andget_tree_string_pretty()
methods to Node to complement printing methods godot-proposals#6288.