diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2023-10-26 08:57:01 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-10-26 08:57:01 +0200 |
commit | 9f20a4a3917bca1776e598d4c2e4344762e3f552 (patch) | |
tree | 35b1631cadda638756aab810daa78e3fa3167db1 /editor/scene_tree_dock.cpp | |
parent | 06d51891678e3abf360d6fcd2e8bd1ba96704fcc (diff) | |
parent | d12d955e68a38db4a8f2db8ecd715481596e3351 (diff) | |
download | redot-engine-9f20a4a3917bca1776e598d4c2e4344762e3f552.tar.gz |
Merge pull request #81510 from garychia/unedit_created_script
SceneTreeDock: Avoid changing the currently edited object when attaching a script
Diffstat (limited to 'editor/scene_tree_dock.cpp')
-rw-r--r-- | editor/scene_tree_dock.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp index 7968fdef55..9722f656f7 100644 --- a/editor/scene_tree_dock.cpp +++ b/editor/scene_tree_dock.cpp @@ -2167,8 +2167,13 @@ void SceneTreeDock::_script_created(Ref<Script> p_script) { } undo_redo->commit_action(); + // Avoid changing the currently edited object. + Object *edited_object = InspectorDock::get_inspector_singleton()->get_edited_object(); + _push_item(p_script.ptr()); _update_script_button(); + + InspectorDock::get_inspector_singleton()->edit(edited_object); } void SceneTreeDock::_shader_created(Ref<Shader> p_shader) { |