From a51116c6c7127aa107791f72aa4bebf493b9ca5e Mon Sep 17 00:00:00 2001 From: Theraot Date: Sat, 8 Jul 2023 06:23:01 -0500 Subject: [PATCH] Make onready variables created from dropping nodes include custom types --- editor/plugins/script_text_editor.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp index 5fdfb2117621..0a1f735f64e6 100644 --- a/editor/plugins/script_text_editor.cpp +++ b/editor/plugins/script_text_editor.cpp @@ -1726,9 +1726,17 @@ void ScriptTextEditor::drop_data_fw(const Point2 &p_point, const Variant &p_data String variable_name = String(node->get_name()).to_snake_case().validate_identifier(); if (use_type) { - text_to_drop += vformat("@onready var %s: %s = %s%s\n", variable_name, node->get_class_name(), is_unique ? "%" : "$", path); + StringName class_name = node->get_class_name(); + Ref