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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
<fieldset>
|
||||
<legend>{{localize "DAGGERHEART.APPLICATIONS.TokenConfig.tokenSize"}}</legend>
|
||||
{{#if usesActorSize}}
|
||||
<div class="form-group lim">
|
||||
<div class="form-group slim">
|
||||
<label>{{localize "DAGGERHEART.APPLICATIONS.TokenConfig.sizeCategory"}}</label>
|
||||
|
||||
<select id="dhTokenSize">
|
||||
|
|
@ -50,11 +50,13 @@
|
|||
{{localize "TOKEN.Size"}}
|
||||
<span class="units">({{localize "MEASUREMENT.GridSpaces"}})</span>
|
||||
</span>
|
||||
<div class="form-fields">
|
||||
<div class="form-group slim">
|
||||
<label for="{{rootId}}-width">{{localize "DOCUMENT.FIELDS.width.label"}}</label>
|
||||
{{formInput fields.width value=source.width id=(concat rootId "-width") disabled=actorSizeDisable}}
|
||||
<label for="{{rootId}}-height">{{localize "DOCUMENT.FIELDS.height.label"}}</label>
|
||||
{{formInput fields.height value=source.height id=(concat rootId "-height") disabled=actorSizeDisable}}
|
||||
<label for="{{rootId}}-depth">Z</label>
|
||||
{{formInput fields.depth value=source.depth id=(concat rootId "-depth") disabled=actorSizeDisable}}
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue