Merge pull request #69269 from red1939/red1939/master
Acknowledge that a CLASS kind of a DataType might not have an identifier
This commit is contained in:
commit
c868e0b4b9
1 changed files with 2 additions and 3 deletions
|
@ -3785,15 +3785,14 @@ bool GDScriptParser::export_annotations(const AnnotationNode *p_annotation, Node
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case GDScriptParser::DataType::CLASS:
|
case GDScriptParser::DataType::CLASS:
|
||||||
// Can assume type is a global GDScript class.
|
|
||||||
if (ClassDB::is_parent_class(export_type.native_type, SNAME("Resource"))) {
|
if (ClassDB::is_parent_class(export_type.native_type, SNAME("Resource"))) {
|
||||||
variable->export_info.type = Variant::OBJECT;
|
variable->export_info.type = Variant::OBJECT;
|
||||||
variable->export_info.hint = PROPERTY_HINT_RESOURCE_TYPE;
|
variable->export_info.hint = PROPERTY_HINT_RESOURCE_TYPE;
|
||||||
variable->export_info.hint_string = export_type.class_type->identifier->name;
|
variable->export_info.hint_string = export_type.to_string();
|
||||||
} else if (ClassDB::is_parent_class(export_type.native_type, SNAME("Node"))) {
|
} else if (ClassDB::is_parent_class(export_type.native_type, SNAME("Node"))) {
|
||||||
variable->export_info.type = Variant::OBJECT;
|
variable->export_info.type = Variant::OBJECT;
|
||||||
variable->export_info.hint = PROPERTY_HINT_NODE_TYPE;
|
variable->export_info.hint = PROPERTY_HINT_NODE_TYPE;
|
||||||
variable->export_info.hint_string = export_type.class_type->identifier->name;
|
variable->export_info.hint_string = export_type.to_string();
|
||||||
} else {
|
} else {
|
||||||
push_error(R"(Export type can only be built-in, a resource, a node or an enum.)", variable);
|
push_error(R"(Export type can only be built-in, a resource, a node or an enum.)", variable);
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in a new issue