-
-
Notifications
You must be signed in to change notification settings - Fork 22.8k
Improve documentation of some Resource
methods
#102499
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
Conversation
doc/classes/Resource.xml
Outdated
</description> | ||
</method> | ||
<method name="reset_state"> | ||
<return type="void" /> | ||
<description> | ||
For resources that use a variable number of properties, either via [method Object._validate_property] or [method Object._get_property_list], override [method _reset_state] to correctly clear the resource's state. | ||
Makes the resource clear its non-exported properties. Useful when implementing a custom resource format by extending [ResourceFormatLoader] and [ResourceFormatSaver]. |
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.
It may be good to add somethiing like, "See also [method _reset_state]".
I still don't quite get why we need both. @dsnopek, couldn't just reset_state
be overridable in GDExtension?
Looks good overall. |
4427d60
to
e9703ee
Compare
Asking for review on this, since it received a thumbs up from a core team member. The discussion on whether the method should stay exposed doesn't apply anymore after 4.4 release. |
There's still merit to it, actually. I genuinely think the move to expose But that's beyond the improvements done in this PR. |
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.
Genuinely a massive improvement. Although, what a mess in the API, with those newly introduced methods. Only their virtual equivalent should've been exposed, probably.
Thanks! |
#90969 exposed some methods in
Resource
, but most of them are only useful for implementing resource formats and are major footguns otherwise. This aims to explain more clearly what they do. Also syncs the already existing comments with these changes.