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

Foundry 13: Call and merge in underlying _prepareContext data #1011

Open
kgar opened this issue Feb 22, 2025 · 0 comments
Open

Foundry 13: Call and merge in underlying _prepareContext data #1011

kgar opened this issue Feb 22, 2025 · 0 comments
Labels
enhancement New feature or request foundry-core

Comments

@kgar
Copy link
Owner

kgar commented Feb 22, 2025

Foundry 13 Testing 1 shows this context data. Update Tidy's document sheets (Item, Actor) to leverage this, and ensure their types are accounted for.

  /** @inheritDoc */
  async _prepareContext(options) {
    const context = await super._prepareContext(options);
    const document = this.document;
    return Object.assign(context, {
      document,
      source: document._source,
      fields: document.schema.fields,
      editable: this.isEditable,
      user: game.user,
      rootId: document.collection?.has(document.id) ? this.id : foundry.utils.randomID()
    });
  }
@kgar kgar added enhancement New feature or request foundry-core labels Feb 22, 2025
@kgar kgar added this to the Foundry 13 Feature Rollout milestone Feb 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request foundry-core
Projects
None yet
Development

No branches or pull requests

1 participant