Skip to content

Adjusted default artwork logic#1953

Open
JPMeehan wants to merge 1 commit into
1.1.xfrom
default-artwork-logic
Open

Adjusted default artwork logic#1953
JPMeehan wants to merge 1 commit into
1.1.xfrom
default-artwork-logic

Conversation

@JPMeehan

Copy link
Copy Markdown
Contributor

Made it easier for people manually replacing system-provided actor images.

@JPMeehan JPMeehan added this to the v1.1.0 milestone Jun 21, 2026
@JPMeehan JPMeehan requested a review from krbz999 June 21, 2026 16:50
@JPMeehan JPMeehan self-assigned this Jun 21, 2026
@JPMeehan JPMeehan added the data model Document and Data Model issues label Jun 21, 2026
if (allowed === false) return false;
// Make it easier for users to override system-provided default icons
if (changed.img && !foundry.utils.getProperty(changed, "prototypeToken.texture.src")) {
if (!this.prototypeToken.texture.src || (this.prototypeToken.texture.src.includes("systems/draw-steel/"))) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looking at relevant locations where the concept of adjusting the prototype token in conjunction with the actor img, it looks like we want _initializeSource and _preUpdate as well. We should also adjust Actor.getDefaultArtwork.

Also worth considering the "show token artwork" header button (in ActorSheet#_getHeaderControls).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I don't think _initializeSource is necessary, that's only for compendium art.

I considered adjusting the getDefaultArtwork method, but I don't think that as effectively addresses the goal of this PR: Make it easier for people to manually switch off of the system-provided art.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks like I wrote preupdate when I actually meant precreate.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I still don't think that's related to the purpose of the change I'm making.

@JPMeehan JPMeehan requested a review from krbz999 July 3, 2026 13:36

@krbz999 krbz999 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

When changing the actor image, I do not want the token texture to change just because it is currently an icon from the system.

I want the token texture to change if it is the default icon. Therefore we should compare to the default artwork.

@JPMeehan

JPMeehan commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

So, the up/downside here is practically speaking, our "default NPC art" is almost entirely based on the Monster Role, which is not going to be filled in from a simple Actor.createDialog; furthermore, if someone is just trying to switch the actor art to another one of our role icons (say you're duplicating an existing monster as a base and then making some adjustments), they would need to make sure they do the art change then the actual data change.

@krbz999

krbz999 commented Jul 7, 2026

Copy link
Copy Markdown
Member

Well Actor.getDefaultArtwork doesn't accept just type, it accepts an entire object of actor data. It is not strictly related to the creation dialog.

It should, in my opinion, determine the default artwork using whatever data is available as the API method that it is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

data model Document and Data Model issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants