From 48d8d6e44d4eb27cced3d176066974a44c2e8806 Mon Sep 17 00:00:00 2001 From: Gesina Schwalbe Date: Tue, 29 Dec 2020 19:06:17 +0100 Subject: [PATCH] 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 --}}