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

Fix implementation of property_can_revert() in PropertyListHelper #88665

Merged
merged 1 commit into from
Feb 22, 2024

Conversation

KoBeWi
Copy link
Member

@KoBeWi KoBeWi commented Feb 22, 2024

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.

@KoBeWi KoBeWi added this to the 4.3 milestone Feb 22, 2024
@KoBeWi KoBeWi requested a review from a team as a code owner February 22, 2024 13:08
Copy link
Contributor

@Mickeon Mickeon left a comment

Choose a reason for hiding this comment

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

Fun stuff

@@ -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.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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

Suggested change
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.

Copy link
Member Author

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).

@akien-mga akien-mga merged commit c17f3d7 into godotengine:master Feb 22, 2024
16 checks passed
@akien-mga
Copy link
Member

Thanks!

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