From baa72ff461f7173a8ec14e22978a9c8b06641b35 Mon Sep 17 00:00:00 2001 From: WBHarry Date: Sun, 12 Apr 2026 11:06:44 +0200 Subject: [PATCH 1/5] Added saefety to updateActorsRangeDepenedentEffects --- daggerheart.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daggerheart.mjs b/daggerheart.mjs index abe12524..a55fb9f3 100644 --- a/daggerheart.mjs +++ b/daggerheart.mjs @@ -410,7 +410,7 @@ const updateActorsRangeDependentEffects = async token => { CONFIG.DH.SETTINGS.gameSettings.variantRules ).rangeMeasurement; - for (let effect of token.actor?.allApplicableEffects() ?? []) { + for (let effect of token.actor?.allApplicableEffects?.() ?? []) { if (!effect.system.rangeDependence?.enabled) continue; const { target, range, type } = effect.system.rangeDependence; From 882143c1bb7da919324d9fb48c3105143e6e5203 Mon Sep 17 00:00:00 2001 From: WBHarry Date: Sun, 12 Apr 2026 11:22:25 +0200 Subject: [PATCH 2/5] Corrected updateActorsRangeDependentEffects when token is null --- daggerheart.mjs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/daggerheart.mjs b/daggerheart.mjs index a55fb9f3..84ce2779 100644 --- a/daggerheart.mjs +++ b/daggerheart.mjs @@ -405,12 +405,14 @@ Hooks.on('chatMessage', (_, message) => { }); const updateActorsRangeDependentEffects = async token => { + if (!token) return; + const rangeMeasurement = game.settings.get( CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.variantRules ).rangeMeasurement; - for (let effect of token.actor?.allApplicableEffects?.() ?? []) { + for (let effect of token.actor?.allApplicableEffects() ?? []) { if (!effect.system.rangeDependence?.enabled) continue; const { target, range, type } = effect.system.rangeDependence; From f66088971d291c30276f7875f3200087d6d4d6ee Mon Sep 17 00:00:00 2001 From: WBHarry Date: Sun, 12 Apr 2026 11:33:49 +0200 Subject: [PATCH 3/5] Improved beastform translation structure --- lang/en.json | 4 +--- module/data/fields/action/beastformField.mjs | 3 ++- templates/actionTypes/beastform.hbs | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/lang/en.json b/lang/en.json index 1766b218..dd2f31ab 100755 --- a/lang/en.json +++ b/lang/en.json @@ -87,9 +87,7 @@ }, "Config": { "beastform": { - "exact": "Beastform Max Tier", - "exactHint": "The Character's Tier is used if empty", - "label": "Beastform" + "exact": { "label": "Beastform Max Tier", "hint": "The Character's Tier is used if empty" } }, "countdown": { "defaultOwnership": "Default Ownership", diff --git a/module/data/fields/action/beastformField.mjs b/module/data/fields/action/beastformField.mjs index e19807c7..5e9c75f0 100644 --- a/module/data/fields/action/beastformField.mjs +++ b/module/data/fields/action/beastformField.mjs @@ -28,7 +28,8 @@ export default class BeastformField extends fields.SchemaField { { 1: game.i18n.localize('DAGGERHEART.GENERAL.Tiers.1') } ); }, - hint: 'DAGGERHEART.ACTIONS.Config.beastform.exactHint' + label: 'DAGGERHEART.ACTIONS.Config.beastform.exact.label', + hint: 'DAGGERHEART.ACTIONS.Config.beastform.exact.hint' }) }) }; diff --git a/templates/actionTypes/beastform.hbs b/templates/actionTypes/beastform.hbs index b9bea445..3dcdb006 100644 --- a/templates/actionTypes/beastform.hbs +++ b/templates/actionTypes/beastform.hbs @@ -1,4 +1,4 @@
- {{localize "DAGGERHEART.ACTIONS.Config.beastform.label"}} + {{localize "DAGGERHEART.ACTIONS.TYPES.beastform.name"}} {{formGroup fields.tierAccess.fields.exact value=source.tierAccess.exact name="beastform.tierAccess.exact" labelAttr="label" valueAttr="key" localize=true blank=""}}
\ No newline at end of file From cc5bfbe27d5a5e679b101fae80a4f8cdc05ef9fd Mon Sep 17 00:00:00 2001 From: WBHarry <89362246+WBHarry@users.noreply.github.com> Date: Sun, 12 Apr 2026 11:38:37 +0200 Subject: [PATCH 4/5] Fixed more missing translations (#1793) --- lang/en.json | 20 ++++++++++++----- module/applications/ui/itemBrowser.mjs | 2 +- module/config/itemBrowserConfig.mjs | 22 +++++++++++-------- .../footer.hbs | 2 +- templates/sheets/items/weapon/header.hbs | 4 ++-- templates/ui/tooltip/battlepoints.hbs | 6 ++--- templates/ui/tooltip/weapon.hbs | 2 +- 7 files changed, 36 insertions(+), 22 deletions(-) diff --git a/lang/en.json b/lang/en.json index dd2f31ab..d4ed02c6 100755 --- a/lang/en.json +++ b/lang/en.json @@ -71,9 +71,7 @@ "name": "Summon", "tooltip": "Create tokens in the scene.", "error": "You do not have permission to summon tokens or there is no active scene.", - "invalidDrop": "You can only drop Actor entities to summon.", - "chatMessageTitle": "Test2", - "chatMessageHeaderTitle": "Summoning" + "invalidDrop": "You can only drop Actor entities to summon." }, "transform": { "name": "Transform", @@ -1916,6 +1914,10 @@ "hint": "Multiply any damage dealt to you by this number" } }, + "Battlepoints": { + "full": "Battlepoints", + "short": "BP" + }, "Bonuses": { "rest": { "downtimeAction": "Downtime Action", @@ -2352,6 +2354,7 @@ "rollDamage": "Roll Damage", "rollWith": "{roll} Roll", "save": "Save", + "saveSettings": "Save Settings", "scalable": "Scalable", "scars": "Scars", "situationalBonus": "Situational Bonus", @@ -2506,8 +2509,14 @@ }, "Weapon": { "weaponType": "Weapon Type", - "primaryWeapon": "Primary Weapon", - "secondaryWeapon": "Secondary Weapon" + "primaryWeapon": { + "full": "Primary Weapon", + "short": "Primary" + }, + "secondaryWeapon": { + "full": "Secondary Weapon", + "short": "Secondary" + } } }, "MACROS": { @@ -2968,6 +2977,7 @@ }, "ItemBrowser": { "title": "Daggerheart Compendium Browser", + "windowTitle": "Compendium Browser", "hint": "Select a Folder in sidebar to start browsing through the compendium", "browserSettings": "Browser Settings", "columnName": "Name", diff --git a/module/applications/ui/itemBrowser.mjs b/module/applications/ui/itemBrowser.mjs index 9ca328a0..22de38ab 100644 --- a/module/applications/ui/itemBrowser.mjs +++ b/module/applications/ui/itemBrowser.mjs @@ -37,7 +37,7 @@ export class ItemBrowser extends HandlebarsApplicationMixin(ApplicationV2) { tag: 'div', window: { frame: true, - title: 'Compendium Browser', + title: 'DAGGERHEART.UI.ItemBrowser.windowTitle', icon: 'fa-solid fa-book-atlas', positioned: true, resizable: true diff --git a/module/config/itemBrowserConfig.mjs b/module/config/itemBrowserConfig.mjs index 0a4154a8..f20e56d0 100644 --- a/module/config/itemBrowserConfig.mjs +++ b/module/config/itemBrowserConfig.mjs @@ -74,12 +74,13 @@ export const typeConfig = { columns: [ { key: 'type', - label: 'DAGGERHEART.GENERAL.type' + label: 'DAGGERHEART.GENERAL.type', + format: type => type ? `TYPES.Item.${type}` : '-' }, { key: 'system.secondary', label: 'DAGGERHEART.UI.ItemBrowser.subtype', - format: isSecondary => (isSecondary ? 'secondary' : isSecondary === false ? 'primary' : '-') + format: isSecondary => (isSecondary ? 'DAGGERHEART.ITEMS.Weapon.secondaryWeapon.short' : isSecondary === false ? 'DAGGERHEART.ITEMS.Weapon.primaryWeapon.short' : '-') }, { key: 'system.tier', @@ -99,8 +100,8 @@ export const typeConfig = { key: 'system.secondary', label: 'DAGGERHEART.UI.ItemBrowser.subtype', choices: [ - { value: false, label: 'DAGGERHEART.ITEMS.Weapon.primaryWeapon' }, - { value: true, label: 'DAGGERHEART.ITEMS.Weapon.secondaryWeapon' } + { value: false, label: 'DAGGERHEART.ITEMS.Weapon.primaryWeapon.full' }, + { value: true, label: 'DAGGERHEART.ITEMS.Weapon.secondaryWeapon.full' } ] }, { @@ -258,11 +259,13 @@ export const typeConfig = { columns: [ { key: 'system.type', - label: 'DAGGERHEART.GENERAL.type' + label: 'DAGGERHEART.GENERAL.type', + format: type => type ? `DAGGERHEART.CONFIG.DomainCardTypes.${type}` : '-' }, { key: 'system.domain', - label: 'DAGGERHEART.GENERAL.Domain.single' + label: 'DAGGERHEART.GENERAL.Domain.single', + format: domain => domain ? CONFIG.DH.DOMAIN.allDomains()[domain].label : '-' }, { key: 'system.level', @@ -374,7 +377,7 @@ export const typeConfig = { columns: [ { key: 'system.linkedClass', - label: 'Class', + label: 'TYPES.Item.class', format: linkedClass => linkedClass?.name ?? 'DAGGERHEART.UI.ItemBrowser.missing' }, { @@ -386,7 +389,7 @@ export const typeConfig = { filters: [ { key: 'system.linkedClass.uuid', - label: 'Class', + label: 'TYPES.Item.class', choices: items => { const list = items .filter(item => item.system.linkedClass) @@ -410,7 +413,8 @@ export const typeConfig = { }, { key: 'system.mainTrait', - label: 'DAGGERHEART.GENERAL.Trait.single' + label: 'DAGGERHEART.GENERAL.Trait.single', + format: trait => (trait ? `DAGGERHEART.CONFIG.Traits.${trait}.name` : '-') } ], filters: [ diff --git a/templates/dialogs/compendiumBrowserSettingsDialog/footer.hbs b/templates/dialogs/compendiumBrowserSettingsDialog/footer.hbs index 9dc61cbe..d9bb378e 100644 --- a/templates/dialogs/compendiumBrowserSettingsDialog/footer.hbs +++ b/templates/dialogs/compendiumBrowserSettingsDialog/footer.hbs @@ -1,3 +1,3 @@
- +
\ No newline at end of file diff --git a/templates/sheets/items/weapon/header.hbs b/templates/sheets/items/weapon/header.hbs index 349a9516..2f51d6d3 100644 --- a/templates/sheets/items/weapon/header.hbs +++ b/templates/sheets/items/weapon/header.hbs @@ -5,9 +5,9 @@

{{#if source.system.secondary}} -

{{localize "DAGGERHEART.ITEMS.Weapon.secondaryWeapon"}}

+

{{localize "DAGGERHEART.ITEMS.Weapon.secondaryWeapon.full"}}

{{else}} -

{{localize "DAGGERHEART.ITEMS.Weapon.primaryWeapon"}}

+

{{localize "DAGGERHEART.ITEMS.Weapon.primaryWeapon.full"}}

{{/if}}

{{localize (concat 'DAGGERHEART.CONFIG.Traits.' source.system.attack.roll.trait '.short')}} diff --git a/templates/ui/tooltip/battlepoints.hbs b/templates/ui/tooltip/battlepoints.hbs index 9672698a..f2f42f53 100644 --- a/templates/ui/tooltip/battlepoints.hbs +++ b/templates/ui/tooltip/battlepoints.hbs @@ -7,9 +7,9 @@ {{#each category as |grouping index|}}
{{#if grouping.nr}} - + {{else}} - + {{/if}}
{{/each}} @@ -26,7 +26,7 @@ {{else}} {{/if}} - +

{{/each}} diff --git a/templates/ui/tooltip/weapon.hbs b/templates/ui/tooltip/weapon.hbs index a672c883..4adb9c46 100644 --- a/templates/ui/tooltip/weapon.hbs +++ b/templates/ui/tooltip/weapon.hbs @@ -3,7 +3,7 @@

{{item.name}}

- {{#if item.system.secondary}}{{localize "DAGGERHEART.ITEMS.Weapon.secondaryWeapon"}}{{else}}{{localize "DAGGERHEART.ITEMS.Weapon.primaryWeapon"}}{{/if}} + {{#if item.system.secondary}}{{localize "DAGGERHEART.ITEMS.Weapon.secondaryWeapon.full"}}{{else}}{{localize "DAGGERHEART.ITEMS.Weapon.primaryWeapon.full"}}{{/if}}
{{#with (lookup config.GENERAL.burden item.system.burden) as | burden |}} From 24073e4a165099fd90de816d279fc5b6c7c7c2d5 Mon Sep 17 00:00:00 2001 From: WBHarry Date: Sun, 12 Apr 2026 13:59:59 +0200 Subject: [PATCH 5/5] Fixed trait counting in CharacterCreation. Fixed description layout and labels in CharacterCreation. Fixed drag/drop images from Compendium Browser --- lang/en.json | 1 + .../characterCreation/characterCreation.mjs | 9 +++++++-- module/applications/ui/itemBrowser.mjs | 2 ++ .../selections-container.less | 14 +++++++++++++ .../characterCreation/tabs/experience.hbs | 20 +++++++++++++------ 5 files changed, 38 insertions(+), 8 deletions(-) diff --git a/lang/en.json b/lang/en.json index d4ed02c6..2dc13ecf 100755 --- a/lang/en.json +++ b/lang/en.json @@ -2332,6 +2332,7 @@ "next": "Next", "none": "None", "noTarget": "No current target", + "optionalThing": "Optional {thing}", "partner": "Partner", "player": { "single": "Player", diff --git a/module/applications/characterCreation/characterCreation.mjs b/module/applications/characterCreation/characterCreation.mjs index aa764c56..467366fc 100644 --- a/module/applications/characterCreation/characterCreation.mjs +++ b/module/applications/characterCreation/characterCreation.mjs @@ -11,7 +11,10 @@ export default class DhCharacterCreation extends HandlebarsApplicationMixin(Appl this.character = character; this.setup = { - traits: this.character.system.traits, + traits: Object.keys(this.character.system.traits).reduce((acc, key) => { + acc[key] = { value: null }; + return acc; + }, {}), ancestryName: { primary: '', secondary: '' @@ -377,8 +380,10 @@ export default class DhCharacterCreation extends HandlebarsApplicationMixin(Appl ]; return Object.values(this.setup.traits).reduce((acc, x) => { const index = traitCompareArray.indexOf(x.value); + if (index === -1) return acc; + traitCompareArray.splice(index, 1); - acc += index !== -1; + acc += 1; return acc; }, 0); } diff --git a/module/applications/ui/itemBrowser.mjs b/module/applications/ui/itemBrowser.mjs index 22de38ab..67a16f6a 100644 --- a/module/applications/ui/itemBrowser.mjs +++ b/module/applications/ui/itemBrowser.mjs @@ -583,7 +583,9 @@ export class ItemBrowser extends HandlebarsApplicationMixin(ApplicationV2) { const { itemUuid } = event.target.closest('[data-item-uuid]').dataset, item = await foundry.utils.fromUuid(itemUuid), dragData = item.toDragData(); + event.dataTransfer.setData('text/plain', JSON.stringify(dragData)); + event.dataTransfer.setDragImage(event.target.querySelector('img'), 0, 0); } _canDragStart() { diff --git a/styles/less/dialog/character-creation/selections-container.less b/styles/less/dialog/character-creation/selections-container.less index 1de3d870..f774eb72 100644 --- a/styles/less/dialog/character-creation/selections-container.less +++ b/styles/less/dialog/character-creation/selections-container.less @@ -175,6 +175,11 @@ opacity: 0.2; } + &.no-horizontal-padding { + padding-left: 0; + padding-right: 0; + } + legend { margin-left: auto; margin-right: auto; @@ -274,6 +279,15 @@ flex-direction: column; gap: 5px; + &.separated { + border-bottom: 2px solid; + padding-bottom: 8px; + } + + .form-group { + padding: 0 0.75rem; + } + .experience-inner-container { position: relative; display: flex; diff --git a/templates/characterCreation/tabs/experience.hbs b/templates/characterCreation/tabs/experience.hbs index 3eb92834..66363084 100644 --- a/templates/characterCreation/tabs/experience.hbs +++ b/templates/characterCreation/tabs/experience.hbs @@ -4,17 +4,25 @@ data-group='{{tabs.experience.group}}' >
-
+
{{localize "DAGGERHEART.APPLICATIONS.CharacterCreation.initialExperiences"}} {{experience.nrSelected}}/{{experience.nrTotal}}
{{#each experience.values as |experience id|}} -
-
- - {{numberFormat this.value sign=true}} +
+
+ +
+ + {{numberFormat this.value sign=true}} +
- +
+ +
+ +
+
{{/each}}