-
-
Notifications
You must be signed in to change notification settings - Fork 22k
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
Fix implementation of property_can_revert()
in PropertyListHelper
#88665
Conversation
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.
Fun stuff
doc/classes/Object.xml
Outdated
@@ -220,7 +220,7 @@ | |||
<return type="bool" /> | |||
<param index="0" name="property" type="StringName" /> | |||
<description> | |||
Override this method to customize the given [param property]'s revert behavior. Should return [code]true[/code] if the [param property] can be reverted in the Inspector dock. Use [method _property_get_revert] to specify the [param property]'s default value. | |||
Override this method to customize the given [param property]'s revert behavior. Should return [code]true[/code] if the [param property] has a custom default value and is revertable in the Inspector dock. Use [method _property_get_revert] to specify the [param property]'s default value. |
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.
Override this method to customize the given [param property]'s revert behavior. Should return [code]true[/code] if the [param property] has a custom default value and is revertable in the Inspector dock. Use [method _property_get_revert] to specify the [param property]'s default value. | |
Override this method to customize the given [param property]'s revert behavior. Should return [code]true[/code] if the [param property] has a custom default value and is revertible in the Inspector dock. Use [method _property_get_revert] to specify the [param property]'s default value. |
or
Override this method to customize the given [param property]'s revert behavior. Should return [code]true[/code] if the [param property] has a custom default value and is revertable in the Inspector dock. Use [method _property_get_revert] to specify the [param property]'s default value. | |
Override this method to customize the given [param property]'s revert behavior. Should return [code]true[/code] if the [param property] has a custom default value and can be reverted in the Inspector dock. Use [method _property_get_revert] to specify the [param property]'s default value. |
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.
I wanted to convey that the property can be reverted, but returning true
does not force it (i.e. default is still checked).
7fc1e3f
to
5473c7e
Compare
Thanks! |
Apparently
_property_can_revert()
is supposed to always return true for a recognized custom property. This PR fixes the PropertyListHelper implementation and clarifies the doc.