1
0
mirror of https://github.com/godotengine/godot.git synced 2025-12-31 18:41:20 +00:00

Fix CreateDialog::get_selected_typed() ignoring the custom types created from EditorPlugin::add_custom_type()

This commit is contained in:
YuuKaana
2025-12-28 12:36:22 +08:00
parent 63227bbc8a
commit b45f440164

View File

@@ -620,7 +620,16 @@ String CreateDialog::get_selected_type() {
} }
String type = selected->get_text(0).get_slicec(' ', 0); String type = selected->get_text(0).get_slicec(' ', 0);
return ClassDB::class_exists(type) ? type : String(selected->get_meta("_script_path", "")); if (ClassDB::class_exists(type)) {
return type; // CPP type - from the core or GDExtensions
}
const EditorData::CustomType *custom_type = EditorNode::get_editor_data().get_custom_type_by_name(type);
if (custom_type != nullptr) {
return custom_type->script->get_path(); // Types via EditorPlugin::add_custom_type()
}
return String(selected->get_meta("_script_path", "")); // Script types
} }
void CreateDialog::set_base_type(const String &p_base) { void CreateDialog::set_base_type(const String &p_base) {