Merge pull request #84284 from Haydoggo/script-switch

Preserve inspector focus when opening script from scene tree
This commit is contained in:
Rémi Verschelde 2024-01-04 16:39:59 +01:00
commit bb1006b2ac
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -1565,7 +1565,9 @@ void SceneTreeDock::_load_request(const String &p_path) {
} }
void SceneTreeDock::_script_open_request(const Ref<Script> &p_script) { void SceneTreeDock::_script_open_request(const Ref<Script> &p_script) {
EditorNode::get_singleton()->edit_resource(p_script); if (ScriptEditor::get_singleton()->edit(p_script, true)) {
EditorNode::get_singleton()->editor_select(EditorNode::EDITOR_SCRIPT);
}
} }
void SceneTreeDock::_push_item(Object *p_object) { void SceneTreeDock::_push_item(Object *p_object) {