Added so that beastforms can set a scale to handle specific images (#1532)

This commit is contained in:
WBHarry 2026-01-15 09:45:10 +01:00 committed by GitHub
parent b92a474069
commit 9393bab6cf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 17 additions and 4 deletions

View file

@ -19,6 +19,7 @@ export default class BeastformEffect extends BaseEffect {
base64: false
}),
tokenSize: new fields.SchemaField({
scale: new fields.NumberField({ nullable: false, initial: 1 }),
height: new fields.NumberField({ integer: false, nullable: true }),
width: new fields.NumberField({ integer: false, nullable: true })
})
@ -55,7 +56,9 @@ export default class BeastformEffect extends BaseEffect {
const update = {
...baseUpdate,
texture: {
src: this.characterTokenData.tokenImg
src: this.characterTokenData.tokenImg,
scaleX: this.characterTokenData.tokenSize.scale,
scaleY: this.characterTokenData.tokenSize.scale
},
ring: {
enabled: this.characterTokenData.usesDynamicToken,
@ -86,7 +89,9 @@ export default class BeastformEffect extends BaseEffect {
y,
'texture': {
enabled: this.characterTokenData.usesDynamicToken,
src: token.flags.daggerheart?.beastformTokenImg ?? this.characterTokenData.tokenImg
src: token.flags.daggerheart?.beastformTokenImg ?? this.characterTokenData.tokenImg,
scaleX: this.characterTokenData.tokenSize.scale,
scaleY: this.characterTokenData.tokenSize.scale
},
'ring': {
subject: {

View file

@ -49,6 +49,7 @@ export default class DHBeastform extends BaseDataItem {
choices: CONFIG.DH.ACTOR.tokenSize,
initial: CONFIG.DH.ACTOR.tokenSize.custom.id
}),
scale: new fields.NumberField({ nullable: false, min: 0.2, max: 3, step: 0.05, initial: 1 }),
height: new fields.NumberField({ integer: true, min: 1, initial: null, nullable: true }),
width: new fields.NumberField({ integer: true, min: 1, initial: null, nullable: true })
}),
@ -184,6 +185,7 @@ export default class DHBeastform extends BaseDataItem {
tokenImg: this.parent.parent.prototypeToken.texture.src,
tokenRingImg: this.parent.parent.prototypeToken.ring.subject.texture,
tokenSize: {
scale: this.parent.parent.prototypeToken.texture.scaleX,
height: this.parent.parent.prototypeToken.height,
width: this.parent.parent.prototypeToken.width
}
@ -209,7 +211,9 @@ export default class DHBeastform extends BaseDataItem {
height,
width,
texture: {
src: this.tokenImg
src: this.tokenImg,
scaleX: this.tokenSize.scale,
scaleY: this.tokenSize.scale
},
ring: {
subject: {