Skip to content

Commit

Permalink
Merge pull request #81510 from garychia/unedit_created_script
Browse files Browse the repository at this point in the history
SceneTreeDock: Avoid changing the currently edited object when attaching a script
  • Loading branch information
akien-mga committed Oct 26, 2023
2 parents 06d5189 + d12d955 commit 9f20a4a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions editor/scene_tree_dock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 9f20a4a

Please sign in to comment.