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

SceneTreeDock: Avoid changing the currently edited object when attaching a script #81510

Merged
merged 1 commit into from
Oct 26, 2023

Conversation

garychia
Copy link
Contributor

Fixes #81323

Copy link
Member

@KoBeWi KoBeWi left a comment

Choose a reason for hiding this comment

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

tbh I sometimes rely on this behavior when I forget to name the script, but I get why it can be annoying.

btw Detach Script has the same problem, although there it's explicitly coded for some unexplained reason.

undo_redo->add_do_method(EditorNode::get_singleton(), "push_item", (Script *)nullptr);

@akien-mga
Copy link
Member

btw Detach Script has the same problem, although there it's explicitly coded for some unexplained reason.

Should this be handled in this PR too?

@KoBeWi
Copy link
Member

KoBeWi commented Oct 23, 2023

It can be done in this PR too, it's just one line removal.

The line ensures that the script does not stay in the inspector (which might make sense given the current attach behavior), not sure if it did anything else.

@akien-mga
Copy link
Member

Let's merge this one for now as we're not sure whether the other removal would always be wanted.

@akien-mga akien-mga merged commit 9f20a4a into godotengine:master Oct 26, 2023
@akien-mga
Copy link
Member

Thanks!

@garychia garychia deleted the unedit_created_script branch October 27, 2023 02:10
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.

Attaching a script to a node make the inspector inspect the script instead of the selected node
4 participants