Avoid changing the currently edited object when attaching a script
This commit is contained in:
parent
fc99492d30
commit
d12d955e68
@ -2089,8 +2089,13 @@ void SceneTreeDock::_script_created(Ref<Script> p_script) {
|
|||||||
}
|
}
|
||||||
undo_redo->commit_action();
|
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());
|
_push_item(p_script.ptr());
|
||||||
_update_script_button();
|
_update_script_button();
|
||||||
|
|
||||||
|
InspectorDock::get_inspector_singleton()->edit(edited_object);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SceneTreeDock::_shader_created(Ref<Shader> p_shader) {
|
void SceneTreeDock::_shader_created(Ref<Shader> p_shader) {
|
||||||
|
Loading…
Reference in New Issue
Block a user