Open
Conversation
Member
|
See also (this doesn't fully close that as it's a broader topic): |
Member
|
If you only want to check if a node is internal, you can do something like: func is_internal(node: Node) -> bool:
var count := get_child_count()
if count == 0:
return true
var index := node.get_index(true)
if index < get_child(0).get_index(true):
return true
if index > get_child(get_child_count() - 1).get_index(true):
return true
return false |
timothyqiu
reviewed
Mar 30, 2024
Member
timothyqiu
left a comment
There was a problem hiding this comment.
The description of INTERNAL_MODE_* should also be updated accordingly. They were written for add_child() so "will" is used.
fb2bd1f to
f125808
Compare
zaevi
commented
Mar 30, 2024
| </constant> | ||
| <constant name="INTERNAL_MODE_DISABLED" value="0" enum="InternalMode"> | ||
| The node will not be internal. | ||
| The node is not internal. |
Contributor
Author
There was a problem hiding this comment.
Update the description of InternalMode as @timothyqiu suggested.
Mickeon
reviewed
Mar 30, 2024
| <method name="get_internal_mode" qualifiers="const"> | ||
| <return type="int" enum="Node.InternalMode" /> | ||
| <description> | ||
| Returns the node's internal mode. See [enum InternalMode]. |
Member
There was a problem hiding this comment.
Worth mentioning when this value is written to. You know as well as me it's in add_child()/add_sibling().
Contributor
Author
|
Sorry I deleted this branch accidently. Restored now |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Expose
Node::get_internal_mode()so that we can easily check if the child entered is a internal node: