diff --git a/module/applications/dialogs/deathMove.mjs b/module/applications/dialogs/deathMove.mjs
index 4a949b99..69ff758e 100644
--- a/module/applications/dialogs/deathMove.mjs
+++ b/module/applications/dialogs/deathMove.mjs
@@ -57,7 +57,6 @@ export default class DhDeathMove extends HandlebarsApplicationMixin(ApplicationV
let returnMessage = game.i18n.localize('DAGGERHEART.UI.Chat.deathMove.avoidScar');
if (config.roll.fate.value <= this.actor.system.levelData.level.current) {
- const maxHope = this.actor.system.resources.hope.max + this.actor.system.scars;
const newScarAmount = this.actor.system.scars + 1;
await this.actor.update({
system: {
@@ -65,7 +64,7 @@ export default class DhDeathMove extends HandlebarsApplicationMixin(ApplicationV
}
});
- if (newScarAmount >= maxHope) {
+ if (newScarAmount >= this.actor.system.resources.hope.max) {
await this.actor.setDeathMoveDefeated(CONFIG.DH.GENERAL.defeatedConditionChoices.dead.id);
return game.i18n.format('DAGGERHEART.UI.Chat.deathMove.journeysEnd', { scars: newScarAmount });
}
diff --git a/module/applications/hud/tokenHUD.mjs b/module/applications/hud/tokenHUD.mjs
index 671b01a1..943f3506 100644
--- a/module/applications/hud/tokenHUD.mjs
+++ b/module/applications/hud/tokenHUD.mjs
@@ -124,9 +124,7 @@ export default class DHTokenHUD extends foundry.applications.hud.TokenHUD {
const animationDuration = 500;
const scene = game.scenes.get(game.user.viewedScene);
/* getDependentTokens returns already removed tokens with id = null. Need to filter that until it's potentially fixed from Foundry */
- const activeTokens = actors.flatMap(member =>
- member.getDependentTokens({ scenes: scene }).filter(x => x._id && !x._destroyed)
- );
+ const activeTokens = actors.flatMap(member => member.getDependentTokens({ scenes: scene }).filter(x => x._id));
const { x: actorX, y: actorY } = this.document;
if (activeTokens.length > 0) {
for (let token of activeTokens) {
diff --git a/module/data/actor/character.mjs b/module/data/actor/character.mjs
index 70f83236..a1cd13e8 100644
--- a/module/data/actor/character.mjs
+++ b/module/data/actor/character.mjs
@@ -840,13 +840,12 @@ export default class DhCharacter extends DhCreature {
const newHopeMax = this.resources.hope.max + diff;
const newHopeValue = Math.min(newHopeMax, this.resources.hope.value);
if (newHopeValue != this.resources.hope.value) {
- changes.system = foundry.utils.mergeObject(changes.system ?? {}, {
- resources: {
- hope: {
- value: (changes.system?.resources?.hope?.value ?? 0) + newHopeMax
- }
- }
- });
+ if (!changes.system.resources.hope) changes.system.resources.hope = { value: 0 };
+
+ changes.system.resources.hope = {
+ ...changes.system.resources.hope,
+ value: changes.system.resources.hope.value + newHopeValue
+ };
}
}
diff --git a/module/data/item/armor.mjs b/module/data/item/armor.mjs
index 21c56f9a..b0e4847f 100644
--- a/module/data/item/armor.mjs
+++ b/module/data/item/armor.mjs
@@ -141,6 +141,16 @@ export default class DHArmor extends AttachableItem {
}
}
+ _onUpdate(a, b, c) {
+ super._onUpdate(a, b, c);
+
+ if (this.actor?.type === 'character') {
+ for (const party of this.actor.parties) {
+ party.render();
+ }
+ }
+ }
+
/** @inheritDoc */
static migrateDocumentData(source) {
if (!source.system.armor) {
diff --git a/module/documents/actor.mjs b/module/documents/actor.mjs
index 91bf7190..5df87b6c 100644
--- a/module/documents/actor.mjs
+++ b/module/documents/actor.mjs
@@ -112,22 +112,10 @@ export default class DhpActor extends Actor {
this.updateSource(update);
}
- /** Perform a render, debounced in order to prevent overloading repeat render requests */
- renderDebounced = foundry.utils.debounce(options => {
- return this.render(options);
- }, 10);
-
- _onUpdateDescendantDocuments(parent, collection, documents, changes, options, userId) {
- super._onUpdateDescendantDocuments(parent, collection, documents, changes, options, userId);
- for (const party of this.parties) {
- party.renderDebounced({ parts: ['partyMembers'] });
- }
- }
-
_onUpdate(changes, options, userId) {
super._onUpdate(changes, options, userId);
for (const party of this.parties) {
- party.renderDebounced({ parts: ['partyMembers'] });
+ party.render({ parts: ['partyMembers'] });
}
}
@@ -146,7 +134,7 @@ export default class DhpActor extends Actor {
_onDelete(options, userId) {
super._onDelete(options, userId);
for (const party of this.parties) {
- party.renderDebounced({ parts: ['partyMembers'] });
+ party.render({ parts: ['partyMembers'] });
}
}
diff --git a/styles/less/sheets/actors/party/party-members.less b/styles/less/sheets/actors/party/party-members.less
index a3ec90ec..a29f7c88 100644
--- a/styles/less/sheets/actors/party/party-members.less
+++ b/styles/less/sheets/actors/party/party-members.less
@@ -2,6 +2,16 @@
@import '../../../utils/fonts.less';
@import '../../../utils/mixin.less';
+body.game:is(.performance-low, .noblur) {
+ .application.sheet.daggerheart.actor.dh-style.party .tab.resources .actors-list .actor-resources {
+ background: light-dark(@dark-blue, @dark-golden);
+
+ .actor-name {
+ background: light-dark(@dark-blue, @dark-golden);
+ }
+ }
+}
+
.application.sheet.daggerheart.actor.dh-style.party .tab.partyMembers {
overflow: auto;
diff --git a/system.json b/system.json
index 9ae54190..7c1321fb 100644
--- a/system.json
+++ b/system.json
@@ -4,7 +4,7 @@
"description": "An unofficial implementation of the Daggerheart system",
"version": "2.2.5",
"compatibility": {
- "minimum": "14.361",
+ "minimum": "14.359",
"verified": "14.361",
"maximum": "14"
},
diff --git a/templates/hud/tokenHUD.hbs b/templates/hud/tokenHUD.hbs
index b620ab11..ab0872bf 100644
--- a/templates/hud/tokenHUD.hbs
+++ b/templates/hud/tokenHUD.hbs
@@ -4,6 +4,10 @@
+
+
{{#if canChangeLevel}}