summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorRémi Verschelde <remi@verschelde.fr>2022-06-28 08:07:00 +0200
committerGitHub <noreply@github.com>2022-06-28 08:07:00 +0200
commit4c14bf74820a780d11c786cff8b935b2c64bf3bf (patch)
tree452562114221226f16ce214285fc20d37d39f2c5 /modules
parentb863c40356b4b95192d1a1e2718db7d7aced4235 (diff)
parent9490146a164194bc45dfe26b43da1def60e773d9 (diff)
Merge pull request #62470 from vnen/gdscript-export-nodes
GDScript: Enable exporting nodes to the inspector
Diffstat (limited to 'modules')
-rw-r--r--modules/gdscript/gdscript_parser.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp
index 9e347eed5a..ca430b0f72 100644
--- a/modules/gdscript/gdscript_parser.cpp
+++ b/modules/gdscript/gdscript_parser.cpp
@@ -3605,8 +3605,12 @@ bool GDScriptParser::export_annotations(const AnnotationNode *p_annotation, Node
variable->export_info.type = Variant::OBJECT;
variable->export_info.hint = PROPERTY_HINT_RESOURCE_TYPE;
variable->export_info.hint_string = export_type.native_type;
+ } else if (ClassDB::is_parent_class(export_type.native_type, SNAME("Node"))) {
+ variable->export_info.type = Variant::OBJECT;
+ variable->export_info.hint = PROPERTY_HINT_NODE_TYPE;
+ variable->export_info.hint_string = export_type.native_type;
} else {
- push_error(R"(Export type can only be built-in, a resource, or an enum.)", variable);
+ push_error(R"(Export type can only be built-in, a resource, a node, or an enum.)", variable);
return false;
}
break;