Skip to content

Commit

Permalink
Fix overlayEffect deprecation warning
Browse files Browse the repository at this point in the history
Fix #250
  • Loading branch information
mclemente committed Jul 10, 2024
1 parent 4a9820c commit c358935
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 22 deletions.
6 changes: 2 additions & 4 deletions src/module/logic.js
Original file line number Diff line number Diff line change
Expand Up @@ -460,10 +460,8 @@ export class HealthEstimate {
tokenEffectsPath(token) {
const deadIcon = this.estimationProvider.deathMarker.config
? this.deathMarker
: CONFIG.statusEffects.find((x) => x.id === "dead")?.icon ?? this.deathMarker;
return Array.from(token.actor.effects.values()).some((x) => x.icon === deadIcon)
|| token.document.overlayEffect === deadIcon
|| token.document.overlayEffect === "icons/svg/skull.svg";
: CONFIG.statusEffects.find((x) => x.id === "dead")?.img ?? this.deathMarker;
return Array.from(token.actor.effects.values()).some((x) => x.img === deadIcon);
}

/**
Expand Down
6 changes: 0 additions & 6 deletions src/module/providers/D35E.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,6 @@ export default class D35EEstimationProvider extends EstimationProvider {
return (hp.value - addNonlethal + addTemp) / hp.max;
}

tokenEffects(token) {
const deadIcons = CONFIG.statusEffects.filter((x) => x.id === "dead").map((x) => x.icon);
return Array.from(token.actor.effects.values()).some((x) => deadIcons.includes(x.icon))
|| deadIcons.includes(token.document.overlayEffect);
}

get settings() {
return {
"PF1.addNonlethal": {
Expand Down
4 changes: 0 additions & 4 deletions src/module/providers/dsa5.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,4 @@ export default class dsa5EstimationProvider extends EstimationProvider {
let hp = token.actor.system.status.wounds;
return hp.value / hp.max;
}

tokenEffects(token) {
return token.document.overlayEffect === game.healthEstimate.deathMarker;
}
}
4 changes: 0 additions & 4 deletions src/module/providers/dungeonworld.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,4 @@ export default class dungeonworldEstimationProvider extends EstimationProvider {
get breakCondition() {
return "|| (game.settings.get('healthEstimate', 'core.breakOnZeroMaxHP') && token.actor.system.attributes.hp.max === 0)";
}

tokenEffects(token) {
return token.document.overlayEffect === game.healthEstimate.deathMarker;
}
}
4 changes: 0 additions & 4 deletions src/module/providers/pf2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,4 @@ export default class pf2eEstimationProvider extends EstimationProvider {
|| token.actor.type === 'party'
|| (game.settings.get('healthEstimate', 'core.breakOnZeroMaxHP') && token.actor.system.attributes.hp.max === 0)`;
}

tokenEffects(token) {
return token.document.overlayEffect === game.healthEstimate.deathMarker;
}
}

0 comments on commit c358935

Please sign in to comment.