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
This commit is contained in:
Anish 2018-02-21 14:41:01 +05:30
parent 5d6c64969c
commit 1fdb8251d2
1 changed files with 9 additions and 5 deletions

View File

@ -535,15 +535,19 @@ void ScriptCreateDialog::_update_dialog() {
/* Is Script created or loaded from existing file */ /* 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 // New Script Created
get_ok()->set_text(TTR("Create")); get_ok()->set_text(TTR("Create"));
parent_name->set_editable(true); parent_name->set_editable(true);
parent_browse_button->set_disabled(false); parent_browse_button->set_disabled(false);
internal->set_disabled(!supports_built_in); internal->set_disabled(!supports_built_in);
if (is_built_in) { if (is_path_valid) {
_msg_path_valid(true, TTR("Built-in script (into scene file)"));
} else if (is_path_valid) {
_msg_path_valid(true, TTR("Create new script file")); _msg_path_valid(true, TTR("Create new script file"));
} }
} else { } else {
@ -551,7 +555,7 @@ void ScriptCreateDialog::_update_dialog() {
get_ok()->set_text(TTR("Load")); get_ok()->set_text(TTR("Load"));
parent_name->set_editable(false); parent_name->set_editable(false);
parent_browse_button->set_disabled(true); parent_browse_button->set_disabled(true);
internal->set_disabled(true); internal->set_disabled(!supports_built_in);
if (is_path_valid) { if (is_path_valid) {
_msg_path_valid(true, TTR("Load existing script file")); _msg_path_valid(true, TTR("Load existing script file"));
} }