-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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
Expose finding valid focus neighbors of a Control
by side
#76027
Conversation
Control
Control
by direction
Control
by directionControl
by side
2f6d461
to
ccf926f
Compare
There exists |
It's very similar, so will rename it as per my considered name |
ccf926f
to
0f1f11d
Compare
0f1f11d
to
5b5d157
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.
Looks fine, but we should probably better document the relation between this method and get_focus_neighbor
. They should be cross-linked with an appropriate note where and when to use each. Especially the behavior of the new method is worth explaining in more detail.
Will do! Unsure about the exact wording |
Exposes the functionality used for ui navigation
5b5d157
to
e70b83c
Compare
Not exactly sure about the wording but added some basic details |
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.
Seems ok to me.
@@ -526,6 +526,7 @@ class Control : public CanvasItem { | |||
|
|||
Control *find_next_valid_focus() const; | |||
Control *find_prev_valid_focus() const; | |||
Control *find_valid_focus_neighbor(Side p_size) const; |
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.
Oops 🙃
Control *find_valid_focus_neighbor(Side p_size) const; | |
Control *find_valid_focus_neighbor(Side p_side) const; |
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.
Oh dang 🙃
Exposes the functionality that is used for keyboard/joystick navigation to scripting, made it a constant function to match the other
find_
functionsNamed it
find_valid_focus_neighbor
asget_focus_neighbor
was already taken andfind_valid_
conveys the functionality better I feel and matchesfind_next_valid/prev_focus
,find_next_valid_focus_neighbor
feels a bit too long but think this is a good balanceCloses godotengine/godot-proposals#6690