diff --git a/module/applications/sheets-configs/action-config.mjs b/module/applications/sheets-configs/action-config.mjs index 35d26342..e4bda6a6 100644 --- a/module/applications/sheets-configs/action-config.mjs +++ b/module/applications/sheets-configs/action-config.mjs @@ -132,7 +132,7 @@ export default class DHActionConfig extends DaggerheartSheet(ApplicationV2) { disableOption(index, options, choices) { const filtered = foundry.utils.deepClone(options); Object.keys(filtered).forEach(o => { - if (choices.find((c, idx) => c.type === o && index !== idx)) delete filtered[o]; + if (choices.find((c, idx) => c.type === o && index !== idx)) filtered[o].disabled = true; }); return filtered; } @@ -181,11 +181,11 @@ export default class DHActionConfig extends DaggerheartSheet(ApplicationV2) { this.constructor.updateForm.bind(this)(null, null, { object: foundry.utils.flattenObject(data) }); } - static removeElement(event) { + static removeElement(event, button) { event.stopPropagation(); const data = this.action.toObject(), key = event.target.closest('[data-key]').dataset.key, - index = event.target.dataset.index; + index = button.dataset.index; data[key].splice(index, 1); this.constructor.updateForm.bind(this)(null, null, { object: foundry.utils.flattenObject(data) }); } @@ -197,10 +197,10 @@ export default class DHActionConfig extends DaggerheartSheet(ApplicationV2) { this.constructor.updateForm.bind(this)(null, null, { object: foundry.utils.flattenObject(data) }); } - static removeDamage(event) { + static removeDamage(event, button) { if (!this.action.damage.parts) return; const data = this.action.toObject(), - index = event.target.dataset.index; + index = button.dataset.index; data.damage.parts.splice(index, 1); this.constructor.updateForm.bind(this)(null, null, { object: foundry.utils.flattenObject(data) }); } @@ -229,9 +229,9 @@ export default class DHActionConfig extends DaggerheartSheet(ApplicationV2) { }; } - static removeEffect(event) { + static removeEffect(event, button) { if (!this.action.effects) return; - const index = event.target.dataset.index, + const index = button.dataset.index, effectId = this.action.effects[index]._id; this.constructor.removeElement.bind(this)(event); this.action.item.deleteEmbeddedDocuments('ActiveEffect', [effectId]); diff --git a/module/dice/d20Roll.mjs b/module/dice/d20Roll.mjs index fab2c06d..c344231f 100644 --- a/module/dice/d20Roll.mjs +++ b/module/dice/d20Roll.mjs @@ -118,7 +118,7 @@ export default class D20Roll extends DHRoll { applyAdvantage() { this.d20.modifiers.findSplice(m => ['kh', 'kl'].includes(m)); - if (!this.hasAdvantage && !this.hasDisadvantage) this.number = 1; + if (!this.hasAdvantage && !this.hasDisadvantage) this.d20.number = 1; else { this.d20.number = 2; this.d20.modifiers.push(this.hasAdvantage ? 'kh' : 'kl'); diff --git a/styles/daggerheart.css b/styles/daggerheart.css index 40e711c9..8fd6142e 100755 --- a/styles/daggerheart.css +++ b/styles/daggerheart.css @@ -5795,6 +5795,9 @@ body.theme-light.application.daggerheart.dialog { border-radius: 6px; border: none; } +.application.dh-style fieldset .nest-inputs > .checkbox { + align-self: end; +} .application.dh-style fieldset .form-group { width: 100%; } @@ -5805,6 +5808,8 @@ body.theme-light.application.daggerheart.dialog { } .application.dh-style fieldset .form-group.checkbox { width: fit-content; + display: flex; + align-items: center; } .application.dh-style fieldset .form-group.checkbox .form-fields { height: 32px; diff --git a/styles/less/global/elements.less b/styles/less/global/elements.less index bd06441b..2adc28c4 100755 --- a/styles/less/global/elements.less +++ b/styles/less/global/elements.less @@ -236,6 +236,10 @@ border-radius: 6px; border: none; } + + > .checkbox { + align-self: end; + } } .form-group { @@ -248,7 +252,8 @@ &.checkbox { width: fit-content; - + display: flex; + align-items: center; .form-fields { height: 32px; align-content: center; diff --git a/templates/actionTypes/damage.hbs b/templates/actionTypes/damage.hbs index ad0a70e6..26964a4a 100644 --- a/templates/actionTypes/damage.hbs +++ b/templates/actionTypes/damage.hbs @@ -32,17 +32,17 @@ {{/if}} {{#if (and (not @root.isNPC) @root.hasRoll (not dmg.base) dmg.resultBased)}}
-
+
With Hope {{> formula fields=../../fields.value.fields type=../../fields.type dmg=dmg source=dmg.value target="value" realIndex=realIndex}}
-
+
With Fear {{> formula fields=../../fields.valueAlt.fields type=../../fields.type dmg=dmg source=dmg.valueAlt target="valueAlt" realIndex=realIndex}}
{{else}} - + {{> formula fields=../../fields.value.fields type=../fields.type dmg=dmg source=dmg.value target="value" realIndex=realIndex}} {{/if}}