diff --git a/module/applications/sheets/api/application-mixin.mjs b/module/applications/sheets/api/application-mixin.mjs index b18176ec..449880fb 100644 --- a/module/applications/sheets/api/application-mixin.mjs +++ b/module/applications/sheets/api/application-mixin.mjs @@ -691,9 +691,6 @@ export default function DHApplicationMixin(Base) { case 'weapon': presets.folder = 'equipments.folders.weapons'; break; - case 'feature': - presets.folder = 'features'; - break; case 'domainCard': presets.folder = 'domains'; presets.filter = { diff --git a/module/applications/ui/itemBrowser.mjs b/module/applications/ui/itemBrowser.mjs index f6235101..2d882eba 100644 --- a/module/applications/ui/itemBrowser.mjs +++ b/module/applications/ui/itemBrowser.mjs @@ -251,12 +251,6 @@ export class ItemBrowser extends HandlebarsApplicationMixin(ApplicationV2) { /* If any noticeable slowdown occurs, consider replacing with enriching description on clicking to expand descriptions */ for (const item of this.items) { - if (["weapon", "armor"].includes(item.type)) { - item.system.enrichedTags = await foundry.applications.handlebars.renderTemplate( - 'systems/daggerheart/templates/sheets/global/partials/item-tags.hbs', - item.system, - ); - } item.system.enrichedDescription = (await item.system.getEnrichedDescription?.()) ?? (await foundry.applications.ux.TextEditor.implementation.enrichHTML(item.description)); diff --git a/module/data/item/weapon.mjs b/module/data/item/weapon.mjs index bb7fde0a..051fd42d 100644 --- a/module/data/item/weapon.mjs +++ b/module/data/item/weapon.mjs @@ -112,14 +112,24 @@ export default class DHWeapon extends AttachableItem { async getDescriptionData() { const baseDescription = this.description; + const tier = game.i18n.localize(`DAGGERHEART.GENERAL.Tiers.${this.tier}`); + const trait = game.i18n.localize(CONFIG.DH.ACTOR.abilities[this.attack.roll.trait].label); + const range = game.i18n.localize(`DAGGERHEART.CONFIG.Range.${this.attack.range}.name`); + const damage = Roll.replaceFormulaData(this.attack.damageFormula, this.parent.parent ?? this.parent); + const burden = game.i18n.localize(CONFIG.DH.GENERAL.burden[this.burden].label); + const allFeatures = CONFIG.DH.ITEM.allWeaponFeatures(); const features = this.weaponFeatures.map(x => allFeatures[x.value]).filter(x => x); const prefix = await foundry.applications.handlebars.renderTemplate( 'systems/daggerheart/templates/sheets/items/weapon/description.hbs', { - item: this, - features + features, + tier, + trait, + range, + damage, + burden } ); diff --git a/module/systemRegistration/handlebars.mjs b/module/systemRegistration/handlebars.mjs index 9ccb16f4..de085221 100644 --- a/module/systemRegistration/handlebars.mjs +++ b/module/systemRegistration/handlebars.mjs @@ -17,10 +17,9 @@ export const preloadHandlebarsTemplates = async function () { 'systems/daggerheart/templates/sheets/global/partials/resource-section/dice-value.hbs', 'systems/daggerheart/templates/sheets/global/partials/resource-section/die.hbs', 'systems/daggerheart/templates/sheets/global/partials/resource-bar.hbs', - 'systems/daggerheart/templates/sheets/global/partials/feature-section-item.hbs', - 'systems/daggerheart/templates/sheets/global/partials/item-tags.hbs', 'systems/daggerheart/templates/components/card-preview.hbs', 'systems/daggerheart/templates/levelup/parts/selectable-card-preview.hbs', + 'systems/daggerheart/templates/sheets/global/partials/feature-section-item.hbs', 'systems/daggerheart/templates/ui/combatTracker/combatTrackerSection.hbs', 'systems/daggerheart/templates/actionTypes/damage.hbs', 'systems/daggerheart/templates/actionTypes/resource.hbs', diff --git a/styles/less/global/global.less b/styles/less/global/global.less index b9af67c0..fb995b8c 100644 --- a/styles/less/global/global.less +++ b/styles/less/global/global.less @@ -73,24 +73,6 @@ } } } - - .item-tags { - display: flex; - gap: 10px; - - .tag { - align-items: center; - background: light-dark(@dark-15, @beige-15); - border-radius: 3px; - border: 1px solid light-dark(@dark, @beige); - display: flex; - flex-direction: row; - flex-wrap: wrap; - font-size: var(--font-size-12); - justify-content: start; - padding: 3px 5px; - } - } } /* TODO: Remove me when this issue is resolved https://github.com/foundryvtt/foundryvtt/issues/13734 */ diff --git a/styles/less/global/inventory-item.less b/styles/less/global/inventory-item.less index 4bd4d0bb..d703d189 100644 --- a/styles/less/global/inventory-item.less +++ b/styles/less/global/inventory-item.less @@ -138,6 +138,24 @@ display: none; } } + + .item-tags { + display: flex; + gap: 10px; + + .tag { + align-items: center; + background: light-dark(@dark-15, @beige-15); + border-radius: 3px; + border: 1px solid light-dark(@dark, @beige); + display: flex; + flex-direction: row; + flex-wrap: wrap; + font-size: var(--font-size-12); + justify-content: start; + padding: 3px 5px; + } + } } .item-resource { diff --git a/styles/less/ui/item-browser/item-browser.less b/styles/less/ui/item-browser/item-browser.less index f558a0ba..b395f8c8 100644 --- a/styles/less/ui/item-browser/item-browser.less +++ b/styles/less/ui/item-browser/item-browser.less @@ -304,15 +304,7 @@ padding: 0 0 0 50px; display: flex; flex-direction: column; - - .item-description-outer-container:has(div, p) { - margin-top: 8px; - } - - /* Some items don't include an outer container, so we attempt a catch-all */ - > *:last-child { - padding-bottom: 6px; - } + gap: 5px; h1 { font-size: var(--font-size-32); @@ -358,7 +350,6 @@ .filter-content, .item-desc { display: grid; - opacity: 0; grid-template-rows: 0fr; transition: all 0.3s ease-in-out; width: 100%; @@ -387,8 +378,8 @@ } .expanded + .extensible { - opacity: 1; grid-template-rows: 1fr; + padding-top: 10px; } .welcome-message { diff --git a/templates/sheets/actors/character/features.hbs b/templates/sheets/actors/character/features.hbs index 3e942468..acabd37e 100644 --- a/templates/sheets/actors/character/features.hbs +++ b/templates/sheets/actors/character/features.hbs @@ -4,21 +4,19 @@ {{#each document.system.sheetLists as |category|}} {{#if (eq category.type 'feature' )}} {{> 'daggerheart.inventory-items' - title=category.title - type='feature' - actorType='character' - collection=category.values - canCreate=true - showActions=true + title=category.title + type='feature' + collection=category.values + canCreate=true + showActions=true }} {{else if category.values}} {{> 'daggerheart.inventory-items' - title=category.title - type='feature' - actorType='character' - collection=category.values - canCreate=false - showActions=true + title=category.title + type='feature' + collection=category.values + canCreate=false + showActions=true }} {{/if}} diff --git a/templates/sheets/global/partials/inventory-fieldset-items-V2.hbs b/templates/sheets/global/partials/inventory-fieldset-items-V2.hbs index 31c8f7f5..0a3275d0 100644 --- a/templates/sheets/global/partials/inventory-fieldset-items-V2.hbs +++ b/templates/sheets/global/partials/inventory-fieldset-items-V2.hbs @@ -28,7 +28,7 @@ Parameters: {{localize title}} {{#if canCreate}} - {{localize item.name}} {{#unless (or noExtensible (not item.system.description))}}{{/unless}} {{!-- Tags Start --}} - {{#if (not ../hideTags)}} - {{#> "systems/daggerheart/templates/sheets/global/partials/item-tags.hbs" item }} - {{#if (eq ../type 'feature')}} - {{#if (or (eq @root.document.type 'adversary') (eq @root.document.type 'environment'))}} - {{#if system.featureForm}} -
- {{localize (concat "DAGGERHEART.CONFIG.FeatureForm." system.featureForm)}} -
- {{/if}} + {{#with item}} + {{#if (not ../hideTags)}} +
+ {{#each this._getTags as |tag|}} +
+ {{tag}} +
+ {{/each}} + + {{!-- Feature Form Tag Start --}} + {{#if (eq ../type 'feature')}} + {{#if (or (eq @root.document.type 'adversary') (eq @root.document.type 'environment'))}} + {{#if system.featureForm}} +
+ {{localize (concat "DAGGERHEART.CONFIG.FeatureForm." system.featureForm)}} +
{{/if}} {{/if}} - {{/ "systems/daggerheart/templates/sheets/global/partials/item-tags.hbs"}} {{/if}} + {{!-- Feature Form Tag End --}} +
+ {{/if}} + {{/with}} {{!--Tags End --}} diff --git a/templates/sheets/global/partials/item-tags.hbs b/templates/sheets/global/partials/item-tags.hbs deleted file mode 100644 index b30fcbf2..00000000 --- a/templates/sheets/global/partials/item-tags.hbs +++ /dev/null @@ -1,8 +0,0 @@ -
- {{#each _getTags as |tag|}} -
- {{tag}} -
- {{/each}} - {{#if @partial-block}}{{> @partial-block}}{{/if}} -
\ No newline at end of file diff --git a/templates/sheets/items/armor/description.hbs b/templates/sheets/items/armor/description.hbs index af2698ef..c234fa10 100644 --- a/templates/sheets/items/armor/description.hbs +++ b/templates/sheets/items/armor/description.hbs @@ -1,6 +1,19 @@
+
+
+

{{localize "DAGGERHEART.ITEMS.Armor.baseThresholds.base"}}

+ {{item.system.baseThresholds.major}}/{{item.system.baseThresholds.severe}} +
+ +
+

{{localize "DAGGERHEART.ITEMS.Armor.baseScore"}}

+ {{item.system.baseScore}} +
+
+ {{#if features.length}}
+

{{localize "DAGGERHEART.GENERAL.features"}}

{{#each features as | feature |}}
{{localize feature.label}}: {{{localize feature.description}}}
{{/each}} diff --git a/templates/sheets/items/weapon/description.hbs b/templates/sheets/items/weapon/description.hbs index af2698ef..d8e128e7 100644 --- a/templates/sheets/items/weapon/description.hbs +++ b/templates/sheets/items/weapon/description.hbs @@ -1,6 +1,36 @@
+
+
+

{{localize "DAGGERHEART.GENERAL.Tiers.singular"}}

+ {{tier}} +
+ +
+

{{localize "DAGGERHEART.GENERAL.Trait.single"}}

+ {{trait}} +
+ +
+

{{localize "DAGGERHEART.GENERAL.range"}}

+ {{range}} +
+
+ +
+
+

{{localize "DAGGERHEART.GENERAL.damage"}}

+ {{damage}} +
+ +
+

{{localize "DAGGERHEART.GENERAL.burden"}}

+ {{burden}} +
+
+ {{#if features.length}}
+

{{localize "DAGGERHEART.GENERAL.features"}}

{{#each features as | feature |}}
{{localize feature.label}}: {{{localize feature.description}}}
{{/each}} diff --git a/templates/ui/itemBrowser/itemContainer.hbs b/templates/ui/itemBrowser/itemContainer.hbs index 8dd75156..0040a692 100644 --- a/templates/ui/itemBrowser/itemContainer.hbs +++ b/templates/ui/itemBrowser/itemContainer.hbs @@ -10,10 +10,7 @@
- - {{{system.enrichedTags}}} - {{{system.enrichedDescription}}} - + {{{system.enrichedDescription}}}
{{/each}} \ No newline at end of file