summaryrefslogtreecommitdiffstats
path: root/editor/editor_autoload_settings.cpp
diff options
context:
space:
mode:
authorHaoyu Qiu <timothyqiu32@gmail.com>2024-09-21 16:47:19 +0800
committerHaoyu Qiu <timothyqiu32@gmail.com>2024-09-21 16:47:19 +0800
commite8462bf3acd0747489c3ed1e87d6f3cbc203016a (patch)
treec5308bf03d1b035926405ed229d8e88badf84df9 /editor/editor_autoload_settings.cpp
parent621cadcf651b93757d5dbf8969023ae62a16f1a4 (diff)
downloadredot-engine-e8462bf3acd0747489c3ed1e87d6f3cbc203016a.tar.gz
Allow using Unicode identifier for Autoload name
Diffstat (limited to 'editor/editor_autoload_settings.cpp')
-rw-r--r--editor/editor_autoload_settings.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/editor/editor_autoload_settings.cpp b/editor/editor_autoload_settings.cpp
index 0eabe53360..1613d1d62f 100644
--- a/editor/editor_autoload_settings.cpp
+++ b/editor/editor_autoload_settings.cpp
@@ -88,14 +88,9 @@ void EditorAutoloadSettings::_notification(int p_what) {
}
bool EditorAutoloadSettings::_autoload_name_is_valid(const String &p_name, String *r_error) {
- if (!p_name.is_valid_ascii_identifier()) {
+ if (!p_name.is_valid_unicode_identifier()) {
if (r_error) {
- *r_error = TTR("Invalid name.") + " ";
- if (p_name.size() > 0 && p_name.left(1).is_numeric()) {
- *r_error += TTR("Cannot begin with a digit.");
- } else {
- *r_error += TTR("Valid characters:") + " a-z, A-Z, 0-9 or _";
- }
+ *r_error = TTR("Invalid name.") + " " + TTR("Must be a valid Unicode identifier.");
}
return false;