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

Merge pull request #114364 from Lazy-Rabbit-2001/fix_add_type_not_working

Fix `CreateDialog::get_selected_typed()` ignoring the custom types created from `EditorPlugin::add_custom_type()`
This commit is contained in:
Rémi Verschelde
2025-12-29 19:45:46 +01:00
committed by GitHub

View File

@@ -620,7 +620,16 @@ String CreateDialog::get_selected_type() {
}
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) {