mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-04-21 23:13:39 +02:00
Fixes
This commit is contained in:
parent
f605ea7035
commit
18d9870ccf
5 changed files with 6 additions and 9 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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 => `<i class="fa-solid ${symbol}"></i>`));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
<label>{{localize "EFFECT.FIELDS.changes.element.key.label"}}</label>
|
||||
|
||||
<div class="form-fields">
|
||||
<select name="{{concat "system.conditionals." index ".key"}}">
|
||||
<select {{#if (eq conditional.type 'status')}}name="{{concat "system.conditionals." index ".key"}}"{{/if}}>
|
||||
{{selectOptions ../statusChoices selected=conditional.key labelAttr="label" valueAttr="id" blank="" localize=true}}
|
||||
</select>
|
||||
</div>
|
||||
|
|
@ -32,7 +32,7 @@
|
|||
<label>{{localize "EFFECT.FIELDS.changes.element.key.label"}}</label>
|
||||
|
||||
<div class="form-fields">
|
||||
<input type="text" class="effect-change-input" name="{{concat "system.conditionals." index ".key"}}" value="{{conditional.key}}" />
|
||||
<input type="text" class="effect-change-input" {{#if (eq conditional.type 'attribute')}}name="{{concat "system.conditionals." index ".key"}}"{{/if}} value="{{conditional.key}}" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue