-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Allow implementing get_class_category
in GDExtension
#78995
Conversation
get_class_category
in GDExtension
I'm just not very familiar with how scripting languages are implemented in Godot, so I feel really under-qualified to comment on whether this is a good idea or not. I'm hoping to learn more about this soon (I have an experiment I want to try ;-)) but until then, I think we'll need feedback from someone who's more well versed this area. However, as to the implementation, I do have one comment with regard to making this change in a backward compatible way (assuming we decide to do this)... |
Discussed at the GDExtension meeting, and we think adding this makes sense! Still needs compatibility addressed per previous comment. |
ed84380
to
fcb8e86
Compare
@Gallilus If this is something you're still interested in finishing, here's the steps that I think are needed to do it:
This is assuming that this will get merged for Godot 4.2 when we can still make changes to the Since we've already approved the general idea behind this PR at a previous GDExtension meeting, I think it should be a quick one to review and approve! |
bd2fe63
to
73beb40
Compare
Tested it with the latest build. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this is looking good!
Aside from my comment on the code, there's only one more little thing missing - in gdextension_script_create_instance()
we need a line that does:
info_2->get_class_category_func = nullptr;
So that that value is set to nullptr
when older GDExtensions use script_instance_create()
with the old struct.
Change GetClassCategory so it is handled in native directly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! This is looking good to me :-)
Thanks! |
Change GetClassCategory so it is handled in native directly.
After #78392 I tried extending
MyScriptExtension
to includeget_class_category
while I was probably doing something wrong it seemed more consistent to alsoget_class_category
true as a native function and let the extension handle it the way they want.CC @dsnopek