diff --git a/module/applications/sheets-configs/action-config.mjs b/module/applications/sheets-configs/action-config.mjs index 52067411..e3117b6e 100644 --- a/module/applications/sheets-configs/action-config.mjs +++ b/module/applications/sheets-configs/action-config.mjs @@ -25,7 +25,7 @@ export default class DHActionConfig extends DHActionBaseConfig { const data = this.action.toObject(); const created = await this.action.item.createEmbeddedDocuments('ActiveEffect', [ - game.system.api.data.activeEffects.BaseEffect.getDefaultObject({ transfer: false }) + game.system.api.data.activeEffects.BaseEffect.getDefaultObject() ]); if (areaIndex !== undefined) diff --git a/module/applications/sheets-configs/action-settings-config.mjs b/module/applications/sheets-configs/action-settings-config.mjs index e525269f..9cb866bc 100644 --- a/module/applications/sheets-configs/action-settings-config.mjs +++ b/module/applications/sheets-configs/action-settings-config.mjs @@ -31,38 +31,21 @@ export default class DHActionSettingsConfig extends DHActionBaseConfig { } static async addEffect(_event) { - const { areaIndex } = event.target.dataset; if (!this.action.effects) return; - - const effectData = game.system.api.data.activeEffects.BaseEffect.getDefaultObject({ transfer: false }); + const effectData = game.system.api.data.activeEffects.BaseEffect.getDefaultObject(); const data = this.action.toObject(); this.sheetUpdate(data, effectData); this.effects = [...this.effects, effectData]; - - if(areaIndex !== undefined) - data.area[areaIndex].effects.push(effectData.id); - else - data.effects.push({ _id: effectData.id }); - + data.effects.push({ _id: effectData.id }); this.constructor.updateForm.bind(this)(null, null, { object: foundry.utils.flattenObject(data) }); } static removeEffect(event, button) { if (!this.action.effects) return; - const { areaIndex, index } = button.dataset; - let effectId = null; - if (areaIndex !== undefined) { - effectId = this.action.area[areaIndex].effects[index]; - const data = this.action.toObject(); - data.area[areaIndex].effects.splice(index, 1); - this.constructor.updateForm.bind(this)(null, null, { object: foundry.utils.flattenObject(data) }); - } else { + const index = button.dataset.index, effectId = this.action.effects[index]._id; - this.constructor.removeElement.bind(this)(event, button); - } - - + this.constructor.removeElement.bind(this)(event, button); this.sheetUpdate( this.action.toObject(), this.effects.find(x => x.id === effectId), diff --git a/module/data/action/attackAction.mjs b/module/data/action/attackAction.mjs index 5e93d70b..a2d47309 100644 --- a/module/data/action/attackAction.mjs +++ b/module/data/action/attackAction.mjs @@ -51,7 +51,7 @@ export default class DHAttackAction extends DHDamageAction { async use(event, options) { const result = await super.use(event, options); - if (result?.message?.system.action.roll?.type === 'attack') { + if (result.message?.system.action.roll?.type === 'attack') { const { updateCountdowns } = game.system.api.applications.ui.DhCountdowns; await updateCountdowns(CONFIG.DH.GENERAL.countdownProgressionTypes.characterAttack.id); } diff --git a/module/data/activeEffect/baseEffect.mjs b/module/data/activeEffect/baseEffect.mjs index 46de63b0..e60cc024 100644 --- a/module/data/activeEffect/baseEffect.mjs +++ b/module/data/activeEffect/baseEffect.mjs @@ -134,14 +134,13 @@ export default class BaseEffect extends foundry.data.ActiveEffectTypeDataModel { return armorChange.getArmorData(); } - static getDefaultObject(options = { transfer: true }) { + static getDefaultObject() { return { name: 'New Effect', id: foundry.utils.randomID(), disabled: false, img: 'icons/magic/life/heart-cross-blue.webp', description: '', - transfer: options.transfer, statuses: [], changes: [], system: { diff --git a/module/data/regionBehavior/applyActiveEffect.mjs b/module/data/regionBehavior/applyActiveEffect.mjs index 4be262c2..0fc60bc2 100644 --- a/module/data/regionBehavior/applyActiveEffect.mjs +++ b/module/data/regionBehavior/applyActiveEffect.mjs @@ -1,7 +1,7 @@ export default class DhApplyActiveEffect extends CONFIG.RegionBehavior.dataModels.applyActiveEffect { static async #getApplicableEffects(token) { - const effects = await Promise.all(this.effects.map(foundry.utils.fromUuid)); - return effects.filter(effect => !effect.system.targetDispositions.size || effect.system.targetDispositions.has(token.disposition)); + const effects = await Promise.all(this.effects.map(fromUuid)); + return (effects).filter(effect => !effect.system.targetDispositions.size || effect.system.targetDispositions.has(token.disposition)); } static async #onTokenEnter(event) { diff --git a/module/helpers/handlebarsHelper.mjs b/module/helpers/handlebarsHelper.mjs index 80e8df92..3caf63a3 100644 --- a/module/helpers/handlebarsHelper.mjs +++ b/module/helpers/handlebarsHelper.mjs @@ -17,6 +17,7 @@ export default class RegisterHandlebarsHelpers { pluralize: this.pluralize, positive: this.positive, isNullish: this.isNullish, + debug: this.debug, }); } static add(a, b) { @@ -92,4 +93,9 @@ export default class RegisterHandlebarsHelpers { static isNullish(a) { return a === null || a === undefined; } + + static debug(a) { + console.log(a); + return a; + } } diff --git a/styles/less/global/inventory-item.less b/styles/less/global/inventory-item.less index a2b9ebd8..4bd4d0bb 100644 --- a/styles/less/global/inventory-item.less +++ b/styles/less/global/inventory-item.less @@ -24,15 +24,6 @@ width: 100%; list-style-type: none; - &.bordered { - border: 1px solid; - border-radius: 6px; - - .inventory-item-header .img-portait img.item-img { - border-radius: 6px 0 0 6px; - } - } - &:not(.single-img) { .img-portait:has(.roll-img):hover { .roll-img { diff --git a/styles/less/sheets/actions/actions.less b/styles/less/sheets/actions/actions.less index 485f8e91..5a18d622 100644 --- a/styles/less/sheets/actions/actions.less +++ b/styles/less/sheets/actions/actions.less @@ -147,10 +147,4 @@ padding-bottom: 7px; } } - - .sub-section-header { - display: flex; - align-items: center; - gap: 4px; - } } diff --git a/templates/actionTypes/area.hbs b/templates/actionTypes/area.hbs index 810e67b9..ffdd4b76 100644 --- a/templates/actionTypes/area.hbs +++ b/templates/actionTypes/area.hbs @@ -5,23 +5,21 @@ {{#each source as |area index|}} - {{#unless @first}}{{/unless}}
{{formField ../fields.type value=area.type name=(concat "area." index ".type") localize=true}} {{formField ../fields.shape value=area.shape name=(concat "area." index ".shape") localize=true}} {{formField ../fields.size value=area.size name=(concat "area." index ".size") localize=true}}
- -
- {{localize "DAGGERHEART.GENERAL.Effect.plural"}} - -
-
+
+
+ {{localize "DAGGERHEART.GENERAL.Effect.plural"}} + +
{{#each area.effects as |effectId index|}} - + -
+
{{#with (@root.getEffectDetails effectId) as | details |}}
@@ -31,8 +29,9 @@
{{name}}
{{/with}} +
- +
diff --git a/templates/settings/downtime-config/actions.hbs b/templates/settings/downtime-config/actions.hbs index feb05302..d197f983 100644 --- a/templates/settings/downtime-config/actions.hbs +++ b/templates/settings/downtime-config/actions.hbs @@ -8,7 +8,7 @@
{{#each move.actions as |action|}} - {{> "systems/daggerheart/templates/settings/components/settings-item-line.hbs" id=action.id type="action" }} + {{> "systems/daggerheart/templates/settings/components/settings-item-line.hbs" id=action.id }} {{/each}}