-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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
Fix internal CONNECT_INHERITED
being saved in PackedScene & Make Local
#81737
Fix internal CONNECT_INHERITED
being saved in PackedScene & Make Local
#81737
Conversation
As a bit of a side note, there seems to be a regression from #81221 where the PopupMenu isn't updated properly, causing some options to be entirely disabled because of that early return. godot/editor/connections_dialog.cpp Lines 1193 to 1203 in 5f1e56f
Worth keeping that in mind when testing. |
I think it should be fixed first, because the popup is broken right now. |
Unsure how to handle this, then. "Sanitizing" the input when the scene is made local may make sense, but having it work seamlessly with UndoRedo looks to be overly verbose. Sanitizing it in |
I opened a PR about the aforementioned issue. #81750. Let's see. One thing at the time. |
58fbee2
to
a9c4bb9
Compare
a9c4bb9
to
0053211
Compare
This PR has been updated with an (admittedly) shoddy solution to prevent Local Scene from ever keeping CONNECT_INHERITED. The problem now is that I'm unsure how to go about using UndoRedo here, as dealing with the Node dock like this feels like unexplored territory. |
I apologise. This PR has been closed on accident because GitHub's links are silly like that. |
@@ -1077,6 +1078,8 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { | |||
undo_redo->add_do_method(node, "set_scene_file_path", ""); | |||
undo_redo->add_undo_method(node, "set_scene_file_path", node->get_scene_file_path()); | |||
_node_replace_owner(node, node, root); | |||
_node_strip_signal_inheritance(node); | |||
NodeDock::get_singleton()->set_node(node); // Refresh. |
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 wonder if there is better way to refresh it.
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 wondered too, but it didn't seem like it because all of the "refreshing" logic is inside the set_node
method. It would require moving it out...
Maybe NodeDock::restore_last_valid_node
would work just the same? In hindsight, I don't see why not.
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's probably fine for now, but if we ever decide to add early return to set_node()
it will stop working.
Though my biggest concern would be that this method is not used outside editor node, so either the dock is not refreshed by anything else or there is a better way.
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 was about to go with the change, but I'll keep set_node()
then. The lack of an early return is unexpected though, yeah.
The NodeDock has a pretty simple bunch of methods. None of them are like restore_last_valid_node()
or set_node()
, so they seem like the closest thing to a refresh?
I think your new method should be recursive. |
0053211
to
021d92f
Compare
Pushed to use make the connection stripping recursive. |
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 are still some problems (like undo not restoring the flag), but at least it fixes the issue, which is more important.
CONNECT_INHERITED
being saved in PackedScene & Make Local
Thanks! |
Fixes #75801.
The title is pretty self-explanatory.
Tested with the attached project. The issue fixes itself after resaving the scene.
It would be nice to receive feedback from KoBeWi because judging by the cause, it seems like I have a tendency to overlooking things.