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

Move editor class and plugin registrations to a dedicated file #60686

Merged
merged 1 commit into from
Nov 18, 2022

Conversation

trollodel
Copy link
Contributor

@trollodel trollodel commented May 1, 2022

Follow up of #60684.
Follow up of #58136. See this comment.

Move EditorNode::register_editor_types and EditorNode::register_editor_types to a dedicated file, like core, servers, and scene.
Move most editor plugin creation in register_editor_types and use EditorPlugins::add_by_type for registering it. This is the same method used by modules to register their plugins.
Note that I increased EditorPlugins::MAX_CREATE_FUNCS to 128 because this PR uses 56 EditorPlugins plugins slots out of 64, leaving only 6 slots for modules.

The new methods no longer are methods of EditorNode. For this reason, EditorNode::cleanup is created and called in unregister_editor_types.

This allows to change most plugins without recompiling the giant EditorNode.

@trollodel trollodel requested a review from a team as a code owner May 1, 2022 10:26
@Chaosus Chaosus added this to the 4.0 milestone May 1, 2022
@trollodel trollodel changed the title Move class and plugin registrations to a dedicated file Move editor class and plugin registrations to a dedicated file May 2, 2022
@trollodel trollodel force-pushed the move_editor_registration branch from 9c2145e to 5d721a7 Compare May 2, 2022 06:42
@trollodel trollodel force-pushed the move_editor_registration branch from 5d721a7 to 765efc1 Compare May 13, 2022 12:13
@trollodel trollodel force-pushed the move_editor_registration branch from 765efc1 to 8f8e948 Compare August 26, 2022 10:11
@trollodel trollodel force-pushed the move_editor_registration branch 2 times, most recently from 176e38b to 62ed393 Compare November 16, 2022 10:22
@trollodel trollodel force-pushed the move_editor_registration branch from 62ed393 to 7517745 Compare November 18, 2022 07:02
@akien-mga akien-mga merged commit a66fc4c into godotengine:master Nov 18, 2022
@akien-mga
Copy link
Member

Thanks!

@trollodel trollodel deleted the move_editor_registration branch November 18, 2022 22:56
@@ -7375,63 +7257,7 @@ EditorNode::EditorNode() {
raise_bottom_panel_item(AnimationPlayerEditor::get_singleton());

add_editor_plugin(VersionControlEditorPlugin::get_singleton());

// This list is alphabetized, and plugins that depend on Node2D are in their own section below.
add_editor_plugin(memnew(AnimationTreeEditorPlugin));
add_editor_plugin(memnew(AudioBusesEditorPlugin(audio_bus_editor)));
Copy link
Contributor

Choose a reason for hiding this comment

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

Why wasn't AudioBusesEditorPlugin moved?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Mostly because of the parameter. Also, the VS plugin (added above) was left there.

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.

4 participants