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

PrototypeToken#texture#src fails to be set in BaseActor#_preCreate #10916

Closed
3 of 6 tasks
In3luki opened this issue May 14, 2024 · 0 comments
Closed
3 of 6 tasks

PrototypeToken#texture#src fails to be set in BaseActor#_preCreate #10916

In3luki opened this issue May 14, 2024 · 0 comments
Assignees
Labels
bug Functionality which is not working as intended tokens Issues related to Tokens and their appearance

Comments

@In3luki
Copy link

In3luki commented May 14, 2024

What happened?

BaseActor#_preCreate tries to set PrototypeToken#img which, as far as I can tell, was a shim that was removed in v12.
As there always seems to be an img property in data (ActorSource) the texture value is never set.

    /** @inheritDoc */
    async _preCreate(data, options, user) {
      const allowed = await super._preCreate(data, options, user);
      if (allowed === false) return false;
      if (!this.prototypeToken.name) this.prototypeToken.updateSource({ name: this.name });
      if (!this.prototypeToken.texture.src || (this.prototypeToken.texture.src === DEFAULT_TOKEN)) {
        const { texture } = this.constructor.getDefaultArtwork(this.toObject());
        this.prototypeToken.updateSource("img" in data ? { img: this.img } : { texture });
      }
    }

What ways of accessing Foundry can you encounter this issue in?

  • Native App (Electron)
  • Chrome
  • Firefox
  • Safari
  • Other

Reproduction Steps

Override Actor#getDefaultArtwork to return a custom texture src and create a new actor.

What core version are you reporting this for?

Version 12 Build 322

Relevant log output

No response

Bug Checklist

  • The issue occurs while all Modules are disabled
@In3luki In3luki added the bug Functionality which is not working as intended label May 14, 2024
@aaclayton aaclayton added the tokens Issues related to Tokens and their appearance label May 14, 2024
@Fyorl Fyorl self-assigned this May 14, 2024
@Fyorl Fyorl closed this as completed May 14, 2024
@Fyorl Fyorl added this to the V12 User Testing 4 milestone May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Functionality which is not working as intended tokens Issues related to Tokens and their appearance
Projects
Status: Done
Development

No branches or pull requests

3 participants