Merge pull request #81510 from garychia/unedit_created_script

SceneTreeDock: Avoid changing the currently edited object when attaching a script
This commit is contained in:
Rémi Verschelde 2023-10-26 08:57:01 +02:00
commit 9f20a4a391
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -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) {