From 3f672307d709f42015c4603810f1b0870ac9f39d Mon Sep 17 00:00:00 2001 From: DualMatrix Date: Thu, 6 Sep 2018 23:33:44 +0200 Subject: Made editor automatically open scenes of built in scripts. Made editor automatically open scenes of built in scripts when attempting to open that script. --- editor/plugins/script_editor_plugin.cpp | 41 ++++++++++++--------------------- 1 file changed, 15 insertions(+), 26 deletions(-) diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index 70f1789a86..637e0ad487 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -59,25 +59,10 @@ void ScriptEditorBase::_bind_methods() { ADD_SIGNAL(MethodInfo("search_in_files_requested", PropertyInfo(Variant::STRING, "text"))); } -static bool _can_open_in_editor(Script *p_script) { - +static bool _is_built_in_script(Script *p_script) { String path = p_script->get_path(); - if (path.find("::") != -1) { - //refuse handling this if it can't be edited - - bool valid = false; - for (int i = 0; i < EditorNode::get_singleton()->get_editor_data().get_edited_scene_count(); i++) { - if (path.begins_with(EditorNode::get_singleton()->get_editor_data().get_scene_path(i))) { - valid = true; - break; - } - } - - return valid; - } - - return true; + return path.find("::") != -1; } class EditorScriptCodeCompletionCache : public ScriptCodeCompletionCache { @@ -2728,7 +2713,7 @@ void ScriptEditor::set_scene_root_script(Ref