diff --git a/module/canvas/placeables/token.mjs b/module/canvas/placeables/token.mjs index 04d1c3c0..58157a85 100644 --- a/module/canvas/placeables/token.mjs +++ b/module/canvas/placeables/token.mjs @@ -21,7 +21,7 @@ export default class DhTokenPlaceable extends foundry.canvas.placeables.Token { this.effects.overlay = null; // Categorize effects - const activeEffects = getIconVisibleActiveEffects(Array.from(this.actor?.allApplicableEffects() ?? [])); + const activeEffects = getIconVisibleActiveEffects(Array.from(this.actor?.getActiveEffects() ?? [])); const overlayEffect = activeEffects.findLast(e => e.img && e.getFlag?.('core', 'overlay')); // Draw effects diff --git a/module/documents/tooltipManager.mjs b/module/documents/tooltipManager.mjs index 4793f1f7..21a5a10a 100644 --- a/module/documents/tooltipManager.mjs +++ b/module/documents/tooltipManager.mjs @@ -182,7 +182,7 @@ export default class DhTooltipManager extends foundry.helpers.interaction.Toolti ); html = content; } - if (text && html) throw new Error('Cannot provide both text and html options to TooltipManager#activate.'); + // Deactivate currently active element this.deactivate(); // Check if the element still exists in the DOM. diff --git a/module/helpers/handlebarsHelper.mjs b/module/helpers/handlebarsHelper.mjs index 1c47f8dc..faf6d7c4 100644 --- a/module/helpers/handlebarsHelper.mjs +++ b/module/helpers/handlebarsHelper.mjs @@ -49,7 +49,7 @@ export default class RegisterHandlebarsHelpers { } static damageSymbols(damageParts) { - const symbols = [...new Set(damageParts.map(x => x.type))].map(p => CONFIG.DH.GENERAL.damageTypes[p].icon); + const symbols = new Set(...damageParts.map(x => x.type)).map(p => CONFIG.DH.GENERAL.damageTypes[p].icon); return new Handlebars.SafeString(Array.from(symbols).map(symbol => ``)); } diff --git a/module/helpers/utils.mjs b/module/helpers/utils.mjs index 5a29de69..61521127 100644 --- a/module/helpers/utils.mjs +++ b/module/helpers/utils.mjs @@ -542,10 +542,7 @@ export function getIconVisibleActiveEffects(effects) { return effects.filter(effect => { if (!(effect instanceof game.system.api.documents.DhActiveEffect)) return true; - const alwaysShown = effect.showIcon === CONST.ACTIVE_EFFECT_SHOW_ICON.ALWAYS; - const conditionalShown = effect.showIcon === CONST.ACTIVE_EFFECT_SHOW_ICON.CONDITIONAL && !effect.transfer; // TODO: system specific logic - - return !effect.active && (alwaysShown || conditionalShown); + return effect.active && effect.showIcon >= CONST.ACTIVE_EFFECT_SHOW_ICON.CONDITIONAL; }); } export async function getFeaturesHTMLData(features) { diff --git a/templates/sheets/activeEffect/conditionals.hbs b/templates/sheets/activeEffect/conditionals.hbs index cf36e13b..637ac33c 100644 --- a/templates/sheets/activeEffect/conditionals.hbs +++ b/templates/sheets/activeEffect/conditionals.hbs @@ -22,7 +22,7 @@