diff options
Diffstat (limited to 'editor/script_create_dialog.cpp')
| -rw-r--r-- | editor/script_create_dialog.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/editor/script_create_dialog.cpp b/editor/script_create_dialog.cpp index 3cab14b0c..25e63319d 100644 --- a/editor/script_create_dialog.cpp +++ b/editor/script_create_dialog.cpp @@ -331,6 +331,12 @@ void ScriptCreateDialog::_file_selected(const String &p_file) { } else { file_path->set_text(p); _path_changed(p); + + String filename = p.get_file().get_basename(); + int select_start = p.find_last(filename); + file_path->select(select_start, select_start + filename.length()); + file_path->set_cursor_position(select_start + filename.length()); + file_path->grab_focus(); } } @@ -459,7 +465,7 @@ void ScriptCreateDialog::_update_dialog() { script_ok = false; } } - if (has_named_classes && (!is_class_name_valid)) { + if (has_named_classes && (is_new_script_created && !is_class_name_valid)) { _msg_script_valid(false, TTR("Invalid class name")); script_ok = false; } |
