From 63274d67ce11e06cc97b6aaa9632af78f2173704 Mon Sep 17 00:00:00 2001 From: Emilio Jimenez <19908114+emiliojc@users.noreply.github.com> Date: Mon, 26 May 2025 19:28:34 +0200 Subject: [PATCH 1/3] fix(class): remove damage thresholds (#66) Co-authored-by: JimCanE <6275508-jimcane@users.noreply.gitlab.com> --- module/data/class.mjs | 5 ----- templates/sheets/class.hbs | 11 ----------- 2 files changed, 16 deletions(-) diff --git a/module/data/class.mjs b/module/data/class.mjs index 2b29975f..52f6030e 100644 --- a/module/data/class.mjs +++ b/module/data/class.mjs @@ -13,11 +13,6 @@ export default class DhpClass extends foundry.abstract.TypeDataModel { uuid: new fields.StringField({}) }) ), - damageThresholds: new fields.SchemaField({ - minor: new fields.NumberField({ initial: 0, integer: true }), - major: new fields.NumberField({ initial: 0, integer: true }), - severe: new fields.NumberField({ initial: 0, integer: true }) - }), evasion: new fields.NumberField({ initial: 0, integer: true }), features: new fields.ArrayField( new fields.SchemaField({ diff --git a/templates/sheets/class.hbs b/templates/sheets/class.hbs index e88b385b..99da282d 100644 --- a/templates/sheets/class.hbs +++ b/templates/sheets/class.hbs @@ -27,17 +27,6 @@ -
- -
- - - - - - -
-
{{formField systemFields.evasion value=source.system.evasion label=(localize "DAGGERHEART.Sheets.Class.Evasion")}} {{!--
From c306c95e6bffb86be7c306792118868c9530bd0e Mon Sep 17 00:00:00 2001 From: IrkTheImp <41175833+IrkTheImp@users.noreply.github.com> Date: Mon, 26 May 2025 13:31:54 -0500 Subject: [PATCH 2/3] Issue 64 (#67) * fix pc sheet backend actions --- module/applications/ancestrySelectionDialog.mjs | 2 +- module/applications/deathMove.mjs | 2 +- module/applications/downtime.mjs | 2 +- module/applications/sheets/pc.mjs | 8 ++++---- module/applications/sheets/subclass.mjs | 4 ++-- module/data/pc.mjs | 2 +- templates/sheets/pc/sections/loadout.hbs | 11 +++++++---- 7 files changed, 17 insertions(+), 14 deletions(-) diff --git a/module/applications/ancestrySelectionDialog.mjs b/module/applications/ancestrySelectionDialog.mjs index 1ca15908..0cdb0dd9 100644 --- a/module/applications/ancestrySelectionDialog.mjs +++ b/module/applications/ancestrySelectionDialog.mjs @@ -65,7 +65,7 @@ export default class AncestrySelectionDialog extends HandlebarsApplicationMixin( } async _prepareContext(_options) { - const systemAncestries = Array.from((await game.packs.get('daggerheart.playtest-ancestries')).index).map(x => ({ + const systemAncestries = Array.from((await game.packs.get('daggerheart.ancestries')).index).map(x => ({ ...x, selected: this.data.ancestries.some(selected => selected.uuid === x.uuid) })); diff --git a/module/applications/deathMove.mjs b/module/applications/deathMove.mjs index 54622a1a..af4a0c9c 100644 --- a/module/applications/deathMove.mjs +++ b/module/applications/deathMove.mjs @@ -48,7 +48,7 @@ export default class DhpDeathMove extends HandlebarsApplicationMixin(Application const msg = new cls({ user: game.user.id, content: await renderTemplate('systems/daggerheart/templates/chat/deathMove.hbs', { - player: game.user.character.name, + player: this.actor.name, title: game.i18n.localize(this.selectedMove.name), img: this.selectedMove.img, description: game.i18n.localize(this.selectedMove.description) diff --git a/module/applications/downtime.mjs b/module/applications/downtime.mjs index 06575f80..f1da7678 100644 --- a/module/applications/downtime.mjs +++ b/module/applications/downtime.mjs @@ -71,7 +71,7 @@ export default class DhpDowntime extends HandlebarsApplicationMixin(ApplicationV const msg = new cls({ user: game.user.id, content: await renderTemplate('systems/daggerheart/templates/chat/downtime.hbs', { - player: game.user.character.name, + player: this.actor.name, title: game.i18n.localize(this.selectedActivity.name), img: this.selectedActivity.img, description: game.i18n.localize(this.selectedActivity.description), diff --git a/module/applications/sheets/pc.mjs b/module/applications/sheets/pc.mjs index 53ac00d4..dc36ba06 100644 --- a/module/applications/sheets/pc.mjs +++ b/module/applications/sheets/pc.mjs @@ -659,11 +659,11 @@ export default class PCSheet extends DaggerheartSheet(ActorSheetV2) { } static async selectClass() { - (await game.packs.get('daggerheart.playtest-classes'))?.render(true); + (await game.packs.get('daggerheart.classes'))?.render(true); } static async selectSubclass() { - (await game.packs.get('daggerheart.playtest-subclasses'))?.render(true); + (await game.packs.get('daggerheart.subclasses'))?.render(true); } static async selectAncestry() { @@ -694,7 +694,7 @@ export default class PCSheet extends DaggerheartSheet(ActorSheetV2) { } static async selectCommunity() { - (await game.packs.get('daggerheart.playtest-communities'))?.render(true); + (await game.packs.get('daggerheart.communities'))?.render(true); } static async viewObject(_, button) { @@ -702,7 +702,7 @@ export default class PCSheet extends DaggerheartSheet(ActorSheetV2) { if (!object) return; const tab = button.dataset.tab; - if (tab) object.sheet._tabs[0].active = tab; + if (tab && object.sheet._tabs) object.sheet._tabs[0].active = tab; if (object.sheet.editMode) object.sheet.editMode = false; diff --git a/module/applications/sheets/subclass.mjs b/module/applications/sheets/subclass.mjs index f456aac2..40128ab0 100644 --- a/module/applications/sheets/subclass.mjs +++ b/module/applications/sheets/subclass.mjs @@ -183,7 +183,7 @@ export default class SubclassSheet extends DaggerheartSheet(ItemSheetV2) { } async _onDrop(event) { - event.preventDefault() + event.preventDefault(); const data = TextEditor.getDragEventData(event); const item = await fromUuid(data.uuid); if (!(item.type === 'feature' && item.system.type === SYSTEM.ITEM.featureTypes.subclass.id)) return; @@ -196,7 +196,7 @@ export default class SubclassSheet extends DaggerheartSheet(ItemSheetV2) { const path = `system.${featureField}Feature.abilities`; const abilities = duplicate(getProperty(this.document, path)) || []; - const featureData = {name: item.name, img: item.img, uuid: item.uuid }; + const featureData = { name: item.name, img: item.img, uuid: item.uuid }; abilities.push(featureData); await this.document.update({ [path]: abilities }); diff --git a/module/data/pc.mjs b/module/data/pc.mjs index b68f0a03..c7aa9660 100644 --- a/module/data/pc.mjs +++ b/module/data/pc.mjs @@ -337,7 +337,7 @@ export default class DhpPC extends foundry.abstract.TypeDataModel { get refreshableFeatures() { return this.parent.items.reduce( (acc, x) => { - if (x.type === 'feature' && x.system.refreshData.type) { + if (x.type === 'feature' && x.system.refreshData?.type) { acc[x.system.refreshData.type].push(x); } diff --git a/templates/sheets/pc/sections/loadout.hbs b/templates/sheets/pc/sections/loadout.hbs index 516a9411..62d76d1e 100644 --- a/templates/sheets/pc/sections/loadout.hbs +++ b/templates/sheets/pc/sections/loadout.hbs @@ -1,8 +1,11 @@
-