Skip to content
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

Rename Node's is_node_ready() to is_ready(), and RichTextLabel's is_ready() to something else #6858

Open
L4Vo5 opened this issue May 11, 2023 · 2 comments
Labels
breaks compat Proposal will inevitably break compatibility topic:core
Milestone

Comments

@L4Vo5
Copy link

L4Vo5 commented May 11, 2023

Describe the project you are working on

Nodes with setters on exported variables which cause effects on children nodes. to avoid errors, if the node isn't ready yet, the setters either await ready or return before messing with the children.

Describe the problem or limitation you are having in your project

godotengine/godot#75751 added is_ready to the Node class, but it had to be exposed as is_node_ready() because it collides with RichTextLabel's function with the same name.
is_node_ready(), which my code already uses in several places, is more cumbersome to type and read than simply is_ready().
Meanwhile, I've never used RichTextLabel's is_ready function, and conceptually it's not as attached to the name being specifically "is ready" as the Node function is.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Change the Node function's name to is_ready, and the RichTextLabel's function to something else.
I'm not familiar with the RichTextLabel class so I don't personally know or care what name would be appropiate. Akien suggested is_done_processing.
This change would break compatibility as it renames two functions. I'm making the suggestion now so it's there for when that can happen.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

I think all it'd take is renaming the bound method names for both Node::is_ready() in node.cpp and RichTextLabel::is_ready() in rich_text_label.cpp.

If this enhancement will not be used often, can it be worked around with a few lines of script?

It'll be used just as often as the function is used.
You could add func is_ready(): return is_node_ready() in every single node script that you want to use it in, but manual renames like that aren't worth it.

Is there a reason why this should be core and not an add-on in the asset library?

It's a rename. Even if it was possible, a compatibility-breaking addon could break other addons.

@L4Vo5 L4Vo5 changed the title Rename Node's is_node_ready() to is_ready(),a nd RichTextLabel's is_ready() to something else Rename Node's is_node_ready() to is_ready(), and RichTextLabel's is_ready() to something else May 11, 2023
@Calinou Calinou added topic:core breaks compat Proposal will inevitably break compatibility labels May 11, 2023
@Mickeon
Copy link

Mickeon commented Jul 4, 2024

I suggest RichTextLabel.is_finished() to match the existing finished signal, which is emitted when all text finished loading.

While this would break compatibility, deprecating the existing is_ready in favour of a newer name would be fine even as of writing this, and would probably be a good choice.

@Mickeon
Copy link

Mickeon commented Aug 26, 2024

Adding this to 5.0's milestone to keep it in mind when compatibility breakage is allowed. Given that the stepping stone has been merged, this seems to be right way forward.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaks compat Proposal will inevitably break compatibility topic:core
Projects
None yet
Development

No branches or pull requests

3 participants