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

GDExtension: Don't deprecate old method of getting script category #82682

Conversation

dsnopek
Copy link
Contributor

@dsnopek dsnopek commented Oct 2, 2023

This is a follow up to PR #78995

That PR allows GDExtensions to take control over the class category used for script instances (when you're adding a scripting language from a GDExtension). However, in many (most?) cases, GDExtensions don't need this extra control and the old, default method is just fine.

So, rather than deprecating the old behavior, I think this should just be a case where there's two ways to handle this: (1) provide a get_class_category_func if you want the extra control, or (2) provide nullptr if the default behavior is fine.

This PR just removes the #ifndef DISABLE_DEPRECATED that wraps the old behavior, and adds a comment to the gdextension_interface.h.

@dsnopek dsnopek added this to the 4.2 milestone Oct 2, 2023
@dsnopek dsnopek requested a review from a team October 2, 2023 14:24
@dsnopek dsnopek requested a review from a team as a code owner October 2, 2023 14:24
Copy link
Contributor

@Bromeon Bromeon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to have this optional!

I was at first confused by "don't deprecate the old method" because GDExtensionScriptInstanceInfo (v1) still remains deprecated after this PR. As I understood, you re-introduce allowing nullability here.

@dsnopek
Copy link
Contributor Author

dsnopek commented Oct 2, 2023

I was at first confused by "don't deprecate the old method" because GDExtensionScriptInstanceInfo (v1) still remains deprecated after this PR. As I understood, you re-introduce allowing nullability here.

Ah, yes, sorry for the confusion. GDExtensionScriptInstanceInfo is still deprecated, it's just allowing get_class_category_func to be null "officially", not only to support the deprecated struct.

@dsnopek dsnopek requested a review from a team October 3, 2023 12:38
@akien-mga akien-mga merged commit dbd4c79 into godotengine:master Oct 3, 2023
15 checks passed
@akien-mga
Copy link
Member

Thanks!

@dsnopek dsnopek deleted the gdextension-dont-deprecate-script-category branch July 22, 2024 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants