Skip to content

Commit

Permalink
System release 0.5.9
Browse files Browse the repository at this point in the history
  • Loading branch information
aaclayton committed Sep 24, 2023
1 parent d5b0b4c commit 4eb3cb5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
14 changes: 5 additions & 9 deletions module/applications/config/action.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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
},
Expand Down
2 changes: 1 addition & 1 deletion system.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions templates/config/partials/action-effect.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
<div class="form-group">
<label>Duration</label>
<div class="form-fields">
<input type="number" name="effects.{{i}}.duration.rounds" min="1" step="1" value="{{effect.duration.rounds}}">
<label>Rounds</label>
<input type="number" name="effects.{{i}}.duration.turns" min="1" step="1" value="{{effect.duration.turns}}">
<label>Turns</label>
</div>
</div>
</fieldset>

0 comments on commit 4eb3cb5

Please sign in to comment.