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 EditorInterface.get_editor_main_control to get_editor_main_screen #65449

Conversation

YuriSizov
Copy link
Contributor

@YuriSizov YuriSizov commented Sep 6, 2022

So this rename, #44524, was a bad idea. The new name implies that this method returns some kind of main editor control, when in reality all it does is returns the control (or rather a VBoxContainer container) for hosting main screen plugins and tools.

The rename refers to the documentation statements, but the documentation is actually incorrect and very misleading. The rename also refers to the old rename tracker where this was brought up, but in that tracker the name main_control was never suggested. The options were main_container and main_screen, with the latter being the consensus.

So this PR re-renames the method to get_editor_main_screen, which is by far a better and more accurate name, with which both @Zylann and @aaronfranke agree. This name also matches the term we use in the EditorPlugin API. It also fixes the docs. And it fixes the conversion tool rule which was set up for a completely wrong method. I've also named the node for ease of debugging the editor.

PS. Tutorials in the online documentation also need updating, since the code there has been updated for 4.0 already (godotengine/godot-docs#5064).

editor/editor_node.cpp Outdated Show resolved Hide resolved
editor/editor_node.h Outdated Show resolved Hide resolved
@YuriSizov YuriSizov force-pushed the editor-main-control-screen-container-node branch from 8ab5ba2 to 1459507 Compare September 7, 2022 00:02
@YuriSizov
Copy link
Contributor Author

Done. Now the exact type is specified both internally and in the public API.

main_control->add_theme_constant_override("separation", 0);
scene_root_parent->add_child(main_control);
main_screen_vbox = memnew(VBoxContainer);
main_screen_vbox->set_name("MainScreen");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just wanted to say that I greatly appreciate giving editor nodes readable names 👍

@akien-mga akien-mga merged commit c115042 into godotengine:master Sep 7, 2022
@akien-mga
Copy link
Member

Thanks!

@YuriSizov YuriSizov deleted the editor-main-control-screen-container-node branch September 7, 2022 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants