summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaoyu Qiu <timothyqiu32@gmail.com>2023-04-08 16:31:25 +0800
committerYuri Sizov <yuris@humnom.net>2023-04-24 14:04:19 +0200
commitd0c50d820be88882161093b76846e0a9995b4e0a (patch)
treefb2c3a66c734cf768b10c6300e6f58c1ce82ed39
parentdeb22e2381122cbd528f7deb01b6ea72d88d2d5e (diff)
Fix connect signal dialog not allowing Unicode method name
(cherry picked from commit 936c9e83b4db06215554ae6f6e888324655048d8)
-rw-r--r--editor/connections_dialog.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/editor/connections_dialog.cpp b/editor/connections_dialog.cpp
index befe84f311..fc7a9b05d3 100644
--- a/editor/connections_dialog.cpp
+++ b/editor/connections_dialog.cpp
@@ -119,7 +119,7 @@ void ConnectDialog::ok_pressed() {
return;
}
- if (!method_name.strip_edges().is_valid_identifier()) {
+ if (!TS->is_valid_identifier(method_name.strip_edges())) {
error->set_text(TTR("Method name must be a valid identifier."));
error->popup_centered();
return;
@@ -228,7 +228,7 @@ StringName ConnectDialog::generate_method_callback_name(Node *p_source, String p
String node_name = p_source->get_name();
for (int i = 0; i < node_name.length(); i++) { // TODO: Regex filter may be cleaner.
char32_t c = node_name[i];
- if (!is_ascii_identifier_char(c)) {
+ if ((i == 0 && !is_unicode_identifier_start(c)) || (i > 0 && !is_unicode_identifier_continue(c))) {
if (c == ' ') {
// Replace spaces with underlines.
c = '_';