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

Paper over array weirdnesses #45

Merged
merged 4 commits into from
Jun 23, 2021
Merged

Paper over array weirdnesses #45

merged 4 commits into from
Jun 23, 2021

Conversation

ben
Copy link
Owner

@ben ben commented Jun 23, 2021

As per #43, it looks like most assets in the compendium have their data structured properly:

{
  abilities: [
    { enabled: true, description: "..." },
    { enabled: false, description: "..." },
    { enabled: false, description: "..." },
  ]
}

I.e., abilities should be an array. But others seem to have data that looks like this:

{
  abilities: {
    0: { enabled: true, description: "..." },
    1: { enabled: false, description: "..." },
    2: { enabled: false, description: "..." },
  }
}

abilities is an object with integer keys. This is probably left over from early development when I was still figuring out how to do editors and toggles, and honestly Foundry still sometimes screws this up.

This PR fixes it by using a custom handler for the checkboxes that will ensure the data ends up in the proper format. I'm also fixing a couple of other bugs with field edits on this sheet. Fixes #43.

@ben ben merged commit 0fc197d into main Jun 23, 2021
@ben ben deleted the ben/fix-asset-clobbering branch June 23, 2021 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Assets return "undefined" after edit
1 participant