You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-09 12:50:35 +00:00
Add contains_char() for single-character 'contains' calls.
This commit is contained in:
@@ -67,8 +67,8 @@ String DirectoryCreateDialog::_validate_path(const String &p_path) const {
|
||||
return TTR("Folder name cannot be empty.");
|
||||
}
|
||||
}
|
||||
if (part.contains("\\") || part.contains(":") || part.contains("*") ||
|
||||
part.contains("|") || part.contains(">") || part.ends_with(".") || part.ends_with(" ")) {
|
||||
if (part.contains_char('\\') || part.contains_char(':') || part.contains_char('*') ||
|
||||
part.contains_char('|') || part.contains_char('>') || part.ends_with(".") || part.ends_with(" ")) {
|
||||
if (is_file) {
|
||||
return TTR("File name contains invalid characters.");
|
||||
} else {
|
||||
@@ -101,7 +101,7 @@ void DirectoryCreateDialog::_on_dir_path_changed() {
|
||||
const String error = _validate_path(path);
|
||||
|
||||
if (error.is_empty()) {
|
||||
if (path.contains("/")) {
|
||||
if (path.contains_char('/')) {
|
||||
if (mode == MODE_DIRECTORY) {
|
||||
validation_panel->set_message(EditorValidationPanel::MSG_ID_DEFAULT, TTR("Using slashes in folder names will create subfolders recursively."), EditorValidationPanel::MSG_OK);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user