-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Remove most EditorNode constructor parameters and fields #57306
Remove most EditorNode constructor parameters and fields #57306
Conversation
926581f
to
c1da4c6
Compare
c1da4c6
to
05b56f3
Compare
I like the idea. I've actually be poking at improving some include dependencies in There's a handful of plugins changed in the above commit to forward declare |
Once I'll migrate editor classes to use EditorPlugin and I'll remove the EditorNode usages in "editor_plugin.h", most editor classes won't need to interact (directly) with EditorNode at all. |
Thanks! |
@@ -87,7 +87,6 @@ class AbstractPolygon2DEditor : public HBoxContainer { | |||
bool _polygon_editing_enabled; | |||
|
|||
CanvasItemEditor *canvas_item_editor; | |||
EditorNode *editor; |
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.
There is an unnecessary EditorNode forward declaration further up. If you are removing editor
variable, you should also remove all EditorNode
references that aren't necessary anymore. There might be some unused includes now too.
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.
Agree, but this is not the last cleanup PR I will do :)
There might be some unused includes now too.
Unused probably not. But some that can be moved to the .cpp? Surely yes!
I was still reviewing this .-. |
Follow up of #55066
Remove most EditorNode parameters and class attributes.
The only missing EditorNode references are:
EditorPlugins::add_by_type
(only in some modules).Any reference to the given parameter is gone, and they were renamed to
_p_editor
.EditorPlugins::creator
, because, is a more important change that deserves its PR.In some cases, I create local variables to shorten lines (since
EditorNode::get_singleton()
it's bigger thaneditor
).This PR has tons of changed files, Here's a summary of the changes to them:
make_visible
method (if it's a bottom panel plugin).EditorNode::add_bottom_panel_item
.p_editor
to_p_editor
.This PR increases the
EditorNode::get_singleton
usages, as expected.In many cases, it's possible to use the EditorPlugin methods instead (which use EditorNode, but that's an implementation detail).
It will be done in a follow-up PR.
EditorNode::get_singleton
usages in master (1894f3f):EditorNode::get_singleton
usages in this PR:CC @KoBeWi