-
-
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
Store panels and docks instances in their classes #55066
Store panels and docks instances in their classes #55066
Conversation
f6e3b8d
to
9b92278
Compare
NodeDock::~NodeDock() { | ||
singleton = nullptr; | ||
} |
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.
This could be in the header, like in other classes.
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.
Now that I checked more carefully, this case is the only one when I need to add a destructor and I add it into the cpp like the other destructors I modified to be consistent. However, I don't mind moving all the destructor I changed to the header.
Another thing that would be nice to do is unifying the usage of |
@KoBeWi definitely agree. In fact, this is only the first of some editor related cleanup PRs I want to do, and the EditorNode parameter thing is something I already noted. I waited to do more work because I was unsure if this is desired. |
tbh, it's better if you waited a bit longer, so the PR doesn't end like the previous one .-. I'll add a PR meeting label. |
We discussed this today in a PR review meeting and agreed with the change.
We also intend to cleanup |
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.
Should probably be rebased, then it should be good to merge if it's ready.
The |
9b92278
to
aa1102f
Compare
I didn't want to do massive, risky cleanup PRs for several reasons, including this one. So, I think it's better to start with low risks PRs like this one and the future editor parameter PR (so @KoBeWi is happy 😂). |
Yeah for sure. As long as there are people available to review low-impact and consensual changes, that's definitely fine. |
Thanks! |
@@ -1794,9 +1794,9 @@ void AnimationPlayerEditorPlugin::_notification(int p_what) { | |||
switch (p_what) { | |||
case NOTIFICATION_ENTER_TREE: { | |||
Node3DEditor::get_singleton()->connect("transform_key_request", callable_mp(this, &AnimationPlayerEditorPlugin::_transform_key_request)); | |||
editor->get_inspector()->connect("property_keyed", callable_mp(this, &AnimationPlayerEditorPlugin::_property_keyed)); | |||
InspectorDock::get_singleton()->connect("property_keyed", callable_mp(this, &AnimationPlayerEditorPlugin::_property_keyed)); |
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.
It caused bug, since editor->get_inspector()
and editor->get_inspector_dock()
is different.
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.
I probably missed it in the rebase. Thanks for the fix.
Based on the work in #47520
This is a cleanup PR that reduces a bit the editor code dependencies to EditorNode.
It moves all the panel and dock instances, currently stored in EditorNode in their classes as a singleton.
This is one approach (IMO the simplest). The other approach is to store the node instances in a dedicated class called EditorSingletons or something like that (closer to what I did in #47520).