From 3f7e036c4fd6eaa49839a70932a3445412ff7304 Mon Sep 17 00:00:00 2001 From: Anish Date: Wed, 21 Feb 2018 14:41:01 +0530 Subject: [PATCH] Godot now allows built-in irrespective of the filepath. Since the file in the filepath is irrelevant when setting the file as built-in, changes have been made to allow setting to built-in even if the file in the path exists. Fixes #16425 (cherry picked from commit 1fdb8251d2d68634d8ba7ad4e9569742847df1df) --- editor/script_create_dialog.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/editor/script_create_dialog.cpp b/editor/script_create_dialog.cpp index cee356b930a..d0d6e82fc26 100644 --- a/editor/script_create_dialog.cpp +++ b/editor/script_create_dialog.cpp @@ -525,26 +525,28 @@ void ScriptCreateDialog::_update_dialog() { /* Is Script created or loaded from existing file */ - if (is_new_script_created) { + if (is_built_in) { + get_ok()->set_text(TTR("Create")); + parent_name->set_editable(true); + parent_browse_button->set_disabled(false); + internal->set_disabled(!supports_built_in); + _msg_path_valid(true, TTR("Built-in script (into scene file)")); + } else if (is_new_script_created) { // New Script Created get_ok()->set_text(TTR("Create")); parent_name->set_editable(true); parent_browse_button->set_disabled(false); internal->set_disabled(!supports_built_in); - if (is_built_in) { - _msg_path_valid(true, TTR("Built-in script (into scene file)")); - } else { - if (script_ok) { - _msg_path_valid(true, TTR("Create new script file")); - } + if (is_path_valid) { + _msg_path_valid(true, TTR("Create new script file")); } } else { // Script Loaded get_ok()->set_text(TTR("Load")); parent_name->set_editable(false); parent_browse_button->set_disabled(true); - internal->set_disabled(true); - if (script_ok) { + internal->set_disabled(!supports_built_in); + if (is_path_valid) { _msg_path_valid(true, TTR("Load existing script file")); } }