This commit is contained in:
WBHarry 2025-12-20 21:18:48 +01:00
parent 215006731a
commit 0f52eb0492
2 changed files with 3 additions and 3 deletions

View file

@ -76,7 +76,7 @@ export default class DhpActor extends Actor {
const update = {}; const update = {};
// Set default token size. Done here as we do not want to set a datamodel default, since that would apply the sizing to third party actor modules that aren't set up with the size system. // Set default token size. Done here as we do not want to set a datamodel default, since that would apply the sizing to third party actor modules that aren't set up with the size system.
if (this.system.metadata.usesSize) { if (this.system.metadata.usesSize && !data.system?.size) {
Object.assign(update, { Object.assign(update, {
system: { system: {
size: CONFIG.DH.ACTOR.tokenSize.medium.id size: CONFIG.DH.ACTOR.tokenSize.medium.id

View file

@ -111,7 +111,7 @@ export default class DHToken extends CONFIG.Token.documentClass {
const actor = document.actor; const actor = document.actor;
if (actor?.system.metadata.usesSize) { if (actor?.system.metadata.usesSize) {
const tokenSize = tokenSizes[actor.system.size]; const tokenSize = tokenSizes[actor.system.size];
if (tokenSize && tokenSize !== CONFIG.DH.ACTOR.tokenSize.custom.id) { if (tokenSize && actor.system.size !== CONFIG.DH.ACTOR.tokenSize.custom.id) {
document.updateSource({ document.updateSource({
width: tokenSize, width: tokenSize,
height: tokenSize height: tokenSize
@ -165,7 +165,7 @@ export default class DHToken extends CONFIG.Token.documentClass {
if (this.actor?.system.metadata.usesSize) { if (this.actor?.system.metadata.usesSize) {
const tokenSizes = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Homebrew).tokenSizes; const tokenSizes = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Homebrew).tokenSizes;
const tokenSize = tokenSizes[this.actor.system.size]; const tokenSize = tokenSizes[this.actor.system.size];
if (tokenSize && tokenSize !== CONFIG.DH.ACTOR.tokenSize.custom.id) { if (tokenSize && this.actor.system.size !== CONFIG.DH.ACTOR.tokenSize.custom.id) {
width = tokenSize ?? width; width = tokenSize ?? width;
height = tokenSize ?? height; height = tokenSize ?? height;
} }