Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for registering virtual and abstract classes #883

Merged
merged 1 commit into from
Oct 16, 2022

Conversation

rburing
Copy link
Member

@rburing rburing commented Oct 6, 2022

Core PR: godotengine/godot#66979.

Bugsquad edit: Fixes #872

@Calinou Calinou added enhancement This is an enhancement on the current functionality topic:gdextension This relates to the new Godot 4 extension implementation labels Oct 6, 2022
@akien-mga akien-mga requested a review from a team October 7, 2022 10:34
@rburing rburing marked this pull request as draft October 9, 2022 11:40
@rburing rburing changed the title Add support for abstract classes Add support for virtual and abstract classes Oct 15, 2022
@rburing rburing marked this pull request as ready for review October 15, 2022 11:43
@akien-mga akien-mga merged commit f33dfdb into godotengine:master Oct 16, 2022
@akien-mga
Copy link
Member

Thanks!

@rburing rburing deleted the abstract_class branch October 16, 2022 07:23
@aaronfranke
Copy link
Member

It's working if the subclasses are instanced from GDScript using .new(), but for node types, they do not show up in the Create New Node dialog, and they do not work if I manually edit the .tscn with the type.

Here is with ClassDB::register_class<CollisionObject1D>();

Screen Shot 2022-10-16 at 3 18 34 PM

Now, if I change it to ClassDB::register_abstract_class<CollisionObject1D>();, StaticBody1D etc disappear from the menu and it also doesn't work if I set type="StaticBody1D" in the .tscn file. But add_child(StaticBody1D.new()) works.

Screen Shot 2022-10-16 at 3 28 43 PM

@rburing rburing changed the title Add support for virtual and abstract classes Add support for registering virtual and abstract classes Oct 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This is an enhancement on the current functionality topic:gdextension This relates to the new Godot 4 extension implementation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ClassDB::register_abstract_class is missing
4 participants