diff --git a/module/applications/sheets-configs/action-config.mjs b/module/applications/sheets-configs/action-config.mjs index f991187f..ef529e9b 100644 --- a/module/applications/sheets-configs/action-config.mjs +++ b/module/applications/sheets-configs/action-config.mjs @@ -28,7 +28,7 @@ export default class DHActionConfig extends DHActionBaseConfig { game.system.api.data.activeEffects.BaseEffect.getDefaultObject({ transfer: false }) ]); - if (areaIndex !== undefined) data.area[areaIndex].effects.push(created[0]._id); + if (areaIndex !== undefined) data.areas[areaIndex].effects.push(created[0]._id); else data.effects.push({ _id: created[0]._id }); this.constructor.updateForm.bind(this)(null, null, { object: foundry.utils.flattenObject(data) }); this.action.item.effects.get(created[0]._id).sheet.render(true); @@ -58,9 +58,9 @@ export default class DHActionConfig extends DHActionBaseConfig { const { areaIndex, index } = button.dataset; let effectId = null; if (areaIndex !== undefined) { - effectId = this.action.area[areaIndex].effects[index]; + effectId = this.action.areas[areaIndex].effects[index]; const data = this.action.toObject(); - data.area[areaIndex].effects.splice(index, 1); + data.areas[areaIndex].effects.splice(index, 1); this.constructor.updateForm.call(this, null, null, { object: foundry.utils.flattenObject(data) }); } else { effectId = this.action.effects[index]._id; diff --git a/module/applications/sheets-configs/action-settings-config.mjs b/module/applications/sheets-configs/action-settings-config.mjs index fd62f621..24553069 100644 --- a/module/applications/sheets-configs/action-settings-config.mjs +++ b/module/applications/sheets-configs/action-settings-config.mjs @@ -40,7 +40,7 @@ export default class DHActionSettingsConfig extends DHActionBaseConfig { this.sheetUpdate(data, effectData); this.effects = [...this.effects, effectData]; - if (areaIndex !== undefined) data.area[areaIndex].effects.push(effectData.id); + if (areaIndex !== undefined) data.areas[areaIndex].effects.push(effectData.id); else data.effects.push({ _id: effectData.id }); this.constructor.updateForm.bind(this)(null, null, { object: foundry.utils.flattenObject(data) }); @@ -51,9 +51,9 @@ export default class DHActionSettingsConfig extends DHActionBaseConfig { const { areaIndex, index } = button.dataset; let effectId = null; if (areaIndex !== undefined) { - effectId = this.action.area[areaIndex].effects[index]; + effectId = this.action.areas[areaIndex].effects[index]; const data = this.action.toObject(); - data.area[areaIndex].effects.splice(index, 1); + data.areas[areaIndex].effects.splice(index, 1); this.constructor.updateForm.call(this, null, null, { object: foundry.utils.flattenObject(data) }); } else { effectId = this.action.effects[index]._id; diff --git a/module/canvas/placeables/regionLayer.mjs b/module/canvas/placeables/regionLayer.mjs index 0a427617..c53cf782 100644 --- a/module/canvas/placeables/regionLayer.mjs +++ b/module/canvas/placeables/regionLayer.mjs @@ -107,17 +107,16 @@ export default class DhRegionLayer extends foundry.canvas.layers.RegionLayer { const settings = canvas.scene?.rangeSettings; const rangeNumber = Number(range); - const length = - (!Number.isNaN(rangeNumber) ? rangeNumber : settings ? settings[range] : 0) * dimensionConstant; + const length = (!Number.isNaN(rangeNumber) ? rangeNumber : settings ? settings[range] : 0) * dimensionConstant; /*----*/ const shapeData = { ...canvas.mousePosition, type: type, - direction: direction ?? 0, + direction: direction ?? 0 }; - switch(type) { + switch (type) { case rectangle.id: shapeData.width = length; shapeData.height = length; diff --git a/module/data/action/baseAction.mjs b/module/data/action/baseAction.mjs index 631a1211..b3775dc9 100644 --- a/module/data/action/baseAction.mjs +++ b/module/data/action/baseAction.mjs @@ -15,7 +15,7 @@ const fields = foundry.data.fields; */ export default class DHBaseAction extends ActionMixin(foundry.abstract.DataModel) { - static extraSchemas = ['area', 'cost', 'uses', 'range']; + static extraSchemas = ['areas', 'cost', 'uses', 'range']; /** @inheritDoc */ static defineSchema() { diff --git a/module/data/fields/action/_module.mjs b/module/data/fields/action/_module.mjs index f9a2154b..f6c34817 100644 --- a/module/data/fields/action/_module.mjs +++ b/module/data/fields/action/_module.mjs @@ -1,4 +1,4 @@ -export { default as AreaField } from './areaField.mjs'; +export { default as AreasField } from './areasField.mjs'; export { default as CostField } from './costField.mjs'; export { default as CountdownField } from './countdownField.mjs'; export { default as UsesField } from './usesField.mjs'; diff --git a/module/data/fields/action/areaField.mjs b/module/data/fields/action/areasField.mjs similarity index 96% rename from module/data/fields/action/areaField.mjs rename to module/data/fields/action/areasField.mjs index a45af8dc..52110045 100644 --- a/module/data/fields/action/areaField.mjs +++ b/module/data/fields/action/areasField.mjs @@ -1,6 +1,6 @@ const fields = foundry.data.fields; -export default class AreaField extends fields.ArrayField { +export default class AreasField extends fields.ArrayField { /** * Action Workflow order */ diff --git a/module/data/fields/actionField.mjs b/module/data/fields/actionField.mjs index 7bdd75f8..83672c8e 100644 --- a/module/data/fields/actionField.mjs +++ b/module/data/fields/actionField.mjs @@ -281,7 +281,7 @@ export function ActionMixin(Base) { name: this.name, img: this.baseAction ? this.parent.parent.img : this.img, tags: this.tags ? this.tags : ['Spell', 'Arcana', 'Lv 10'], - area: this.area, + areas: this.areas, summon: this.summon }, source: { diff --git a/module/dice/dhRoll.mjs b/module/dice/dhRoll.mjs index c68e91d1..209631f6 100644 --- a/module/dice/dhRoll.mjs +++ b/module/dice/dhRoll.mjs @@ -145,7 +145,7 @@ export default class DHRoll extends Roll { roll: this, parent: chatData.parent, targetMode: chatData.targetMode, - areas: chatData.action?.area, + areas: chatData.action?.areas, metagamingSettings }); } diff --git a/module/documents/chatMessage.mjs b/module/documents/chatMessage.mjs index 2ae6beba..2e20fb87 100644 --- a/module/documents/chatMessage.mjs +++ b/module/documents/chatMessage.mjs @@ -282,14 +282,14 @@ export default class DhpChatMessage extends foundry.documents.ChatMessage { ); }; - if (this.system.action.area.length === 1) createArea(this.system.action.area[0]); - else if (this.system.action.area.length > 1) { + if (this.system.action.areas.length === 1) createArea(this.system.action.areas[0]); + else if (this.system.action.areas.length > 1) { new foundry.applications.ux.ContextMenu.implementation( event.target, '.action-areas', - this.system.action.area.map((area, index) => ({ + this.system.action.areas.map(area => ({ label: area.name, - onClick: () => createArea(this.system.action.area[index]) + onClick: () => createArea(area) })), { jQuery: false, diff --git a/module/systemRegistration/handlebars.mjs b/module/systemRegistration/handlebars.mjs index 7f701b59..1b08e0ad 100644 --- a/module/systemRegistration/handlebars.mjs +++ b/module/systemRegistration/handlebars.mjs @@ -29,7 +29,7 @@ export const preloadHandlebarsTemplates = async function () { 'systems/daggerheart/templates/actionTypes/uses.hbs', 'systems/daggerheart/templates/actionTypes/roll.hbs', 'systems/daggerheart/templates/actionTypes/save.hbs', - 'systems/daggerheart/templates/actionTypes/area.hbs', + 'systems/daggerheart/templates/actionTypes/areas.hbs', 'systems/daggerheart/templates/actionTypes/cost.hbs', 'systems/daggerheart/templates/actionTypes/range-target.hbs', 'systems/daggerheart/templates/actionTypes/effect.hbs', diff --git a/templates/actionTypes/area.hbs b/templates/actionTypes/areas.hbs similarity index 86% rename from templates/actionTypes/area.hbs rename to templates/actionTypes/areas.hbs index bb4a3e05..2e010c72 100644 --- a/templates/actionTypes/area.hbs +++ b/templates/actionTypes/areas.hbs @@ -1,4 +1,4 @@ -
+
{{localize "DAGGERHEART.ACTIONS.Config.area.sectionTitle"}} @@ -7,13 +7,13 @@ {{#each source as |area index|}} {{#unless @first}}{{/unless}}
- {{formField ../fields.name value=area.name name=(concat "area." index ".name") localize=true}} + {{formField ../fields.name value=area.name name=(concat "areas." index ".name") localize=true}}
- {{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}} + {{formField ../fields.type value=area.type name=(concat "areas." index ".type") localize=true}} + {{formField ../fields.shape value=area.shape name=(concat "areas." index ".shape") localize=true}} + {{formField ../fields.size value=area.size name=(concat "areas." index ".size") localize=true}}
@@ -22,7 +22,7 @@
{{#each area.effects as |effectId index|}} - +
diff --git a/templates/sheets-settings/action-settings/configuration.hbs b/templates/sheets-settings/action-settings/configuration.hbs index 4cd0e3a8..8df528c9 100644 --- a/templates/sheets-settings/action-settings/configuration.hbs +++ b/templates/sheets-settings/action-settings/configuration.hbs @@ -6,5 +6,5 @@ {{> 'systems/daggerheart/templates/actionTypes/uses.hbs' fields=fields.uses.fields source=source.uses}} {{> 'systems/daggerheart/templates/actionTypes/cost.hbs' fields=fields.cost.element.fields source=source.cost costOptions=costOptions}} {{> 'systems/daggerheart/templates/actionTypes/range-target.hbs' fields=(object range=fields.range target=fields.target.fields) source=(object target=source.target range=source.range)}} - {{> 'systems/daggerheart/templates/actionTypes/area.hbs' fields=fields.area.element.fields source=source.area}} + {{> 'systems/daggerheart/templates/actionTypes/areas.hbs' fields=fields.areas.element.fields source=source.areas}} \ No newline at end of file diff --git a/templates/ui/chat/ability-use.hbs b/templates/ui/chat/ability-use.hbs index e9f2c22c..a8481dfb 100644 --- a/templates/ui/chat/ability-use.hbs +++ b/templates/ui/chat/ability-use.hbs @@ -24,7 +24,6 @@ {{localize "DAGGERHEART.GENERAL.damage"}} {{/if}} - {{!-- {{#if action.cost.value}}
{{action.cost.value}} {{action.cost.type}}
{{/if}} --}} {{/each}}
\ No newline at end of file diff --git a/templates/ui/chat/action.hbs b/templates/ui/chat/action.hbs index 00d01040..51840363 100644 --- a/templates/ui/chat/action.hbs +++ b/templates/ui/chat/action.hbs @@ -26,7 +26,7 @@ {{/if}}
- {{#if action.area.length}} + {{#if action.areas.length}}