aboutsummaryrefslogtreecommitdiff
path: root/editor/script_create_dialog.cpp
diff options
context:
space:
mode:
authorAndreas Haas2018-03-09 23:34:32 +0100
committerHein-Pieter van Braam2018-04-15 00:48:11 +0200
commit6472d8c7d4db3aed63af028f227a97001f4b861f (patch)
treebffefe14bea63f24db8eb7c51d38a7d135d06118 /editor/script_create_dialog.cpp
parente4fadebc3b6f1bb06a9a91e86f15a171cbdc0c4d (diff)
downloadgodot-6472d8c7d4db3aed63af028f227a97001f4b861f.tar.gz
godot-6472d8c7d4db3aed63af028f227a97001f4b861f.tar.zst
godot-6472d8c7d4db3aed63af028f227a97001f4b861f.zip
Mono: Avoid invalid class names.
Disallow reserved keywords as class names and prefix base class with the Godot namespace if it's the same as the class name. Fixes #12483 (cherry picked from commit 700d07cf7cae4e28de107e0c274b27c857d98450)
Diffstat (limited to 'editor/script_create_dialog.cpp')
-rw-r--r--editor/script_create_dialog.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/editor/script_create_dialog.cpp b/editor/script_create_dialog.cpp
index d0d6e82fc..0e43aad70 100644
--- a/editor/script_create_dialog.cpp
+++ b/editor/script_create_dialog.cpp
@@ -424,6 +424,13 @@ void ScriptCreateDialog::_path_changed(const String &p_path) {
return;
}
+ String path_error = ScriptServer::get_language(language_menu->get_selected())->validate_path(p);
+ if (path_error != "") {
+ _msg_path_valid(false, path_error);
+ _update_dialog();
+ return;
+ }
+
/* All checks passed */
is_path_valid = true;