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:
commit
9f20a4a391
1 changed files with 5 additions and 0 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue