mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 11:41:08 +01:00
Added support for adversary actor sizes
This commit is contained in:
parent
9b4249b100
commit
d38b924cad
15 changed files with 180 additions and 5 deletions
|
|
@ -100,4 +100,18 @@ export default class DHToken extends TokenDocument {
|
|||
}
|
||||
super.deleteCombatants(tokens, combat ?? {});
|
||||
}
|
||||
|
||||
/**@inheritdoc */
|
||||
_onRelatedUpdate(update = {}, operation = {}) {
|
||||
super._onRelatedUpdate(update, operation);
|
||||
|
||||
if (!this.actor?.isOwner) return;
|
||||
const activeGM = game.users.activeGM; // Let the active GM take care of updates if available
|
||||
if (this.actor.system.metadata.usesSize && activeGM && game.user.id === activeGM.id) {
|
||||
const dimensions = { height: this.actor.system.size, width: this.actor.system.size };
|
||||
if (dimensions.width !== this.width || dimensions.height !== this.height) {
|
||||
this.parent?.syncTokenDimensions(this, dimensions);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue