mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-06-06 04:44:16 +02:00
Fixed tokenSize linking to token.depth
This commit is contained in:
parent
5d6efb0221
commit
fcc8947555
4 changed files with 11 additions and 5 deletions
|
|
@ -20,7 +20,7 @@ export default class DhScene extends Scene {
|
|||
const prototype = tokenDoc.actor?.prototypeToken ?? tokenDoc;
|
||||
this.#sizeSyncBatch.set(tokenDoc.id, {
|
||||
size: tokenSize,
|
||||
prototypeSize: { width: prototype.width, height: prototype.height },
|
||||
prototypeSize: { width: prototype.width, height: prototype.height, depth: prototype.depth },
|
||||
position: { x: tokenDoc.x, y: tokenDoc.y, elevation: tokenDoc.elevation }
|
||||
});
|
||||
this.#processSyncBatch();
|
||||
|
|
@ -36,11 +36,13 @@ export default class DhScene extends Scene {
|
|||
const tokenSize = tokenSizes[size];
|
||||
const width = size !== CONFIG.DH.ACTOR.tokenSize.custom.id ? tokenSize : prototypeSize.width;
|
||||
const height = size !== CONFIG.DH.ACTOR.tokenSize.custom.id ? tokenSize : prototypeSize.height;
|
||||
const depth = size !== CONFIG.DH.ACTOR.tokenSize.custom.id ? tokenSize : prototypeSize.depth;
|
||||
const updatedPosition = DHToken.getSnappedPositionInSquareGrid(this.grid, position, width, height);
|
||||
return {
|
||||
_id,
|
||||
width,
|
||||
height,
|
||||
depth,
|
||||
...updatedPosition
|
||||
};
|
||||
});
|
||||
|
|
|
|||
|
|
@ -66,7 +66,8 @@ export default class DHToken extends CONFIG.Token.documentClass {
|
|||
if (tokenSize && actor.system.size !== CONFIG.DH.ACTOR.tokenSize.custom.id) {
|
||||
document.updateSource({
|
||||
width: tokenSize,
|
||||
height: tokenSize
|
||||
height: tokenSize,
|
||||
depth: tokenSize
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -90,7 +91,7 @@ export default class DHToken extends CONFIG.Token.documentClass {
|
|||
) {
|
||||
const tokenSizes = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Homebrew).tokenSizes;
|
||||
const tokenSize = tokenSizes[update.system.size];
|
||||
if (tokenSize !== this.width || tokenSize !== this.height) {
|
||||
if (tokenSize !== this.width || tokenSize !== this.height || tokenSize !== this.depth) {
|
||||
this.parent?.syncTokenDimensions(this, update.system.size);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ export default class DhTokenManager {
|
|||
if (tokenSize && actor.system.size !== CONFIG.DH.ACTOR.tokenSize.custom.id) {
|
||||
tokenData.width = tokenSize;
|
||||
tokenData.height = tokenSize;
|
||||
tokenData.depth = tokenSize;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue