Skip to content

custom Node classes not working as command arguments #8

Description

@duncathan

The issue is in YarnLibrary._is_node_class(). It currently relies only on ClassDB to see if the class inherits from Node, but ClassDB only includes builtins. I adjusted the function like so and it now handles custom classes:

func _is_node_class(type_class: String) -> bool:
	if type_class.is_empty():
		return false
	if type_class == "Node":
		return true
	if ClassDB.class_exists(type_class):
		return ClassDB.is_parent_class(type_class, "Node")
	var class_list := ProjectSettings.get_global_class_list()
	for cls in class_list:
		if cls["class"] == type_class:
			return _is_node_class(cls["base"])
	return false

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions