diff --git a/module/applications/config/action.mjs b/module/applications/config/action.mjs index 4a279f30..dfa81d85 100644 --- a/module/applications/config/action.mjs +++ b/module/applications/config/action.mjs @@ -55,7 +55,7 @@ export default class ActionConfig extends CrucibleSheetMixin(DocumentSheet) { async getData(options) { await loadTemplates(Object.values(this.constructor.partials)); return { - action: this.action, + action: this.action.toObject(), // Configure source data editable: this.isEditable, tags: this.#prepareTags(), actionHookChoices: Object.keys(SYSTEM.ACTION_HOOKS).reduce((obj, k) => { @@ -130,12 +130,8 @@ export default class ActionConfig extends CrucibleSheetMixin(DocumentSheet) { /** @override */ _getSubmitData(updateData) { const formData = foundry.utils.expandObject(super._getSubmitData(updateData)); - if ( "actionHooks" in formData ) { - formData.actionHooks = Object.values(formData.actionHooks || {}); - } - if ( "effects" in formData ) { - formData.effects = Object.values(formData.effects || {}); - } + formData.actionHooks = Object.values(formData.actionHooks || {}); + formData.effects = Object.values(formData.effects || {}); return formData; } @@ -176,12 +172,12 @@ export default class ActionConfig extends CrucibleSheetMixin(DocumentSheet) { */ async #onAddEffect(event,button) { const html = await renderTemplate(this.constructor.partials.effect, { - i: this.action.effects.length, + i: foundry.utils.randomID(), // Could be anything effect: { scope: SYSTEM.ACTION.TARGET_SCOPES.ENEMIES, placeholder: this.action.name, duration: { - rounds: 1 + turns: 1 }, statuses: CONFIG.statusEffects }, diff --git a/system.json b/system.json index c1c48a13..6c1f85cf 100644 --- a/system.json +++ b/system.json @@ -2,7 +2,7 @@ "id": "crucible", "title": "Crucible", "description": "Crucible is an innovative and modern tabletop role-playing game system built exclusively for Foundry Virtual Tabletop as a digital platform. From the ground up, Crucible is designed to leverage the unique capabilities of Foundry VTT to provide gamemasters with a powerful toolset and effortless layers of automation, allowing gamemasters and players to focus on what matters most: telling a compelling story.", - "version": "0.5.8", + "version": "0.5.9", "manifest": "#{MANIFEST}#", "download": "#{DOWNLOAD}#", "url": "https://foundryvtt.com/packages/crucible", diff --git a/templates/config/partials/action-effect.hbs b/templates/config/partials/action-effect.hbs index f0d0ba43..2fc86840 100644 --- a/templates/config/partials/action-effect.hbs +++ b/templates/config/partials/action-effect.hbs @@ -27,8 +27,8 @@
- - + +