summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-04-04 09:38:33 +0200
committerGitHub <noreply@github.com>2022-04-04 09:38:33 +0200
commit91d617718717d0ff1f00b477b8a128b694476756 (patch)
tree06f4efdb92f3102c36f7bc055b96851179ccbcd6
parent72b8aeb45c8e5be75f0094e8500849e322ad1506 (diff)
parent1062bc9884d27a1412e2cde1ca054dc10e0a1b72 (diff)
Merge pull request #59819 from YeldhamDev/fixing_the_thing_nobody_uses
Fix creation and reopening of built-in scripts
-rw-r--r--editor/plugins/script_editor_plugin.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp
index bbaf2bef98..677b55bb88 100644
--- a/editor/plugins/script_editor_plugin.cpp
+++ b/editor/plugins/script_editor_plugin.cpp
@@ -1232,9 +1232,6 @@ void ScriptEditor::_menu_option(int p_option) {
if (ResourceLoader::get_resource_type(res_path) == "PackedScene") {
if (!EditorNode::get_singleton()->is_scene_open(res_path)) {
EditorNode::get_singleton()->load_scene(res_path);
- script_editor->call_deferred(SNAME("_menu_option"), p_option);
- previous_scripts.push_back(path); //repeat the operation
- return;
}
} else {
EditorNode::get_singleton()->load_resource(res_path);
@@ -1250,7 +1247,6 @@ void ScriptEditor::_menu_option(int p_option) {
edit(scr);
file_dialog_option = -1;
- return;
} else {
Error error;
Ref<TextFile> text_file = _load_text_file(path, &error);
@@ -1261,7 +1257,6 @@ void ScriptEditor::_menu_option(int p_option) {
if (text_file.is_valid()) {
edit(text_file);
file_dialog_option = -1;
- return;
}
}
} break;
@@ -3960,7 +3955,7 @@ void ScriptEditorPlugin::edit(Object *p_object) {
Script *p_script = Object::cast_to<Script>(p_object);
String res_path = p_script->get_path().get_slice("::", 0);
- if (p_script->is_built_in()) {
+ if (p_script->is_built_in() && !res_path.is_empty()) {
if (ResourceLoader::get_resource_type(res_path) == "PackedScene") {
if (!EditorNode::get_singleton()->is_scene_open(res_path)) {
EditorNode::get_singleton()->load_scene(res_path);