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

Add PROPERTY_USAGE_NEVER_DUPLICATE flag and use for script #71142

Merged
merged 2 commits into from
Jan 25, 2023

Conversation

aaronfranke
Copy link
Member

This PR fixes #33079 and supersedes #41923.

This PR is split into two commits:

  • PropertyUsage: Rename "DO_NOT_SHARE_ON_DUPLICATE" to "ALWAYS_DUPLICATE"
    • While working on this PR, I found the old name to be confusing. The action that can be done or not is duplication, the term "share" is mostly foreign terminology to this process. Sharing means "do not duplicate", so "do not share" means "do not not duplicate". I think it makes a lot more sense with the name "ALWAYS_DUPLICATE". Technically it could be "always duplicate on duplicate" but that seems unnecessary and redundant.
    • This part breaks compatibility. I can later make a 3.x version of this PR without this rename.
  • Add PROPERTY_USAGE_NEVER_DUPLICATE flag and use for script

Minimal reproduction project in GDScript: test_33079.zip

@raulsntos
Copy link
Member

Changes to the PropertyUsageFlags enum need to be synchronized with the enum in C# source generators:

Copy link
Member

@akien-mga akien-mga left a comment

Choose a reason for hiding this comment

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

Approved by production team.

We thought it would be worth furthering the compat breakage a bit by moving NEVER_DUPLICATE next to ALWAYS_DUPLICATE in the enum, so they're adjacent in the docs.

@kleonc
Copy link
Member

kleonc commented Jan 24, 2023

This likely fixes #68666 (only for Resources stored/duplicated after this PR; if something was already saved with script then it would still fail loading).

@akien-mga akien-mga merged commit b9bf12e into godotengine:master Jan 25, 2023
@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.

Calling duplicate(true) on custom Resource returns empty Resource.
6 participants