[Housekeeping] V14.364 Update (#1991)
Some checks are pending
Project CI / build (24.x) (push) Waiting to run

* Raised compatability to foundry-364. Swapped to new resourceBar color methodology

* Bumped min-version
This commit is contained in:
WBHarry 2026-06-10 23:29:15 +02:00 committed by GitHub
parent 58eb41e4a9
commit 0fb79b98bb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 20 additions and 8 deletions

View file

@ -77,6 +77,20 @@ CONFIG.Token.prototypeSheetClass = applications.sheetConfigs.DhPrototypeTokenCon
CONFIG.Token.objectClass = placeables.DhTokenPlaceable;
CONFIG.Token.rulerClass = placeables.DhTokenRuler;
CONFIG.Token.hudClass = applications.hud.DHTokenHUD;
CONFIG.Token.barConfig = {
bar1: {
colors: {
full: Color.fromRGB([1, 0, 0]),
empty: Color.fromRGB([0, 0, 0])
}
},
bar2: {
colors: {
full: Color.fromString('#0032b1'),
empty: Color.fromRGB([0, 0, 0])
}
}
};
CONFIG.ui.combat = applications.ui.DhCombatTracker;
CONFIG.ui.nav = applications.ui.DhSceneNavigation;

View file

@ -248,7 +248,7 @@ export default class DhTokenPlaceable extends foundry.canvas.placeables.Token {
}
/** @inheritDoc */
_drawBar(number, bar, data) {
_drawBar(index, bar, data) {
// Determine sizing
const { width, height } = this.document.getSize();
const s = canvas.dimensions.uiScale;
@ -256,9 +256,7 @@ export default class DhTokenPlaceable extends foundry.canvas.placeables.Token {
const bh = 8 * (this.document.height >= 2 ? 1.5 : 1) * s;
// Determine the color to use
const Color = foundry.utils.Color;
const fillColor = number === 0 ? Color.fromRGB([1, 0, 0]) : Color.fromString('#0032b1');
const emptyColor = Color.fromRGB([0, 0, 0]);
const { full: fullColor, empty: emptyColor } = this._getBarColors(index, data);
// Draw the bar (accounting floating point numbers from bar animations)
const widthUnit = bw / Math.ceil(data.max);
@ -268,7 +266,7 @@ export default class DhTokenPlaceable extends foundry.canvas.placeables.Token {
const x = mark * widthUnit;
const marked = mark < Math.ceil(data.value);
const remainder = mark === Math.ceil(data.value) - 1 ? data.value % 1 : 0;
const color = !marked ? emptyColor : remainder ? emptyColor.mix(fillColor, remainder) : fillColor;
const color = !marked ? emptyColor : remainder ? emptyColor.mix(fullColor, remainder) : fullColor;
if (mark === 0 || mark === sections.length - 1) {
bar.beginFill(color, marked ? 1.0 : 0.5).drawRect(x, 0, widthUnit, bh, 2 * s); // Would like drawRoundedRect, but it's very troublsome with the corners. Leaving for now.
} else {
@ -277,7 +275,7 @@ export default class DhTokenPlaceable extends foundry.canvas.placeables.Token {
}
// Set position
const posY = number === 0 ? height - bh : 0;
const posY = index === 0 ? height - bh : 0;
bar.position.set(0, posY);
return true;
}

View file

@ -4,8 +4,8 @@
"description": "An unofficial implementation of the Daggerheart system",
"version": "2.3.2",
"compatibility": {
"minimum": "14.361",
"verified": "14.363",
"minimum": "14.364",
"verified": "14.364",
"maximum": "14"
},
"url": "https://github.com/Foundryborne/daggerheart",