Fix CreateDialog returning wrong type

This commit is contained in:
kobewi 2025-12-03 15:28:24 +01:00
parent 2ecefada8d
commit 234a255249
3 changed files with 3 additions and 3 deletions

View file

@ -621,7 +621,7 @@ String CreateDialog::get_selected_type() {
return String(); return String();
} }
String type = selected->get_text(0); String type = selected->get_text(0).get_slicec(' ', 0);
return ClassDB::class_exists(type) ? type : String(selected->get_meta("_script_path", "")); return ClassDB::class_exists(type) ? type : String(selected->get_meta("_script_path", ""));
} }

View file

@ -90,7 +90,7 @@ void SceneCreateDialog::browse_types() {
} }
void SceneCreateDialog::on_type_picked() { void SceneCreateDialog::on_type_picked() {
other_type_display->set_text(select_node_dialog->get_selected_type().get_slicec(' ', 0)); other_type_display->set_text(select_node_dialog->get_selected_type());
if (node_type_other->is_pressed()) { if (node_type_other->is_pressed()) {
validation_panel->update(); validation_panel->update();
} else { } else {

View file

@ -492,7 +492,7 @@ void ScriptCreateDialog::_file_selected(const String &p_file) {
} }
void ScriptCreateDialog::_create() { void ScriptCreateDialog::_create() {
parent_name->set_text(select_class->get_selected_type().get_slicec(' ', 0)); parent_name->set_text(select_class->get_selected_type());
_parent_name_changed(parent_name->get_text()); _parent_name_changed(parent_name->get_text());
} }