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

[#2495] Allow prepareData methods to be called on module actors #2506

Merged
merged 2 commits into from
Oct 25, 2023

Conversation

arbron
Copy link
Collaborator

@arbron arbron commented Oct 20, 2023

  • SystemDataModel now inherits from TypeDataModel
  • Renamed _prepareBaseData on GroupData to match naming in core
  • Adjusted data preparation to ensure TypeDataModel preparation methods are still called

@arbron arbron self-assigned this Oct 20, 2023
@arbron arbron requested a review from Fyorl October 20, 2023 22:54
@arbron arbron added this to the D&D5E 2.4.0 milestone Oct 20, 2023
@arbron arbron added bug Functionality which is not working as intended api labels Oct 20, 2023
@arbron arbron linked an issue Oct 20, 2023 that may be closed by this pull request
Copy link
Contributor

@Fyorl Fyorl left a comment

Choose a reason for hiding this comment

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

I have a suspicion that TypeDataModel is v11-only, which is why we do not use it currently. That's also why I opted to check game.template for the types rather than checking system.modelProvider.

The rest of the changes look fine to me except that we might have to continue manually calling GroupActor#prepareBaseData for now while we have v10 compatibility.

It's unclear whether #2495 can be resolved without inheriting from TypeDataModel. I don't know if we want to punt this issue to a later version where we drop v10 support, or whether we can dynamically inherit from DataModel or TypeDataModel based on game.release.generation.

module/documents/actor/actor.mjs Show resolved Hide resolved
module/documents/actor/actor.mjs Outdated Show resolved Hide resolved
@arbron arbron merged commit dc827e1 into foundryvtt:2.4.x Oct 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api bug Functionality which is not working as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow module-provided actor subtypes to use core data preparation
2 participants