diff --git a/src/ds4.scss b/src/ds4.scss index 0f8aec2f..9db72502 100644 --- a/src/ds4.scss +++ b/src/ds4.scss @@ -19,5 +19,5 @@ @include meta.load-css("scss/components/forms"); @include meta.load-css("scss/components/item_list"); @include meta.load-css("scss/components/tabs"); - @include meta.load-css("scss/components/talents"); + @include meta.load-css("scss/components/talent_rank_equation"); } diff --git a/src/lang/de.json b/src/lang/de.json index f7c2fa70..31800739 100644 --- a/src/lang/de.json +++ b/src/lang/de.json @@ -143,6 +143,7 @@ "DS4.TalentRankMax": "Maximaler Rang", "DS4.TalentRankMod": "Zusätzlicher Rang", "DS4.TalentRankTotal": "Gesamter Rang", + "DS4.TalentRankOf": "von", "DS4.CharacterLanguageLanguages": "Sprachen", "DS4.CharacterLanguageAlphabets": "Schriftzeichen", "DS4.SpecialCreatureAbilityExperiencePoints": "Erfahrungspunkte", diff --git a/src/lang/en.json b/src/lang/en.json index baf7007d..0894350b 100644 --- a/src/lang/en.json +++ b/src/lang/en.json @@ -143,6 +143,7 @@ "DS4.TalentRankMax": "Maximum Ranks", "DS4.TalentRankMod": "Additional Ranks", "DS4.TalentRankTotal": "Total Ranks", + "DS4.TalentRankOf": "of", "DS4.CharacterLanguageLanguages": "Languages", "DS4.CharacterLanguageAlphabets": "Alphabets", "DS4.SpecialCreatureAbilityExperiencePoints": "Experience Points", diff --git a/src/module/ds4.ts b/src/module/ds4.ts index 5ca1f257..259cd7ea 100644 --- a/src/module/ds4.ts +++ b/src/module/ds4.ts @@ -63,6 +63,7 @@ async function registerHandlebarsPartials() { "systems/ds4/templates/actor/partials/special-creature-abilities-overview.hbs", "systems/ds4/templates/actor/partials/character-inventory.hbs", "systems/ds4/templates/actor/partials/creature-inventory.hbs", + "systems/ds4/templates/actor/partials/talent-rank-equation.hbs", ]; return loadTemplates(templatePaths); } diff --git a/src/scss/components/_item_list.scss b/src/scss/components/_item_list.scss index 75fcbe3d..3ee39861 100644 --- a/src/scss/components/_item_list.scss +++ b/src/scss/components/_item_list.scss @@ -24,17 +24,25 @@ grid-template-columns: $row-height $row-height 3ch 3fr 1fr 1fr 3ch 5fr 4ch; } &--shield { - grid-template-columns: $row-height $row-height 3ch 3fr 3ch 5fr 4ch; + grid-template-columns: $row-height $row-height 3ch 1fr 3ch 3fr 4ch; } &--equipment { - grid-template-columns: $row-height $row-height 3ch 3fr 10ch 5fr 4ch; + grid-template-columns: $row-height $row-height 3ch 1fr 10ch 3fr 4ch; } &--loot { - grid-template-columns: $row-height 3ch 3fr 10ch 5fr 4ch; + grid-template-columns: $row-height 3ch 1fr 10ch 3fr 4ch; } &--spell { grid-template-columns: $row-height $row-height 2fr $row-height 1fr 1fr 1fr 1fr 4ch; } + &--talent { + grid-template-columns: $row-height 1fr 1fr 3fr 4ch; + } + &--racial-ability, + &--language, + &--alphabet { + grid-template-columns: $row-height 1fr 3fr 4ch; + } &__row { grid-column: 1/-1; diff --git a/src/scss/components/_tabs.scss b/src/scss/components/_tabs.scss index 4a7607ef..064923c3 100644 --- a/src/scss/components/_tabs.scss +++ b/src/scss/components/_tabs.scss @@ -6,6 +6,7 @@ nav.tabs { border-bottom: variables.$border-groove; .item { font-weight: bold; + white-space: nowrap; } .item.active { diff --git a/src/scss/components/_talent_rank_equation.scss b/src/scss/components/_talent_rank_equation.scss new file mode 100644 index 00000000..a3c9e46b --- /dev/null +++ b/src/scss/components/_talent_rank_equation.scss @@ -0,0 +1,11 @@ +.ds4-talent-rank-equation { + display: flex; + gap: 0.5em; + &__value { + height: auto; + border: 0; + padding: 0; + background-color: transparent; + text-align: center; + } +} diff --git a/src/scss/components/_talents.scss b/src/scss/components/_talents.scss deleted file mode 100644 index 2f8db41b..00000000 --- a/src/scss/components/_talents.scss +++ /dev/null @@ -1,3 +0,0 @@ -.talent-ranks-equation { - text-align: center; -} diff --git a/src/templates/actor/partials/talent-rank-equation.hbs b/src/templates/actor/partials/talent-rank-equation.hbs new file mode 100644 index 00000000..8304fc96 --- /dev/null +++ b/src/templates/actor/partials/talent-rank-equation.hbs @@ -0,0 +1,33 @@ +{{!-- +!-- Render an input element for a rank value property of an item. +!-- @param talentRank: The talentRank +!-- @param property: The key of the property in item.data (if 'base', the max value is set automatically) +!-- @param disabled: If given, is placed plainly into the input as HTML property; meant to be set to "disabled" to +disable the input element +!-- @param localizeString: The string to use as key for the localized tooltip +--}} +{{#*inline "talentRankValue"}} + +{{/inline}} + + +{{!-- +!-- Render an input element for a rank value property of an item. +!-- @param talentRank: The talent rank +--}} +
+ {{!-- acquired rank --}} + {{> talentRankValue talentRank=talentRank property='base' localizeString='DS4.TalentRankBase'}} +
( {{localize "DS4.TalentRankOf"}}
+ {{!-- maximum acquirable rank --}} + {{> talentRankValue talentRank=talentRank property='max' localizeString='DS4.TalentRankMax'}} +
) +
+ {{!-- additional ranks --}} + {{> talentRankValue talentRank=talentRank property='mod' localizeString='DS4.TalentRankMod'}} +
=
+ {{!-- derived total rank --}} + {{> talentRankValue talentRank=talentRank property='total' localizeString='DS4.TalentRankTotal' + disabled='disabled'}} +
diff --git a/src/templates/actor/partials/talents-abilities-overview.hbs b/src/templates/actor/partials/talents-abilities-overview.hbs index 3bac632a..448bd011 100644 --- a/src/templates/actor/partials/talents-abilities-overview.hbs +++ b/src/templates/actor/partials/talents-abilities-overview.hbs @@ -20,21 +20,6 @@ {{/inline}} -{{!-- -!-- Render an input element for a rank value property of an item. -!-- -!-- @param item: the item -!-- @param property: the key of the property in item.data (if 'base', the max value is set automatically) -!-- @param disabled: if given, is placed plainly into the input as HTML property; -!-- meant to be set to "disabled" to disable the input element ---}} -{{#*inline "talentRankValue"}} - -{{/inline}} - - {{!-- !-- Render a talent list row from a given item. !-- It is a flexbox with a child for each item value of interest. @@ -43,35 +28,41 @@ !-- @param item: hand over the item to the partial as hash parameter --}} {{#*inline "talentListEntry"}} -
  • +
  • {{!-- image --}} -
    - -
    +
    {{!-- name --}} - -
    - {{!-- acquired rank --}} - {{> talentRankValue item=item property='base' localizeString='DS4.TalentRankBase'}} - ( of - {{!-- maximum acquirable rank --}} - {{> talentRankValue item=item property='max' localizeString='DS4.TalentRankMax'}} - ) + - {{!-- additional ranks --}} - {{> talentRankValue item=item property='mod' localizeString='DS4.TalentRankMod'}} - = - {{!-- derived total rank --}} - {{> talentRankValue item=item property='total' localizeString='DS4.TalentRankTotal' disabled='disabled'}} -
    + {{!-- talent tank equation --}} + {{> systems/ds4/templates/actor/partials/talent-rank-equation.hbs talentRank=item.data.rank}} {{!-- description --}} -
    +
    {{{item.data.description}}}
    {{!-- control buttons --}} {{> systems/ds4/templates/actor/partials/overview-control-buttons.hbs }}
  • {{/inline}} +{{!-- +!-- Render a list header for a base item list entry from a given item. +!-- The partial assumes a variable dataType to be given in the context. +--}} +{{#*inline "talentListHeader"}} +
  • + {{!-- image --}} +
    + {{!-- name --}} +
    {{localize 'DS4.ItemName'}}
    + {{!-- rank info --}} +
    {{localize 'DS4.TalentRank'}}
    + {{!-- description --}} +
    {{localize 'DS4.Description'}}
    + {{!-- control buttons placeholder --}} +
    +
  • +{{/inline}} + {{!-- !-- Render a list row for a base item from a given item. @@ -82,17 +73,15 @@ !-- @param item: hand over the item to the partial as hash parameter --}} {{#*inline "baseItemListEntry"}} -
  • +
  • {{!-- image --}} -
    - -
    +
    {{!-- name --}} - + {{!-- description --}} -
    - {{{item.data.description}}}
    +
    + {{{item.data.description}}}
    {{!-- control buttons --}} {{> systems/ds4/templates/actor/partials/overview-control-buttons.hbs }}
  • @@ -101,72 +90,57 @@ {{!-- !-- Render a list header for a base item list entry 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'}}
    +
    {{localize 'DS4.ItemName'}}
    {{!-- description --}} -
    {{localize 'DS4.Description'}}
    +
    {{localize 'DS4.Description'}}
    {{!-- control buttons placeholder --}}
  • {{/inline}} - {{!-- ======================================================================== --}} -
    -

    {{localize 'DS4.ItemTypeTalentPlural'}}

    +

    {{localize 'DS4.ItemTypeTalentPlural'}}

    {{#> ifHasItemOfType itemsArray=itemsByType.talent dataType='talent' }} -
      -
    1. - {{!-- image --}} -
      - {{!-- name --}} -
      {{localize 'DS4.ItemName'}}
      - {{!-- rank info --}} -
      {{localize 'DS4.TalentRank'}}
      - {{!-- description --}} -
      {{localize 'DS4.Description'}}
      - {{!-- control buttons placeholder --}} -
      -
    2. +
        + {{> talentListHeader}} {{#each itemsByType.talent as |item id|}} {{> talentListEntry item=item}} {{/each}}
      {{/ifHasItemOfType}} -

      {{localize 'DS4.ItemTypeRacialAbilityPlural'}}

      +

      {{localize 'DS4.ItemTypeRacialAbilityPlural'}}

      {{#> ifHasItemOfType itemsArray=itemsByType.racialAbility dataType='racialAbility' }} -
        - {{> baseItemListHeader dataType='racialAbility' }} +
          + {{> baseItemListHeader}} {{#each itemsByType.racialAbility as |item id|}} {{> baseItemListEntry item=item}} {{/each}}
        {{/ifHasItemOfType}} -

        {{localize 'DS4.ItemTypeLanguagePlural'}}

        +

        {{localize 'DS4.ItemTypeLanguagePlural'}}

        {{#> ifHasItemOfType itemsArray=itemsByType.language dataType='language' }} -
          - {{> baseItemListHeader dataType='language' }} +
            + {{> baseItemListHeader}} {{#each itemsByType.language as |item id|}} {{> baseItemListEntry item=item}} {{/each}}
          {{/ifHasItemOfType}} -

          {{localize 'DS4.ItemTypeAlphabetPlural'}}

          +

          {{localize 'DS4.ItemTypeAlphabetPlural'}}

          {{#> ifHasItemOfType itemsArray=itemsByType.alphabet dataType='alphabet' }} -
            - {{> baseItemListHeader dataType='alphabet' }} +
              + {{> baseItemListHeader}} {{#each itemsByType.alphabet as |item id|}} {{> baseItemListEntry item=item}} {{/each}}