From 6eb1c92ceacdc53e6a119ad0980231ea3c74466d Mon Sep 17 00:00:00 2001 From: kobewi Date: Wed, 8 Dec 2021 14:04:10 +0100 Subject: [PATCH] Fix custom built-in script names --- editor/plugins/script_text_editor.cpp | 2 +- editor/plugins/text_editor.cpp | 2 +- modules/visual_script/visual_script_editor.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp index bf37ed9d949..e4fc68fede2 100644 --- a/editor/plugins/script_text_editor.cpp +++ b/editor/plugins/script_text_editor.cpp @@ -528,7 +528,7 @@ String ScriptTextEditor::get_name() { if (name.empty()) { // This appears for newly created built-in scripts before saving the scene. name = TTR("[unsaved]"); - } else if (script->get_path().find("local://") == -1 && script->get_path().find("::") == -1) { + } else if (script->get_path().find("local://") == -1 || script->get_path().find("::") == -1) { const String &script_name = script->get_name(); if (script_name != "") { // If the built-in script has a custom resource name defined, diff --git a/editor/plugins/text_editor.cpp b/editor/plugins/text_editor.cpp index 345555bc8ef..a5381b3b1db 100644 --- a/editor/plugins/text_editor.cpp +++ b/editor/plugins/text_editor.cpp @@ -154,7 +154,7 @@ String TextEditor::get_name() { if (name.empty()) { // This appears for newly created built-in text_files before saving the scene. name = TTR("[unsaved]"); - } else if (text_file->get_path().find("local://") == -1 && text_file->get_path().find("::") == -1) { + } else if (text_file->get_path().find("local://") == -1 || text_file->get_path().find("::") == -1) { const String &text_file_name = text_file->get_name(); if (text_file_name != "") { // If the built-in text_file has a custom resource name defined, diff --git a/modules/visual_script/visual_script_editor.cpp b/modules/visual_script/visual_script_editor.cpp index ac1a34c6f52..23c593de0c8 100644 --- a/modules/visual_script/visual_script_editor.cpp +++ b/modules/visual_script/visual_script_editor.cpp @@ -2485,7 +2485,7 @@ String VisualScriptEditor::get_name() { if (name.empty()) { // This appears for newly created built-in scripts before saving the scene. name = TTR("[unsaved]"); - } else if (script->get_path().find("local://") == -1 && script->get_path().find("::") == -1) { + } else if (script->get_path().find("local://") == -1 || script->get_path().find("::") == -1) { const String &script_name = script->get_name(); if (script_name != "") { // If the built-in script has a custom resource name defined,