From 9cf248754c0ad13eda74da9e248521f5a6adfacf Mon Sep 17 00:00:00 2001 From: Gesina Schwalbe Date: Mon, 28 Dec 2020 18:49:55 +0100 Subject: [PATCH] added "Effects" and "Details" tab to all items Additions: - partials for effects and details tab with navigation - loading of partials in main ds4.ts - add localization Changes: - empty "Details" tabs replaced by inclusion of partial - "Details" tab now displays default message - Previous "Details" tab of Trinket replaced by "Effects" tab --- src/lang/en.json | 1 + src/module/ds4.ts | 6 ++++- src/templates/item/armor-sheet.hbs | 11 ++++++---- src/templates/item/equipment-sheet.hbs | 11 ++++++---- src/templates/item/partials/details.hbs | 5 +++++ src/templates/item/partials/effects.hbs | 22 +++++++++++++++++++ src/templates/item/shield-sheet.hbs | 11 ++++++---- src/templates/item/trinket-sheet.hbs | 29 ++++++------------------- src/templates/item/weapon-sheet.hbs | 11 ++++++---- 9 files changed, 68 insertions(+), 39 deletions(-) create mode 100644 src/templates/item/partials/details.hbs create mode 100644 src/templates/item/partials/effects.hbs diff --git a/src/lang/en.json b/src/lang/en.json index 9714455c..0973c816 100644 --- a/src/lang/en.json +++ b/src/lang/en.json @@ -1,6 +1,7 @@ { "DS4.Description": "Description", "DS4.Details": "Details", + "DS4.Effects": "Effects", "DS4.AttackType": "Attack Type", "DS4.AttackTypeAbbr": "AT", "DS4.WeaponBonus": "Weapon Bonus", diff --git a/src/module/ds4.ts b/src/module/ds4.ts index bd76905c..c5d0f99b 100644 --- a/src/module/ds4.ts +++ b/src/module/ds4.ts @@ -31,7 +31,11 @@ Hooks.once("init", async function () { }); async function registerHandlebarsPartials() { - const templatePaths = ["systems/ds4/templates/item/partials/description.hbs"]; + const templatePaths = [ + "systems/ds4/templates/item/partials/description.hbs", + "systems/ds4/templates/item/partials/details.hbs", + "systems/ds4/templates/item/partials/effects.hbs", + ]; return loadTemplates(templatePaths); } diff --git a/src/templates/item/armor-sheet.hbs b/src/templates/item/armor-sheet.hbs index 64974483..b720df0e 100644 --- a/src/templates/item/armor-sheet.hbs +++ b/src/templates/item/armor-sheet.hbs @@ -37,6 +37,7 @@ {{!-- Sheet Tab Navigation --}} @@ -46,9 +47,11 @@ {{!-- Description Tab --}} {{> systems/ds4/templates/item/partials/description.hbs}} - {{!-- Attributes Tab --}} -
- {{!-- As you add new fields, add them in here! --}} -
+ {{!-- Details Tab --}} + {{> systems/ds4/templates/item/partials/details.hbs}} + + {{!-- Effects Tab --}} + {{> systems/ds4/templates/item/partials/effects.hbs}} + \ No newline at end of file diff --git a/src/templates/item/equipment-sheet.hbs b/src/templates/item/equipment-sheet.hbs index 79d4832a..25434bf5 100644 --- a/src/templates/item/equipment-sheet.hbs +++ b/src/templates/item/equipment-sheet.hbs @@ -10,6 +10,7 @@ {{!-- Sheet Tab Navigation --}} @@ -19,9 +20,11 @@ {{!-- Description Tab --}} {{> systems/ds4/templates/item/partials/description.hbs}} - {{!-- Attributes Tab --}} -
- {{!-- As you add new fields, add them in here! --}} -
+ {{!-- Details Tab --}} + {{> systems/ds4/templates/item/partials/details.hbs}} + + {{!-- Effects Tab --}} + {{> systems/ds4/templates/item/partials/effects.hbs}} + \ No newline at end of file diff --git a/src/templates/item/partials/details.hbs b/src/templates/item/partials/details.hbs new file mode 100644 index 00000000..2d5b3f0c --- /dev/null +++ b/src/templates/item/partials/details.hbs @@ -0,0 +1,5 @@ +{{!-- The item tab for details. --}} +
+ {{!-- As you add new fields, add them in here! --}} +

Nothing to see yet.

+
\ No newline at end of file diff --git a/src/templates/item/partials/effects.hbs b/src/templates/item/partials/effects.hbs new file mode 100644 index 00000000..819290d6 --- /dev/null +++ b/src/templates/item/partials/effects.hbs @@ -0,0 +1,22 @@ +{{!-- Tab for the items view to manage effects --}} +
+
    +
  1. +
    +
    Name
    + +
  2. + {{#each item.effects as |effect id|}} +
  3. +

    {{effect.label}}

    +
    + + +
    +
  4. + {{/each}} +
+
\ No newline at end of file diff --git a/src/templates/item/shield-sheet.hbs b/src/templates/item/shield-sheet.hbs index ae1166f9..b06ecb45 100644 --- a/src/templates/item/shield-sheet.hbs +++ b/src/templates/item/shield-sheet.hbs @@ -17,6 +17,7 @@ {{!-- Sheet Tab Navigation --}} @@ -26,9 +27,11 @@ {{!-- Description Tab --}} {{> systems/ds4/templates/item/partials/description.hbs}} - {{!-- Attributes Tab --}} -
- {{!-- As you add new fields, add them in here! --}} -
+ {{!-- Details Tab --}} + {{> systems/ds4/templates/item/partials/details.hbs}} + + {{!-- Effects Tab --}} + {{> systems/ds4/templates/item/partials/effects.hbs}} + \ No newline at end of file diff --git a/src/templates/item/trinket-sheet.hbs b/src/templates/item/trinket-sheet.hbs index 364174c8..25434bf5 100644 --- a/src/templates/item/trinket-sheet.hbs +++ b/src/templates/item/trinket-sheet.hbs @@ -10,6 +10,7 @@ {{!-- Sheet Tab Navigation --}} @@ -19,27 +20,11 @@ {{!-- Description Tab --}} {{> systems/ds4/templates/item/partials/description.hbs}} - {{!-- Attributes Tab --}} -
-
    -
  1. -
    -
    Name
    - -
  2. - {{#each item.effects as |effect id|}} -
  3. -

    {{effect.label}}

    -
    - - -
    -
  4. - {{/each}} -
-
+ {{!-- Details Tab --}} + {{> systems/ds4/templates/item/partials/details.hbs}} + + {{!-- Effects Tab --}} + {{> systems/ds4/templates/item/partials/effects.hbs}} + \ No newline at end of file diff --git a/src/templates/item/weapon-sheet.hbs b/src/templates/item/weapon-sheet.hbs index 4c0f89be..09b3facf 100644 --- a/src/templates/item/weapon-sheet.hbs +++ b/src/templates/item/weapon-sheet.hbs @@ -32,6 +32,7 @@ {{!-- Sheet Tab Navigation --}} @@ -41,9 +42,11 @@ {{!-- Description Tab --}} {{> systems/ds4/templates/item/partials/description.hbs}} - {{!-- Attributes Tab --}} -
- {{!-- As you add new fields, add them in here! --}} -
+ {{!-- Details Tab --}} + {{> systems/ds4/templates/item/partials/details.hbs}} + + {{!-- Effects Tab --}} + {{> systems/ds4/templates/item/partials/effects.hbs}} + \ No newline at end of file