1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +00:00

Merge pull request #81299 from jsjtxietian/Reload-built_in-script-after-create-to-allow-drag-nodes-into-it

Fix an error when dragging nodes into built-in scripts because script does not inherit Node
This commit is contained in:
Yuri Sizov
2023-09-06 14:49:24 +02:00

View File

@@ -391,6 +391,8 @@ void ScriptCreateDialog::_create_new() {
if (is_built_in) { if (is_built_in) {
scr->set_name(internal_name->get_text()); scr->set_name(internal_name->get_text());
// Make sure the script is compiled to make its type recognizable.
scr->reload();
} else { } else {
String lpath = ProjectSettings::get_singleton()->localize_path(file_path->get_text()); String lpath = ProjectSettings::get_singleton()->localize_path(file_path->get_text());
scr->set_path(lpath); scr->set_path(lpath);