From 47c45ee87d0de2bd3cf9fadd13141923226d0093 Mon Sep 17 00:00:00 2001 From: Gesina Schwalbe Date: Mon, 28 Dec 2020 20:38:02 +0100 Subject: [PATCH 01/15] moved items tab of char sheet into partial --- src/module/ds4.ts | 5 ++++- src/templates/actor/actor-sheet.html | 28 ++------------------------ src/templates/actor/partials/items.hbs | 26 ++++++++++++++++++++++++ 3 files changed, 32 insertions(+), 27 deletions(-) create mode 100644 src/templates/actor/partials/items.hbs diff --git a/src/module/ds4.ts b/src/module/ds4.ts index 002e9314..ea4f4486 100644 --- a/src/module/ds4.ts +++ b/src/module/ds4.ts @@ -31,7 +31,10 @@ 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/actor/partials/items.hbs", + ]; return loadTemplates(templatePaths); } diff --git a/src/templates/actor/actor-sheet.html b/src/templates/actor/actor-sheet.html index 55dbbf83..4aa0540d 100644 --- a/src/templates/actor/actor-sheet.html +++ b/src/templates/actor/actor-sheet.html @@ -60,31 +60,7 @@ {{editor content=data.biography target="data.biography" button=true owner=owner editable=editable}} - {{!-- Owned Items Tab --}} -
-
    -
  1. -
    -
    Name
    - -
  2. - {{#each actor.items as |item id|}} -
  3. -
    - -
    -

    {{item.name}}

    -
    - - -
    -
  4. - {{/each}} -
-
+ {{!-- Items Tab --}} + {{> systems/ds4/templates/actor/partials/items.hbs}} diff --git a/src/templates/actor/partials/items.hbs b/src/templates/actor/partials/items.hbs new file mode 100644 index 00000000..4b75dd2e --- /dev/null +++ b/src/templates/actor/partials/items.hbs @@ -0,0 +1,26 @@ +{{!-- Tab with overview and quick-actions on owned items --}} +
+
    +
  1. +
    +
    Name
    + +
  2. + {{#each actor.items as |item id|}} +
  3. +
    + +
    +

    {{item.name}}

    +
    + + +
    +
  4. + {{/each}} +
+
\ No newline at end of file From 2fc7fb13c8f773f73259b0ec043ef3eff484728c Mon Sep 17 00:00:00 2001 From: Gesina Schwalbe Date: Mon, 28 Dec 2020 20:38:51 +0100 Subject: [PATCH 02/15] renamed actor-sheet from .html to correct .hbs --- src/module/actor/actor-sheet.ts | 2 +- src/templates/actor/{actor-sheet.html => actor-sheet.hbs} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename src/templates/actor/{actor-sheet.html => actor-sheet.hbs} (100%) diff --git a/src/module/actor/actor-sheet.ts b/src/module/actor/actor-sheet.ts index 43af361c..bdb89182 100644 --- a/src/module/actor/actor-sheet.ts +++ b/src/module/actor/actor-sheet.ts @@ -10,7 +10,7 @@ export class DS4ActorSheet extends ActorSheet { static get defaultOptions(): FormApplicationOptions { return mergeObject(super.defaultOptions, { classes: ["ds4", "sheet", "actor"], - template: "systems/ds4/templates/actor/actor-sheet.html", + template: "systems/ds4/templates/actor/actor-sheet.hbs", width: 600, height: 600, tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "description" }], diff --git a/src/templates/actor/actor-sheet.html b/src/templates/actor/actor-sheet.hbs similarity index 100% rename from src/templates/actor/actor-sheet.html rename to src/templates/actor/actor-sheet.hbs From 2ac6d3a919e02b235a5a10e57915bb287ed03ddc Mon Sep 17 00:00:00 2001 From: Gesina Schwalbe Date: Tue, 29 Dec 2020 01:44:54 +0100 Subject: [PATCH 03/15] working weapons section in char sheet Additions: - re-added getData() method of actor sheet for sorted items - added an item-description CSS class for handling of overflow - added a 1.5 CSS flex box Changes: - restricted previous sample items section to only weapons (to be re-used for other item types) Fixes: - fixed input types in weapon sheet --- src/module/actor/actor-sheet.ts | 15 +++++++ src/scss/components/_items.scss | 11 +++++ src/scss/global/_flex.scss | 6 +++ src/templates/actor/partials/items.hbs | 57 +++++++++++++++++++++----- src/templates/item/weapon-sheet.hbs | 4 +- 5 files changed, 80 insertions(+), 13 deletions(-) diff --git a/src/module/actor/actor-sheet.ts b/src/module/actor/actor-sheet.ts index bdb89182..7f26c5b3 100644 --- a/src/module/actor/actor-sheet.ts +++ b/src/module/actor/actor-sheet.ts @@ -6,6 +6,21 @@ import { DS4ActorDataType } from "./actor-data"; * @extends {ActorSheet} */ export class DS4ActorSheet extends ActorSheet { + /** + * This method returns the data for the template of the actor sheet. + * It explicitly adds the items of the object sorted by type in the + * object itemsByType. + * @returns the data fed to the template of the actor sheet + */ + getData(): ActorSheetData { + const data = super.getData(); + // Add the items explicitly sorted by type to the data: + const itemsByType = this.actor.itemTypes; + data["itemsByType"] = itemsByType; + console.log("Shields:", data); + return data; + } + /** @override */ static get defaultOptions(): FormApplicationOptions { return mergeObject(super.defaultOptions, { diff --git a/src/scss/components/_items.scss b/src/scss/components/_items.scss index 7a2d860b..e13c8458 100644 --- a/src/scss/components/_items.scss +++ b/src/scss/components/_items.scss @@ -32,4 +32,15 @@ flex: 0 0 86px; text-align: right; } + + .item-description { + font-size: 75%; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + p { + text-overflow: ellipsis; + overflow: hidden; + } + } } diff --git a/src/scss/global/_flex.scss b/src/scss/global/_flex.scss index af5108e5..d96c79c5 100644 --- a/src/scss/global/_flex.scss +++ b/src/scss/global/_flex.scss @@ -15,6 +15,9 @@ .flex1 { flex: 1; } + .flex15 { + flex: 1.5; + } .flex2 { flex: 2; } @@ -38,6 +41,9 @@ .flex1 { flex: 1; } + .flex15 { + flex: 1.5; + } .flex2 { flex: 2; } diff --git a/src/templates/actor/partials/items.hbs b/src/templates/actor/partials/items.hbs index 4b75dd2e..50d5c817 100644 --- a/src/templates/actor/partials/items.hbs +++ b/src/templates/actor/partials/items.hbs @@ -1,26 +1,61 @@ +{{!-- TODO: add localization! --}} {{!-- Tab with overview and quick-actions on owned items --}}
+ + {{!-- WEAPONS --}} +

Weapons

  1. -
    -
    Name
    -
    - Add item +
    +
    {{!-- equipped --}} +
    +
    #
    {{!-- amount --}} +
    +
    Name
    +
    AT
    {{!-- attack type --}} {{!-- SPECIFIC --}} +
    +
    WB
    {{!-- weapon bonus --}} {{!-- SPECIFIC --}} +
    OD
    {{!-- opponent defence --}} {{!-- SPECIFIC --}} +
    +
    Desc
    {{!-- description --}} + {{!-- add button --}} +
    {{!-- SPECIFIC --}} + + Add item {{!-- SPECIFIC --}}
  2. - {{#each actor.items as |item id|}} + {{#each itemsByType.weapon as |item id|}} {{!-- SPECIFIC --}} + {{#with item.data.data as |itemData|}}
  3. -
    - +
    + {{!-- equipped? --}} + {{#if itemData.equipped}} + {{else}} + {{/if}} {{!--SPECIFIC --}} + {{!-- image --}} +
    + +
    + {{!-- amount --}} +
    {{itemData.quantity}}
    -

    {{item.name}}

    -
    + {{!-- name --}} +

    {{item.name}}

    + {{!-- item specifics --}} +
    {{itemData.attackType}}
    {{!-- SPECIFIC --}} +
    +
    {{itemData.weaponBonus}}
    {{!-- SPECIFIC --}} +
    {{itemData.opponentDefense}}
    {{!-- SPECIFIC --}} +
    + {{!-- description --}} +
    {{{itemData.description}}}
    + {{!-- edit & delete buttons --}} +
  4. + {{/with}} {{/each}}
\ No newline at end of file diff --git a/src/templates/item/weapon-sheet.hbs b/src/templates/item/weapon-sheet.hbs index 4c0f89be..ce77965e 100644 --- a/src/templates/item/weapon-sheet.hbs +++ b/src/templates/item/weapon-sheet.hbs @@ -17,12 +17,12 @@
-
-
From 2ae005f4325abeb55e15d08fc8ccb0c07d9ebe43 Mon Sep 17 00:00:00 2001 From: Gesina Schwalbe Date: Tue, 29 Dec 2020 16:29:44 +0100 Subject: [PATCH 04/15] added localization to weapon overview --- src/lang/en.json | 4 ++++ src/templates/actor/partials/items.hbs | 15 +++++++-------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/lang/en.json b/src/lang/en.json index 6f8526d1..8f4cd3ea 100644 --- a/src/lang/en.json +++ b/src/lang/en.json @@ -1,5 +1,7 @@ { + "DS4.ActionAddItem": "Add item", "DS4.Description": "Description", + "DS4.DescriptionAbbr": "Desc", "DS4.Details": "Details", "DS4.Effects": "Effects", "DS4.AttackType": "Attack Type", @@ -22,12 +24,14 @@ "DS4.ItemAvailabilityDwarves": "Dwarves", "DS4.ItemAvailabilityUnset": "Unset", "DS4.ItemAvailabilityNowhere": "Nowhere", + "DS4.ItemName": "Name", "DS4.ItemTypeWeapon": "Weapon", "DS4.ItemTypeArmor": "Armor", "DS4.ItemTypeShield": "Shield", "DS4.ItemTypeTrinket": "Trinket", "DS4.ItemTypeEquipment": "Equipment", "DS4.ArmorType": "Armor Type", + "DS4.ArmorTypeAbbr": "AT", "DS4.ArmorMaterialType": "Material Type", "DS4.ArmorValue": "Armor Value", "DS4.ArmorTypeBody": "Body", diff --git a/src/templates/actor/partials/items.hbs b/src/templates/actor/partials/items.hbs index 50d5c817..a2eca0a8 100644 --- a/src/templates/actor/partials/items.hbs +++ b/src/templates/actor/partials/items.hbs @@ -1,9 +1,8 @@ -{{!-- TODO: add localization! --}} {{!-- Tab with overview and quick-actions on owned items --}}
{{!-- WEAPONS --}} -

Weapons

+

{{localize "DS4.ItemTypeWeapon"}}

  1. @@ -11,17 +10,17 @@
    #
    {{!-- amount --}}
    -
    Name
    -
    AT
    {{!-- attack type --}} {{!-- SPECIFIC --}} +
    {{localize "DS4.ItemName"}}
    +
    {{localize "DS4.AttackTypeAbbr"}}
    {{!-- SPECIFIC --}}
    -
    WB
    {{!-- weapon bonus --}} {{!-- SPECIFIC --}} -
    OD
    {{!-- opponent defence --}} {{!-- SPECIFIC --}} +
    {{localize "DS4.WeaponBonusAbbr"}}
    {{!-- SPECIFIC --}} +
    {{localize "DS4.OpponentDefenseAbbr"}}
    {{!-- SPECIFIC --}}
    -
    Desc
    {{!-- description --}} +
    {{localize "DS4.DescriptionAbbr"}}
    {{!-- add button --}}
    {{!-- SPECIFIC --}} - Add item {{!-- SPECIFIC --}} + {{localize "DS4.ActionAddItem"}} {{!-- SPECIFIC --}}
  2. {{#each itemsByType.weapon as |item id|}} {{!-- SPECIFIC --}} From 48d8d6e44d4eb27cced3d176066974a44c2e8806 Mon Sep 17 00:00:00 2001 From: Gesina Schwalbe Date: Tue, 29 Dec 2020 19:06:17 +0100 Subject: [PATCH 05/15] proper localization of item vals in char sheet Additions: - added TODOs - added armor item list to char sheet - proper overflow handling in tabs (now: scrollable) Changes: - proper localization of item values - "Description" not abbreviated anymore - cleaned up getData() of ActorSheet (data now truly const) --- src/module/actor/actor-sheet.ts | 13 ++++++++----- src/scss/components/_apps.scss | 5 ++++- src/templates/actor/partials/items.hbs | 9 ++++++--- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/src/module/actor/actor-sheet.ts b/src/module/actor/actor-sheet.ts index 7f26c5b3..29d5f878 100644 --- a/src/module/actor/actor-sheet.ts +++ b/src/module/actor/actor-sheet.ts @@ -13,11 +13,14 @@ export class DS4ActorSheet extends ActorSheet { * @returns the data fed to the template of the actor sheet */ getData(): ActorSheetData { - const data = super.getData(); - // Add the items explicitly sorted by type to the data: - const itemsByType = this.actor.itemTypes; - data["itemsByType"] = itemsByType; - console.log("Shields:", data); + const data = { + ...super.getData(), + // Add the localization config to the data: + config: CONFIG.DS4, + // Add the items explicitly sorted by type to the data: + itemsByType: this.actor.itemTypes, + }; + console.log("Data:", data); return data; } diff --git a/src/scss/components/_apps.scss b/src/scss/components/_apps.scss index 3f8ba623..8a5d82f0 100644 --- a/src/scss/components/_apps.scss +++ b/src/scss/components/_apps.scss @@ -9,7 +9,10 @@ .tab { height: 100%; - overflow-y: auto; + overflow-y: scroll; align-content: flex-start; + ol { + overflow-y: visible; + } } } diff --git a/src/templates/actor/partials/items.hbs b/src/templates/actor/partials/items.hbs index a2eca0a8..7aed8ee3 100644 --- a/src/templates/actor/partials/items.hbs +++ b/src/templates/actor/partials/items.hbs @@ -1,8 +1,11 @@ +{{!-- TODO: hover shows complete name of abbreviations --}} +{{!-- TODO: try to use alias for the item type via HBS with and lookup --}} +{{!-- TODO: Where possible use icons with complete names as hovers instead of long names --}} {{!-- Tab with overview and quick-actions on owned items --}}
    {{!-- WEAPONS --}} -

    {{localize "DS4.ItemTypeWeapon"}}

    +

    {{localize "DS4.ItemTypeWeapon"}}

    {{!-- SPECIFIC --}}
    1. @@ -16,7 +19,7 @@
      {{localize "DS4.WeaponBonusAbbr"}}
      {{!-- SPECIFIC --}}
      {{localize "DS4.OpponentDefenseAbbr"}}
      {{!-- SPECIFIC --}}
      -
      {{localize "DS4.DescriptionAbbr"}}
      +
      {{localize "DS4.Description"}}
      {{!-- add button --}}
      {{!-- SPECIFIC --}} @@ -41,7 +44,7 @@ {{!-- name --}}

      {{item.name}}

      {{!-- item specifics --}} -
      {{itemData.attackType}}
      {{!-- SPECIFIC --}} +
      {{lookup ../../config.attackTypes itemData.attackType}}
      {{!-- SPECIFIC --}}
      {{itemData.weaponBonus}}
      {{!-- SPECIFIC --}}
      {{itemData.opponentDefense}}
      {{!-- SPECIFIC --}} From 99d2f92b4198602a5306bef20dc9df08b5885dab Mon Sep 17 00:00:00 2001 From: Gesina Schwalbe Date: Tue, 29 Dec 2020 19:07:20 +0100 Subject: [PATCH 06/15] added armor list to items tab in char sheet Additions: - added armor list to items tab in char sheet - added localization - added CSS class for flex 0.5 --- src/lang/en.json | 2 + src/scss/global/_flex.scss | 6 +++ src/templates/actor/partials/items.hbs | 53 ++++++++++++++++++++++++++ 3 files changed, 61 insertions(+) diff --git a/src/lang/en.json b/src/lang/en.json index 8f4cd3ea..42437b0e 100644 --- a/src/lang/en.json +++ b/src/lang/en.json @@ -33,7 +33,9 @@ "DS4.ArmorType": "Armor Type", "DS4.ArmorTypeAbbr": "AT", "DS4.ArmorMaterialType": "Material Type", + "DS4.ArmorMaterialTypeAbbr": "Mat.", "DS4.ArmorValue": "Armor Value", + "DS4.ArmorValueAbbr": "AV", "DS4.ArmorTypeBody": "Body", "DS4.ArmorTypeHelmet": "Helmet", "DS4.ArmorTypeVambrace": "Vambrace", diff --git a/src/scss/global/_flex.scss b/src/scss/global/_flex.scss index d96c79c5..4027bbc7 100644 --- a/src/scss/global/_flex.scss +++ b/src/scss/global/_flex.scss @@ -12,6 +12,9 @@ flex: 1; } + .flex05 { + flex: 0.5; + } .flex1 { flex: 1; } @@ -38,6 +41,9 @@ flex: 1; } + .flex05 { + flex: 0.5; + } .flex1 { flex: 1; } diff --git a/src/templates/actor/partials/items.hbs b/src/templates/actor/partials/items.hbs index 7aed8ee3..03da82f5 100644 --- a/src/templates/actor/partials/items.hbs +++ b/src/templates/actor/partials/items.hbs @@ -60,4 +60,57 @@ {{/with}} {{/each}}
    + + {{!-- ARMOR --}} +

    {{localize "DS4.ItemTypeArmor"}}

    {{!-- SPECIFIC --}} +
      +
    1. +
      +
      {{!-- equipped --}} +
      +
      #
      {{!-- amount --}} +
      +
      {{localize "DS4.ItemName"}}
      +
      {{localize "DS4.ArmorMaterialTypeAbbr"}}
      {{!-- SPECIFIC --}} +
      {{localize "DS4.ArmorTypeAbbr"}}
      {{!-- SPECIFIC --}} +
      {{localize "DS4.ArmorValueAbbr"}}
      {{!-- SPECIFIC --}} +
      {{localize "DS4.Description"}}
      + {{!-- add button --}} +
      +
    2. + {{#each itemsByType.armor as |item id|}} {{!-- SPECIFIC --}} + {{#with item.data.data as |itemData|}} +
    3. +
      + {{!-- equipped? --}} + {{#if itemData.equipped}} + {{else}} + {{/if}} {{!--SPECIFIC --}} + {{!-- image --}} +
      + +
      + {{!-- amount --}} +
      {{itemData.quantity}}
      +
      + {{!-- name --}} +

      {{item.name}}

      + {{!-- item specifics --}} +
      {{lookup ../../config.armorMaterialTypes itemData.armorMaterialType}}
      {{!-- SPECIFIC --}} +
      {{lookup ../../config.armorTypes itemData.armorType}}
      {{!-- SPECIFIC --}} +
      {{itemData.armorValue}}
      {{!-- SPECIFIC --}} + {{!-- description --}} +
      {{{itemData.description}}}
      + {{!-- edit & delete buttons --}} +
      + + +
      +
    4. + {{/with}} + {{/each}} +
    \ No newline at end of file From 4e37991b0ffdd0f6ba93127c0e7c2e8083996783 Mon Sep 17 00:00:00 2001 From: Gesina Schwalbe Date: Tue, 29 Dec 2020 20:36:54 +0100 Subject: [PATCH 07/15] made char sheet body scrollable --- src/scss/components/_apps.scss | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/scss/components/_apps.scss b/src/scss/components/_apps.scss index 8a5d82f0..f305ef33 100644 --- a/src/scss/components/_apps.scss +++ b/src/scss/components/_apps.scss @@ -7,9 +7,12 @@ overflow: hidden; } + .sheet-body { + overflow-y: auto; + } .tab { height: 100%; - overflow-y: scroll; + overflow-y: visible; align-content: flex-start; ol { overflow-y: visible; From d39194c4fa48c4c2de0cb633a02f5d8e823d2724 Mon Sep 17 00:00:00 2001 From: Gesina Schwalbe Date: Tue, 29 Dec 2020 20:37:30 +0100 Subject: [PATCH 08/15] added shield list in char sheet --- src/templates/actor/partials/items.hbs | 54 +++++++++++++++++++++++++- 1 file changed, 52 insertions(+), 2 deletions(-) diff --git a/src/templates/actor/partials/items.hbs b/src/templates/actor/partials/items.hbs index 03da82f5..0143f89c 100644 --- a/src/templates/actor/partials/items.hbs +++ b/src/templates/actor/partials/items.hbs @@ -9,7 +9,7 @@
    1. -
      {{!-- equipped --}} +
      {{!-- equipped --}} {{!-- SPECIFIC --}}
      #
      {{!-- amount --}}
      @@ -66,7 +66,7 @@
      1. -
        {{!-- equipped --}} +
        {{!-- equipped --}} {{!-- SPECIFIC --}}
        #
        {{!-- amount --}}
        @@ -113,4 +113,54 @@ {{/with}} {{/each}}
      + + + {{!-- SHIELD --}} +

      {{localize "DS4.ItemTypeShield"}}

      {{!-- SPECIFIC --}} +
        +
      1. +
        +
        {{!-- equipped --}} {{!-- SPECIFIC --}} +
        +
        #
        {{!-- amount --}} +
        +
        {{localize "DS4.ItemName"}}
        +
        {{localize "DS4.ArmorValueAbbr"}}
        {{!-- SPECIFIC --}} +
        {{localize "DS4.Description"}}
        + {{!-- add button --}} +
        {{!-- SPECIFIC --}} + + {{localize "DS4.ActionAddItem"}} {{!-- SPECIFIC --}} +
        +
      2. + {{#each itemsByType.shield as |item id|}} {{!-- SPECIFIC --}} + {{#with item.data.data as |itemData|}} +
      3. +
        + {{!-- equipped? --}} + {{#if itemData.equipped}} + {{else}} + {{/if}} {{!--SPECIFIC --}} + {{!-- image --}} +
        + +
        + {{!-- amount --}} +
        {{itemData.quantity}}
        +
        + {{!-- name --}} +

        {{item.name}}

        + {{!-- item specifics --}} +
        {{itemData.armorValue}}
        {{!-- SPECIFIC --}} + {{!-- description --}} +
        {{{itemData.description}}}
        + {{!-- edit & delete buttons --}} +
        + + +
        +
      4. + {{/with}} + {{/each}} +
\ No newline at end of file From b71f229e1601692dd72390890b4cbd0463eade57 Mon Sep 17 00:00:00 2001 From: Gesina Schwalbe Date: Tue, 29 Dec 2020 21:27:21 +0100 Subject: [PATCH 09/15] proper formatting for items list titles --- src/scss/components/_items.scss | 8 ++++++++ src/templates/actor/partials/items.hbs | 6 +++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/scss/components/_items.scss b/src/scss/components/_items.scss index e13c8458..edbd0bbe 100644 --- a/src/scss/components/_items.scss +++ b/src/scss/components/_items.scss @@ -44,3 +44,11 @@ } } } + +.items-list-title { + margin-top: 2em; + margin-bottom: 0px; + padding-left: 1em; + border-bottom: 2px groove $c-border-groove; + font-weight: bold; +} \ No newline at end of file diff --git a/src/templates/actor/partials/items.hbs b/src/templates/actor/partials/items.hbs index 0143f89c..7fb3c5e3 100644 --- a/src/templates/actor/partials/items.hbs +++ b/src/templates/actor/partials/items.hbs @@ -5,7 +5,7 @@
{{!-- WEAPONS --}} -

{{localize "DS4.ItemTypeWeapon"}}

{{!-- SPECIFIC --}} +

{{localize "DS4.ItemTypeWeapon"}}

{{!-- SPECIFIC --}}
  1. @@ -62,7 +62,7 @@
{{!-- ARMOR --}} -

{{localize "DS4.ItemTypeArmor"}}

{{!-- SPECIFIC --}} +

{{localize "DS4.ItemTypeArmor"}}

{{!-- SPECIFIC --}}
  1. @@ -116,7 +116,7 @@ {{!-- SHIELD --}} -

    {{localize "DS4.ItemTypeShield"}}

    {{!-- SPECIFIC --}} +

    {{localize "DS4.ItemTypeShield"}}

    {{!-- SPECIFIC --}}
    1. From 3184de0e7a714e8699eb2f25a102ae840f3ee763 Mon Sep 17 00:00:00 2001 From: Gesina Schwalbe Date: Tue, 29 Dec 2020 21:27:50 +0100 Subject: [PATCH 10/15] added trinket list to char sheet --- src/templates/actor/partials/items.hbs | 47 +++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/src/templates/actor/partials/items.hbs b/src/templates/actor/partials/items.hbs index 7fb3c5e3..ffa4ef14 100644 --- a/src/templates/actor/partials/items.hbs +++ b/src/templates/actor/partials/items.hbs @@ -1,5 +1,4 @@ {{!-- TODO: hover shows complete name of abbreviations --}} -{{!-- TODO: try to use alias for the item type via HBS with and lookup --}} {{!-- TODO: Where possible use icons with complete names as hovers instead of long names --}} {{!-- Tab with overview and quick-actions on owned items --}}
      @@ -163,4 +162,50 @@ {{/with}} {{/each}}
    + + {{!-- TRINKET --}} +

    {{localize "DS4.ItemTypeTrinket"}}

    {{!-- SPECIFIC --}} +
      +
    1. +
      +
      {{!-- equipped --}} {{!-- SPECIFIC --}} +
      +
      #
      {{!-- amount --}} +
      +
      {{localize "DS4.ItemName"}}
      +
      {{localize "DS4.Description"}}
      + {{!-- add button --}} +
      {{!-- SPECIFIC --}} + + {{localize "DS4.ActionAddItem"}} {{!-- SPECIFIC --}} +
      +
    2. + {{#each itemsByType.trinket as |item id|}} {{!-- SPECIFIC --}} + {{#with item.data.data as |itemData|}} +
    3. +
      + {{!-- equipped? --}} + {{#if itemData.equipped}} + {{else}} + {{/if}} {{!--SPECIFIC --}} + {{!-- image --}} +
      + +
      + {{!-- amount --}} +
      {{itemData.quantity}}
      +
      + {{!-- name --}} +

      {{item.name}}

      + {{!-- description --}} +
      {{{itemData.description}}}
      + {{!-- edit & delete buttons --}} +
      + + +
      +
    4. + {{/with}} + {{/each}} +
    \ No newline at end of file From 4f5e6a5ebcf20d3a4a23bee6fa56f72bb517192a Mon Sep 17 00:00:00 2001 From: Gesina Schwalbe Date: Tue, 29 Dec 2020 22:01:40 +0100 Subject: [PATCH 11/15] centering of num item values in char sheet Changes: - number values of items in the items overview of a char sheet are now horizontally centered - description content is now vertically correctly aligned --- src/scss/components/_items.scss | 9 ++++ src/templates/actor/partials/items.hbs | 69 ++++++++++++++------------ 2 files changed, 46 insertions(+), 32 deletions(-) diff --git a/src/scss/components/_items.scss b/src/scss/components/_items.scss index edbd0bbe..9c725e83 100644 --- a/src/scss/components/_items.scss +++ b/src/scss/components/_items.scss @@ -33,6 +33,10 @@ text-align: right; } + .item-num-val { + text-align: center; + } + .item-description { font-size: 75%; white-space: nowrap; @@ -42,6 +46,11 @@ text-overflow: ellipsis; overflow: hidden; } + p:first-child { + margin-top: 0px; + padding-top: 0px; + } + } } diff --git a/src/templates/actor/partials/items.hbs b/src/templates/actor/partials/items.hbs index ffa4ef14..602c9a0e 100644 --- a/src/templates/actor/partials/items.hbs +++ b/src/templates/actor/partials/items.hbs @@ -4,25 +4,26 @@
    {{!-- WEAPONS --}} -

    {{localize "DS4.ItemTypeWeapon"}}

    {{!-- SPECIFIC --}} +

    {{localize "DS4.ItemTypeWeapon"}}

    {{!-- SPECIFIC --}}
    1. {{!-- equipped --}} {{!-- SPECIFIC --}}
      -
      #
      {{!-- amount --}} +
      #
      {{!-- amount --}}
      -
      {{localize "DS4.ItemName"}}
      +
      {{localize "DS4.ItemName"}}
      {{localize "DS4.AttackTypeAbbr"}}
      {{!-- SPECIFIC --}}
      -
      {{localize "DS4.WeaponBonusAbbr"}}
      {{!-- SPECIFIC --}} -
      {{localize "DS4.OpponentDefenseAbbr"}}
      {{!-- SPECIFIC --}} +
      {{localize "DS4.WeaponBonusAbbr"}}
      {{!-- SPECIFIC --}} +
      {{localize "DS4.OpponentDefenseAbbr"}}
      {{!-- SPECIFIC --}}
      {{localize "DS4.Description"}}
      {{!-- add button --}}
    2. {{#each itemsByType.weapon as |item id|}} {{!-- SPECIFIC --}} @@ -38,15 +39,15 @@
    {{!-- amount --}} -
    {{itemData.quantity}}
    +
    {{itemData.quantity}}
{{!-- name --}} -

{{item.name}}

+

{{item.name}}

{{!-- item specifics --}}
{{lookup ../../config.attackTypes itemData.attackType}}
{{!-- SPECIFIC --}}
-
{{itemData.weaponBonus}}
{{!-- SPECIFIC --}} -
{{itemData.opponentDefense}}
{{!-- SPECIFIC --}} +
{{itemData.weaponBonus}}
{{!-- SPECIFIC --}} +
{{itemData.opponentDefense}}
{{!-- SPECIFIC --}}
{{!-- description --}}
{{{itemData.description}}}
@@ -61,23 +62,24 @@ {{!-- ARMOR --}} -

{{localize "DS4.ItemTypeArmor"}}

{{!-- SPECIFIC --}} +

{{localize "DS4.ItemTypeArmor"}}

{{!-- SPECIFIC --}}
  1. {{!-- equipped --}} {{!-- SPECIFIC --}}
    -
    #
    {{!-- amount --}} +
    #
    {{!-- amount --}}
    -
    {{localize "DS4.ItemName"}}
    +
    {{localize "DS4.ItemName"}}
    {{localize "DS4.ArmorMaterialTypeAbbr"}}
    {{!-- SPECIFIC --}}
    {{localize "DS4.ArmorTypeAbbr"}}
    {{!-- SPECIFIC --}} -
    {{localize "DS4.ArmorValueAbbr"}}
    {{!-- SPECIFIC --}} +
    {{localize "DS4.ArmorValueAbbr"}}
    {{!-- SPECIFIC --}}
    {{localize "DS4.Description"}}
    {{!-- add button --}}
  2. {{#each itemsByType.armor as |item id|}} {{!-- SPECIFIC --}} @@ -96,11 +98,11 @@
    {{itemData.quantity}}
    {{!-- name --}} -

    {{item.name}}

    +

    {{item.name}}

    {{!-- item specifics --}}
    {{lookup ../../config.armorMaterialTypes itemData.armorMaterialType}}
    {{!-- SPECIFIC --}}
    {{lookup ../../config.armorTypes itemData.armorType}}
    {{!-- SPECIFIC --}} -
    {{itemData.armorValue}}
    {{!-- SPECIFIC --}} +
    {{itemData.armorValue}}
    {{!-- SPECIFIC --}} {{!-- description --}}
    {{{itemData.description}}}
    {{!-- edit & delete buttons --}} @@ -115,21 +117,22 @@ {{!-- SHIELD --}} -

    {{localize "DS4.ItemTypeShield"}}

    {{!-- SPECIFIC --}} +

    {{localize "DS4.ItemTypeShield"}}

    {{!-- SPECIFIC --}}
    1. {{!-- equipped --}} {{!-- SPECIFIC --}}
      -
      #
      {{!-- amount --}} +
      #
      {{!-- amount --}}
      -
      {{localize "DS4.ItemName"}}
      -
      {{localize "DS4.ArmorValueAbbr"}}
      {{!-- SPECIFIC --}} +
      {{localize "DS4.ItemName"}}
      +
      {{localize "DS4.ArmorValueAbbr"}}
      {{!-- SPECIFIC --}}
      {{localize "DS4.Description"}}
      {{!-- add button --}}
    2. {{#each itemsByType.shield as |item id|}} {{!-- SPECIFIC --}} @@ -148,9 +151,9 @@
      {{itemData.quantity}}
      {{!-- name --}} -

      {{item.name}}

      +

      {{item.name}}

      {{!-- item specifics --}} -
      {{itemData.armorValue}}
      {{!-- SPECIFIC --}} +
      {{itemData.armorValue}}
      {{!-- SPECIFIC --}} {{!-- description --}}
      {{{itemData.description}}}
      {{!-- edit & delete buttons --}} @@ -164,20 +167,22 @@
    {{!-- TRINKET --}} -

    {{localize "DS4.ItemTypeTrinket"}}

    {{!-- SPECIFIC --}} +

    {{localize "DS4.ItemTypeTrinket"}}

    {{!-- SPECIFIC --}}
    1. {{!-- equipped --}} {{!-- SPECIFIC --}}
      -
      #
      {{!-- amount --}} +
      #
      {{!-- amount --}}
      -
      {{localize "DS4.ItemName"}}
      +
      {{localize "DS4.ItemName"}}
      +
      {{localize "DS4.StorageLocation"}}
      {{!-- SPECIFIC --}}
      {{localize "DS4.Description"}}
      {{!-- add button --}}
    2. {{#each itemsByType.trinket as |item id|}} {{!-- SPECIFIC --}} From 3b92242eb780e3d1a17c8a6e962a67d05f311b16 Mon Sep 17 00:00:00 2001 From: Gesina Schwalbe Date: Tue, 29 Dec 2020 22:02:43 +0100 Subject: [PATCH 12/15] added equipment list to char sheet --- src/templates/actor/partials/items.hbs | 57 +++++++++++++++++++++++--- 1 file changed, 52 insertions(+), 5 deletions(-) diff --git a/src/templates/actor/partials/items.hbs b/src/templates/actor/partials/items.hbs index 602c9a0e..874f1fe9 100644 --- a/src/templates/actor/partials/items.hbs +++ b/src/templates/actor/partials/items.hbs @@ -52,7 +52,7 @@ {{!-- description --}}
      {{{itemData.description}}}
      {{!-- edit & delete buttons --}} -
      +
      @@ -106,7 +106,7 @@ {{!-- description --}}
      {{{itemData.description}}}
      {{!-- edit & delete buttons --}} -
      +
      @@ -157,7 +157,7 @@ {{!-- description --}}
      {{{itemData.description}}}
      {{!-- edit & delete buttons --}} -
      +
      @@ -201,11 +201,58 @@
      {{itemData.quantity}}
      {{!-- name --}} -

      {{item.name}}

      +

      {{item.name}}

      + {{!-- storage location --}} +
      {{{itemData.storageLocation}}}
      {{!-- SPECIFIC --}} {{!-- description --}}
      {{{itemData.description}}}
      {{!-- edit & delete buttons --}} -
      +
      + + +
      + + {{/with}} + {{/each}} +
    + + {{!-- EQUIPMENT --}} +

    {{localize "DS4.ItemTypeEquipment"}}

    {{!-- SPECIFIC --}} +
      +
    1. +
      +
      +
      #
      {{!-- amount --}} +
      +
      {{localize "DS4.ItemName"}}
      +
      {{localize "DS4.StorageLocation"}}
      {{!-- SPECIFIC --}} +
      {{localize "DS4.Description"}}
      + {{!-- add button --}} +
      {{!-- SPECIFIC --}} + + + {{localize "DS4.ActionAddItem"}} +
      +
    2. + {{#each itemsByType.equipment as |item id|}} {{!-- SPECIFIC --}} + {{#with item.data.data as |itemData|}} +
    3. +
      + {{!-- image --}} +
      + +
      + {{!-- amount --}} +
      {{itemData.quantity}}
      +
      + {{!-- name --}} +

      {{item.name}}

      + {{!-- storage location --}} +
      {{{itemData.storageLocation}}}
      {{!-- SPECIFIC --}} + {{!-- description --}} +
      {{{itemData.description}}}
      + {{!-- edit & delete buttons --}} +
      From e1248f937b74f0450147af2be1075c87cbbd628d Mon Sep 17 00:00:00 2001 From: Gesina Schwalbe Date: Tue, 29 Dec 2020 22:36:27 +0100 Subject: [PATCH 13/15] added tooltips for abbr in item list heads --- src/lang/en.json | 3 +- src/templates/actor/partials/items.hbs | 41 +++++++++++++------------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/lang/en.json b/src/lang/en.json index 42437b0e..800cb596 100644 --- a/src/lang/en.json +++ b/src/lang/en.json @@ -12,10 +12,11 @@ "DS4.OpponentDefenseAbbr": "OD", "DS4.AttackTypeMelee": "Melee", "DS4.AttackTypeRanged": "Ranged", - "DS4.AttackTypeMeleeRanged": "Melee / Ranged", + "DS4.AttackTypeMeleeRanged": "Melee / Ranged", "DS4.Quantity": "Quantity", "DS4.PriceGold": "Price (Gold)", "DS4.StorageLocation": "Stored at", + "DS4.ItemEquipped": "Item equipped?", "DS4.ItemAvailability": "Availability", "DS4.ItemAvailabilityHamlet": "Hamlet", "DS4.ItemAvailabilityVilage": "Village", diff --git a/src/templates/actor/partials/items.hbs b/src/templates/actor/partials/items.hbs index 874f1fe9..a4625233 100644 --- a/src/templates/actor/partials/items.hbs +++ b/src/templates/actor/partials/items.hbs @@ -1,4 +1,3 @@ -{{!-- TODO: hover shows complete name of abbreviations --}} {{!-- TODO: Where possible use icons with complete names as hovers instead of long names --}} {{!-- Tab with overview and quick-actions on owned items --}}
      @@ -8,15 +7,15 @@
      1. -
        {{!-- equipped --}} {{!-- SPECIFIC --}} +
        E
        {{!-- equipped --}} {{!-- SPECIFIC --}}
        -
        #
        {{!-- amount --}} +
        #
        {{!-- amount --}}
        {{localize "DS4.ItemName"}}
        -
        {{localize "DS4.AttackTypeAbbr"}}
        {{!-- SPECIFIC --}} +
        {{localize "DS4.AttackTypeAbbr"}}
        {{!-- SPECIFIC --}}
        -
        {{localize "DS4.WeaponBonusAbbr"}}
        {{!-- SPECIFIC --}} -
        {{localize "DS4.OpponentDefenseAbbr"}}
        {{!-- SPECIFIC --}} +
        {{localize "DS4.WeaponBonusAbbr"}}
        {{!-- SPECIFIC --}} +
        {{localize "DS4.OpponentDefenseAbbr"}}
        {{!-- SPECIFIC --}}
        {{localize "DS4.Description"}}
        {{!-- add button --}} @@ -66,14 +65,14 @@
        1. -
          {{!-- equipped --}} {{!-- SPECIFIC --}} +
          E
          {{!-- equipped --}} {{!-- SPECIFIC --}}
          -
          #
          {{!-- amount --}} +
          #
          {{!-- amount --}}
          {{localize "DS4.ItemName"}}
          -
          {{localize "DS4.ArmorMaterialTypeAbbr"}}
          {{!-- SPECIFIC --}} -
          {{localize "DS4.ArmorTypeAbbr"}}
          {{!-- SPECIFIC --}} -
          {{localize "DS4.ArmorValueAbbr"}}
          {{!-- SPECIFIC --}} +
          {{localize "DS4.ArmorMaterialTypeAbbr"}}
          {{!-- SPECIFIC --}} +
          {{localize "DS4.ArmorTypeAbbr"}}
          {{!-- SPECIFIC --}} +
          {{localize "DS4.ArmorValueAbbr"}}
          {{!-- SPECIFIC --}}
          {{localize "DS4.Description"}}
          {{!-- add button --}}
          {{!-- SPECIFIC --}} @@ -95,7 +94,7 @@
          {{!-- amount --}} -
          {{itemData.quantity}}
          +
          {{itemData.quantity}}
      {{!-- name --}}

      {{item.name}}

      @@ -121,12 +120,12 @@
      1. -
        {{!-- equipped --}} {{!-- SPECIFIC --}} +
        E
        {{!-- equipped --}} {{!-- SPECIFIC --}}
        -
        #
        {{!-- amount --}} +
        #
        {{!-- amount --}}
        {{localize "DS4.ItemName"}}
        -
        {{localize "DS4.ArmorValueAbbr"}}
        {{!-- SPECIFIC --}} +
        {{localize "DS4.ArmorValueAbbr"}}
        {{!-- SPECIFIC --}}
        {{localize "DS4.Description"}}
        {{!-- add button --}}
        {{!-- SPECIFIC --}} @@ -148,7 +147,7 @@
        {{!-- amount --}} -
        {{itemData.quantity}}
        +
        {{itemData.quantity}}
        {{!-- name --}}

        {{item.name}}

        @@ -171,9 +170,9 @@
        1. -
          {{!-- equipped --}} {{!-- SPECIFIC --}} +
          E
          {{!-- equipped --}} {{!-- SPECIFIC --}}
          -
          #
          {{!-- amount --}} +
          #
          {{!-- amount --}}
          {{localize "DS4.ItemName"}}
          {{localize "DS4.StorageLocation"}}
          {{!-- SPECIFIC --}} @@ -198,7 +197,7 @@ {{!-- amount --}} -
          {{itemData.quantity}}
          +
          {{itemData.quantity}}
          {{!-- name --}}

          {{item.name}}

          @@ -222,7 +221,7 @@
        2. -
          #
          {{!-- amount --}} +
          #
          {{!-- amount --}}
          {{localize "DS4.ItemName"}}
          {{localize "DS4.StorageLocation"}}
          {{!-- SPECIFIC --}} @@ -243,7 +242,7 @@ {{!-- amount --}} -
          {{itemData.quantity}}
          +
          {{itemData.quantity}}
          {{!-- name --}}

          {{item.name}}

          From 911b044edb02e0fb55854976ce8625681ad810f0 Mon Sep 17 00:00:00 2001 From: Gesina Schwalbe Date: Tue, 29 Dec 2020 23:01:25 +0100 Subject: [PATCH 14/15] changed Action to UserInteraction in localization --- src/lang/en.json | 2 +- src/templates/actor/partials/items.hbs | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lang/en.json b/src/lang/en.json index 800cb596..79b50fed 100644 --- a/src/lang/en.json +++ b/src/lang/en.json @@ -1,5 +1,5 @@ { - "DS4.ActionAddItem": "Add item", + "DS4.UserInteractionAddItem": "Add item", "DS4.Description": "Description", "DS4.DescriptionAbbr": "Desc", "DS4.Details": "Details", diff --git a/src/templates/actor/partials/items.hbs b/src/templates/actor/partials/items.hbs index a4625233..2e773eba 100644 --- a/src/templates/actor/partials/items.hbs +++ b/src/templates/actor/partials/items.hbs @@ -22,7 +22,7 @@
          {{!-- SPECIFIC --}} - {{localize "DS4.ActionAddItem"}} + {{localize "DS4.UserInteractionAddItem"}}
        3. {{#each itemsByType.weapon as |item id|}} {{!-- SPECIFIC --}} @@ -78,7 +78,7 @@
          {{!-- SPECIFIC --}} - {{localize "DS4.ActionAddItem"}} + {{localize "DS4.UserInteractionAddItem"}}
          {{#each itemsByType.armor as |item id|}} {{!-- SPECIFIC --}} @@ -131,7 +131,7 @@
          {{!-- SPECIFIC --}} - {{localize "DS4.ActionAddItem"}} + {{localize "DS4.UserInteractionAddItem"}}
          {{#each itemsByType.shield as |item id|}} {{!-- SPECIFIC --}} @@ -181,7 +181,7 @@
          {{!-- SPECIFIC --}} - {{localize "DS4.ActionAddItem"}} + {{localize "DS4.UserInteractionAddItem"}}
          {{#each itemsByType.trinket as |item id|}} {{!-- SPECIFIC --}} @@ -230,7 +230,7 @@
          {{!-- SPECIFIC --}} - {{localize "DS4.ActionAddItem"}} + {{localize "DS4.UserInteractionAddItem"}}
          {{#each itemsByType.equipment as |item id|}} {{!-- SPECIFIC --}} From 767e46b490709578bec0a3da069f487cc14762c0 Mon Sep 17 00:00:00 2001 From: Gesina Schwalbe Date: Tue, 29 Dec 2020 23:03:11 +0100 Subject: [PATCH 15/15] removed whitespace --- src/lang/en.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lang/en.json b/src/lang/en.json index 79b50fed..b7c84f1d 100644 --- a/src/lang/en.json +++ b/src/lang/en.json @@ -12,7 +12,7 @@ "DS4.OpponentDefenseAbbr": "OD", "DS4.AttackTypeMelee": "Melee", "DS4.AttackTypeRanged": "Ranged", - "DS4.AttackTypeMeleeRanged": "Melee / Ranged", + "DS4.AttackTypeMeleeRanged": "Melee / Ranged", "DS4.Quantity": "Quantity", "DS4.PriceGold": "Price (Gold)", "DS4.StorageLocation": "Stored at",