diff --git a/src/lang/en.json b/src/lang/en.json index 4396c640..f9a68048 100644 --- a/src/lang/en.json +++ b/src/lang/en.json @@ -44,6 +44,8 @@ "DS4.ItemTypeTalentPlural": "Talents", "DS4.ItemTypeRacialAbility": "Racial Ability", "DS4.ItemTypeRacialAbilityPlural": "Racial Abilities", + "DS4.ItemTypeLanguage": "Language", + "DS4.ItemTypeLanguagePlural": "Languages", "DS4.ArmorType": "Armor Type", "DS4.ArmorTypeAbbr": "AT", "DS4.ArmorMaterialType": "Material Type", diff --git a/src/module/config.ts b/src/module/config.ts index 16f7b5d8..38492901 100644 --- a/src/module/config.ts +++ b/src/module/config.ts @@ -50,6 +50,7 @@ export const DS4 = { equipment: "DS4.ItemTypeEquipment", talent: "DS4.ItemTypeTalent", racialAbility: "DS4.ItemTypeRacialAbility", + language: "DS4.ItemTypeLanguage", }, /** diff --git a/src/module/ds4.ts b/src/module/ds4.ts index 6fe0aa7a..3e727a4c 100644 --- a/src/module/ds4.ts +++ b/src/module/ds4.ts @@ -32,6 +32,7 @@ Hooks.once("init", async function () { async function registerHandlebarsPartials() { const templatePaths = [ + "systems/ds4/templates/item/partials/sheet-header.hbs", "systems/ds4/templates/item/partials/description.hbs", "systems/ds4/templates/item/partials/details.hbs", "systems/ds4/templates/item/partials/effects.hbs", diff --git a/src/module/item/item-data.ts b/src/module/item/item-data.ts index 76b90e78..6a9cd8d2 100644 --- a/src/module/item/item-data.ts +++ b/src/module/item/item-data.ts @@ -7,7 +7,8 @@ export type DS4ItemDataType = | DS4Trinket | DS4Equipment | DS4Talent - | DS4RacialAbility; + | DS4RacialAbility + | DS4Language; // types @@ -34,6 +35,7 @@ interface DS4Shield extends DS4ItemBase, DS4ItemPhysical, DS4ItemEquipable, DS4I interface DS4Trinket extends DS4ItemBase, DS4ItemPhysical, DS4ItemEquipable {} interface DS4Equipment extends DS4ItemBase, DS4ItemPhysical {} type DS4RacialAbility = DS4ItemBase; +type DS4Language = DS4ItemBase; // templates diff --git a/src/template.json b/src/template.json index 14a9d87f..cc3e291e 100644 --- a/src/template.json +++ b/src/template.json @@ -115,7 +115,7 @@ } }, "Item": { - "types": ["weapon", "armor", "shield", "trinket", "equipment", "talent", "racialAbility"], + "types": ["weapon", "armor", "shield", "trinket", "equipment", "talent", "racialAbility", "language"], "templates": { "base": { "description": "" @@ -163,6 +163,9 @@ }, "racialAbility": { "templates": ["base"] + }, + "language": { + "templates": ["base"] } } } diff --git a/src/templates/actor/partials/talents-overview.hbs b/src/templates/actor/partials/talents-overview.hbs index 179703e2..753e16b9 100644 --- a/src/templates/actor/partials/talents-overview.hbs +++ b/src/templates/actor/partials/talents-overview.hbs @@ -25,7 +25,6 @@ !-- The partial assumes a variable item to be given in the context. !-- !-- @param item: hand over the item to the partial as hash parameter -!-- @param partial-block: hand over custom children of the flexbox in the partial block. --}} {{#*inline "talentListEntry"}}
  • @@ -58,14 +57,14 @@ {{!-- -!-- Render a racial ability list row from a given item. +!-- Render a list row for a base item from a given item. +!-- Base item means it just has an image, a description, and a name (and effects). !-- It is a flexbox with a child for each item value of interest. !-- The partial assumes a variable item to be given in the context. !-- !-- @param item: hand over the item to the partial as hash parameter -!-- @param partial-block: hand over custom children of the flexbox in the partial block. --}} -{{#*inline "racialAbilityListEntry"}} +{{#*inline "baseItemListEntry"}}
  • {{!-- image --}}
    @@ -81,6 +80,26 @@
  • {{/inline}} +{{!-- +!-- Render a list header for a base item list entries from a given item. +!-- The partial assumes a variable dataType to be given in the context. +!-- +!-- @param dataType: the string item type for the list +--}} +{{#*inline "baseItemListHeader"}} +
  • + {{!-- image --}} +
    + {{!-- name --}} +
    {{localize 'DS4.ItemName'}}
    + {{!-- description --}} +
    {{localize 'DS4.HeadingDescription'}}
    + {{!-- add button --}} + {{> systems/ds4/templates/actor/partials/overview-add-button.hbs dataType=dataType }} +
  • +{{/inline}} + + {{!-- ======================================================================== --}} @@ -106,18 +125,17 @@

    {{localize 'DS4.ItemTypeRacialAbilityPlural'}}

      -
    1. - {{!-- image --}} -
      - {{!-- name --}} -
      {{localize 'DS4.ItemName'}}
      - {{!-- description --}} -
      {{localize 'DS4.HeadingDescription'}}
      - {{!-- add button --}} - {{> systems/ds4/templates/actor/partials/overview-add-button.hbs dataType='racialAbility' }} -
    2. + {{> baseItemListHeader dataType='racialAbility' }} {{#each itemsByType.racialAbility as |item id|}} - {{> racialAbilityListEntry item=item}} + {{> baseItemListEntry item=item}} + {{/each}} +
    + +

    {{localize 'DS4.ItemTypeLanguagePlural'}}

    +
      + {{> baseItemListHeader dataType='language' }} + {{#each itemsByType.language as |item id|}} + {{> baseItemListEntry item=item}} {{/each}}
    \ No newline at end of file diff --git a/src/templates/item/language-sheet.hbs b/src/templates/item/language-sheet.hbs new file mode 100644 index 00000000..cfd63f9e --- /dev/null +++ b/src/templates/item/language-sheet.hbs @@ -0,0 +1,8 @@ +
    + {{#> systems/ds4/templates/item/partials/sheet-header.hbs}} + {{/systems/ds4/templates/item/partials/sheet-header.hbs}} + + {{!-- Common Item body --}} + {{> systems/ds4/templates/item/partials/body.hbs}} + +
    \ No newline at end of file diff --git a/src/templates/item/partials/sheet-header.hbs b/src/templates/item/partials/sheet-header.hbs new file mode 100644 index 00000000..cef12b2b --- /dev/null +++ b/src/templates/item/partials/sheet-header.hbs @@ -0,0 +1,8 @@ +
    + +
    +

    +

    {{localize (lookup config.itemTypes item.type)}}

    + {{> @partial-block}} +
    +
    \ No newline at end of file