diff --git a/src/scss/components/_effect_list.scss b/src/scss/components/_effect_list.scss deleted file mode 100644 index 06e18d36..00000000 --- a/src/scss/components/_effect_list.scss +++ /dev/null @@ -1,68 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2021 Johannes Loher - * SPDX-FileCopyrightText: 2021 Gesina Schwalbe - * - * SPDX-License-Identifier: MIT - */ - -@use "../utils/mixins"; -@use "../utils/variables"; - -.ds4-effect-list { - @include mixins.mark-invalid-or-disabled-input; - - $row-height: 1.75em; - - align-items: center; - display: grid; - grid-column-gap: 0.5em; - grid-row-gap: 0.2em; - grid-template-columns: $row-height $row-height 3fr 2fr 5ch; - margin: 0.5em 0; - overflow-y: auto; - padding: 0; - - :nth-child(5n + 1) { - justify-self: center; - } - - &__row { - display: contents; // TODO: Once chromium supports `grid-template-columns: subgrid` (https://bugs.chromium.org/p/chromium/issues/detail?id=618969), switch to `display: grid; grid: 1/-1; grid-template-columns: subgrid` - - &--header { - font-weight: bold; - } - - > * { - height: $row-height; - line-height: $row-height; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - } - } - - &__image { - border: none; - } - - &__editable { - background-color: transparent; - border: 0; - padding: 0; - - &--checkbox { - width: 100%; - height: 100%; - margin: 0px; - } - } - - &__control-buttons { - display: grid; - grid-template-columns: 1fr 1fr; - text-align: center; - width: 100%; - padding: 0 calc(1em / 3); - } -} diff --git a/src/scss/components/_item_list.scss b/src/scss/components/_embedded_document_list.scss similarity index 72% rename from src/scss/components/_item_list.scss rename to src/scss/components/_embedded_document_list.scss index 0b7700a3..e459e8d4 100644 --- a/src/scss/components/_item_list.scss +++ b/src/scss/components/_embedded_document_list.scss @@ -8,7 +8,7 @@ @use "../utils/mixins"; @use "../utils/variables"; -.ds4-item-list { +.ds4-embedded-document-list { @include mixins.mark-invalid-or-disabled-input; $row-height: 1.75em; @@ -23,24 +23,51 @@ &--weapon { grid-template-columns: $row-height $row-height 3ch 3fr $row-height 1fr 3ch 5fr 5ch; + :nth-child(9n + 1), + :nth-child(9n + 5), + :nth-child(9n + 6), + :nth-child(9n + 7) { + justify-self: center; + } } &--armor { grid-template-columns: $row-height $row-height 3ch 3fr 1fr 1fr 3ch 5fr 5ch; + :nth-child(9n + 1), + :nth-child(9n + 7) { + justify-self: center; + } } &--shield { grid-template-columns: $row-height $row-height 3ch 1fr 3ch 3fr 5ch; + :nth-child(7n + 1), + :nth-child(7n + 5) { + justify-self: center; + } } &--equipment { grid-template-columns: $row-height $row-height 3ch 1fr 10ch 3fr 5ch; + :nth-child(7n + 1) { + justify-self: center; + } } &--loot { grid-template-columns: $row-height 3ch 1fr 10ch 3fr 5ch; } &--spell { grid-template-columns: $row-height $row-height 2fr $row-height 1fr 1fr 1fr 1fr 5ch; + :nth-child(9n + 1), + :nth-child(9n + 4), + :nth-child(9n + 6), + :nth-child(9n + 7), + :nth-child(9n + 8) { + justify-self: center; + } } &--talent { grid-template-columns: $row-height 1fr 21ch 3fr 5ch; + :nth-child(9n + 3) { + justify-self: center; + } } &--racial-ability, &--language, @@ -49,6 +76,13 @@ grid-template-columns: $row-height 1fr 3fr 5ch; } + &--effect { + grid-template-columns: $row-height $row-height 3fr 2fr 5ch; + :nth-child(5n + 1) { + justify-self: center; + } + } + &__row { display: contents; // TODO: Once chromium supports `grid-template-columns: subgrid` (https://bugs.chromium.org/p/chromium/issues/detail?id=618969), switch to `display: grid; grid: 1/-1; grid-template-columns: subgrid` @@ -98,7 +132,7 @@ } } -.ds4-item-list-title { +.ds4-embedded-document-list-title { border-bottom: variables.$border-groove; font-weight: bold; margin-bottom: 0; diff --git a/src/scss/ds4.scss b/src/scss/ds4.scss index 8203eb62..79fb8a1d 100644 --- a/src/scss/ds4.scss +++ b/src/scss/ds4.scss @@ -34,9 +34,8 @@ @include meta.load-css("components/core_values"); @include meta.load-css("components/currency"); @include meta.load-css("components/description"); - @include meta.load-css("components/effect_list"); + @include meta.load-css("components/embedded_document_list"); @include meta.load-css("components/forms"); - @include meta.load-css("components/item_list"); @include meta.load-css("components/profile"); @include meta.load-css("components/rollable_image"); @include meta.load-css("components/sheet_tab_nav"); diff --git a/src/templates/sheets/actor/components/effect-list-entry.hbs b/src/templates/sheets/actor/components/effect-list-entry.hbs index 9106ddfe..4fbb0a95 100644 --- a/src/templates/sheets/actor/components/effect-list-entry.hbs +++ b/src/templates/sheets/actor/components/effect-list-entry.hbs @@ -9,9 +9,9 @@ SPDX-License-Identifier: MIT !-- Render an effect list entry row. !-- @param effectData: The data of the item. --}} -
  • +
  • {{!-- enabled --}} - diff --git a/src/templates/sheets/actor/components/effect-list-header.hbs b/src/templates/sheets/actor/components/effect-list-header.hbs index fdac8824..91311fe5 100644 --- a/src/templates/sheets/actor/components/effect-list-header.hbs +++ b/src/templates/sheets/actor/components/effect-list-header.hbs @@ -8,7 +8,7 @@ SPDX-License-Identifier: MIT {{!-- !-- Render an effect list header row. --}} -
  • +
  • {{!-- enabled --}}
    {{localize 'DS4.EffectEnabledAbbr'}}
    diff --git a/src/templates/sheets/actor/components/item-list-entry.hbs b/src/templates/sheets/actor/components/item-list-entry.hbs index 01adc41d..29a6d00a 100644 --- a/src/templates/sheets/actor/components/item-list-entry.hbs +++ b/src/templates/sheets/actor/components/item-list-entry.hbs @@ -15,10 +15,10 @@ SPDX-License-Identifier: MIT !-- @param hideDescription: A flag to disable the description column. !-- @param @partial-block: Custom column headers can be passed using the partial block. --}} -
  • +
  • {{!-- equipped --}} {{#if isEquipable}} - {{/if}} @@ -30,12 +30,12 @@ SPDX-License-Identifier: MIT {{!-- amount --}} {{#if hasQuantity}} - {{/if}} {{!-- name --}} - {{!-- item type specifics --}} @@ -45,7 +45,7 @@ SPDX-License-Identifier: MIT {{!-- description --}} {{#unless hideDescription}} -
    +
    {{{itemData.data.description}}}
    {{/unless}} diff --git a/src/templates/sheets/actor/components/item-list-header.hbs b/src/templates/sheets/actor/components/item-list-header.hbs index c2ebdb99..54229ade 100644 --- a/src/templates/sheets/actor/components/item-list-header.hbs +++ b/src/templates/sheets/actor/components/item-list-header.hbs @@ -14,7 +14,7 @@ SPDX-License-Identifier: MIT !-- @param hideDescription: A flag to disable the description column. !-- @param @partial-block: Custom column headers can be passed using the partial block. --}} -
  • +
  • {{!-- equipped --}} {{#if isEquipable}}
    {{localize 'DS4.ItemEquippedAbbr'}}
    diff --git a/src/templates/sheets/actor/components/items-overview.hbs b/src/templates/sheets/actor/components/items-overview.hbs index 049a1792..c9e25bf5 100644 --- a/src/templates/sheets/actor/components/items-overview.hbs +++ b/src/templates/sheets/actor/components/items-overview.hbs @@ -7,12 +7,12 @@ SPDX-License-Identifier: MIT --}} {{!-- WEAPONS --}} -

    {{localize 'DS4.ItemTypeWeaponPlural'}}

    +

    {{localize 'DS4.ItemTypeWeaponPlural'}}

    {{#unless (isEmpty itemsByType.weapon)}} -
      +
        {{#> systems/ds4/templates/sheets/actor/components/item-list-header.hbs isEquipable=true hasQuantity=true}} {{!-- attack type --}} -
        {{localize 'DS4.AttackTypeAbbr'}}
        +
        {{localize 'DS4.AttackTypeAbbr'}}
        {{!-- weapon bonus --}}
        @@ -29,7 +29,7 @@ SPDX-License-Identifier: MIT {{#> systems/ds4/templates/sheets/actor/components/item-list-entry.hbs itemData=itemData isEquipable=true hasQuantity=true}} {{!-- attack type --}} - {{!-- weapon bonus --}} @@ -45,9 +45,9 @@ SPDX-License-Identifier: MIT documentType='item' type='weapon'}} {{!-- ARMOR --}} -

        {{localize 'DS4.ItemTypeArmorPlural'}}

        +

        {{localize 'DS4.ItemTypeArmorPlural'}}

        {{#unless (isEmpty itemsByType.armor)}} -
          +
            {{#> systems/ds4/templates/sheets/actor/components/item-list-header.hbs isEquipable=true hasQuantity=true}} {{!-- armor material type --}}
            {{localize 'DS4.ArmorMaterialTypeAbbr'}}
            @@ -84,9 +84,9 @@ documentType='item' type='weapon'}} documentType='item' type='armor'}} {{!-- SHIELD --}} -

            {{localize 'DS4.ItemTypeShieldPlural'}}

            +

            {{localize 'DS4.ItemTypeShieldPlural'}}

            {{#unless (isEmpty itemsByType.shield)}} -
              +
                {{#> systems/ds4/templates/sheets/actor/components/item-list-header.hbs isEquipable=true hasQuantity=true}} {{!-- armor value --}}
                @@ -106,9 +106,9 @@ documentType='item' type='armor'}} documentType='item' type='shield'}} {{!-- EQUIPMENT --}} -

                {{localize 'DS4.ItemTypeEquipmentPlural'}}

                +

                {{localize 'DS4.ItemTypeEquipmentPlural'}}

                {{#unless (isEmpty itemsByType.equipment)}} -
                  +
                    {{#> systems/ds4/templates/sheets/actor/components/item-list-header.hbs isEquipable=true hasQuantity=true}} {{!-- storage location --}}
                    {{localize 'DS4.StorageLocation'}}
                    @@ -117,7 +117,7 @@ documentType='item' type='shield'}} {{#> systems/ds4/templates/sheets/actor/components/item-list-entry.hbs itemData=itemData isEquipable=true hasQuantity=true}} {{!-- storage location --}} - {{/systems/ds4/templates/sheets/actor/components/item-list-entry.hbs}} {{/each}} @@ -127,9 +127,9 @@ documentType='item' type='shield'}} documentType='item' type='equipment'}} {{!-- LOOT --}} -

                    {{localize 'DS4.ItemTypeLootPlural'}}

                    +

                    {{localize 'DS4.ItemTypeLootPlural'}}

                    {{#unless (isEmpty itemsByType.loot)}} -
                      +
                        {{#> systems/ds4/templates/sheets/actor/components/item-list-header.hbs hasQuantity=true}} {{!-- storage location --}}
                        {{localize 'DS4.StorageLocation'}}
                        @@ -137,7 +137,7 @@ documentType='item' type='equipment'}} {{#each itemsByType.loot as |itemData id|}} {{#> systems/ds4/templates/sheets/actor/components/item-list-entry.hbs itemData=itemData hasQuantity=true}} {{!-- storage location --}} - {{/systems/ds4/templates/sheets/actor/components/item-list-entry.hbs}} {{/each}} diff --git a/src/templates/sheets/actor/tabs/character-abilities.hbs b/src/templates/sheets/actor/tabs/character-abilities.hbs index 699bc704..0fdb1dc2 100644 --- a/src/templates/sheets/actor/tabs/character-abilities.hbs +++ b/src/templates/sheets/actor/tabs/character-abilities.hbs @@ -7,9 +7,9 @@ SPDX-License-Identifier: MIT
                        {{!-- TALENT --}} -

                        {{localize 'DS4.ItemTypeTalentPlural'}}

                        +

                        {{localize 'DS4.ItemTypeTalentPlural'}}

                        {{#unless (isEmpty itemsByType.talent)}} -
                          +
                            {{#> systems/ds4/templates/sheets/actor/components/item-list-header.hbs}} {{!-- rank --}}
                            {{localize 'DS4.TalentRank'}}
                            @@ -26,9 +26,9 @@ SPDX-License-Identifier: MIT documentType='item' type='talent'}} {{!-- RACIAL ABILITY --}} -

                            {{localize 'DS4.ItemTypeRacialAbilityPlural'}}

                            +

                            {{localize 'DS4.ItemTypeRacialAbilityPlural'}}

                            {{#unless (isEmpty itemsByType.racialAbility)}} -
                              +
                                {{> systems/ds4/templates/sheets/actor/components/item-list-header.hbs}} {{#each itemsByType.racialAbility as |itemData id|}} {{> systems/ds4/templates/sheets/actor/components/item-list-entry.hbs itemData=itemData}} @@ -39,9 +39,9 @@ SPDX-License-Identifier: MIT documentType='item' type='racialAbility'}} {{!-- LANGUAGE --}} -

                                {{localize 'DS4.ItemTypeLanguagePlural'}}

                                +

                                {{localize 'DS4.ItemTypeLanguagePlural'}}

                                {{#unless (isEmpty itemsByType.language)}} -
                                  +
                                    {{> systems/ds4/templates/sheets/actor/components/item-list-header.hbs}} {{#each itemsByType.language as |itemData id|}} {{> systems/ds4/templates/sheets/actor/components/item-list-entry.hbs itemData=itemData}} @@ -52,9 +52,9 @@ SPDX-License-Identifier: MIT documentType='item' type='language'}} {{!-- ALPHABET --}} -

                                    {{localize 'DS4.ItemTypeAlphabetPlural'}}

                                    +

                                    {{localize 'DS4.ItemTypeAlphabetPlural'}}

                                    {{#unless (isEmpty itemsByType.alphabet)}} -
                                      +
                                        {{> systems/ds4/templates/sheets/actor/components/item-list-header.hbs}} {{#each itemsByType.alphabet as |itemData id|}} {{> systems/ds4/templates/sheets/actor/components/item-list-entry.hbs itemData=itemData}} diff --git a/src/templates/sheets/actor/tabs/creature-abilities.hbs b/src/templates/sheets/actor/tabs/creature-abilities.hbs index ef9c81bc..ab62882d 100644 --- a/src/templates/sheets/actor/tabs/creature-abilities.hbs +++ b/src/templates/sheets/actor/tabs/creature-abilities.hbs @@ -7,7 +7,7 @@ SPDX-License-Identifier: MIT
                                        {{#unless (isEmpty itemsByType.specialCreatureAbility)}} -
                                          +
                                            {{> systems/ds4/templates/sheets/actor/components/item-list-header.hbs}} {{#each itemsByType.specialCreatureAbility as |itemData id|}} {{> systems/ds4/templates/sheets/actor/components/item-list-entry.hbs itemData=itemData}} diff --git a/src/templates/sheets/actor/tabs/effects.hbs b/src/templates/sheets/actor/tabs/effects.hbs index 8b2320eb..67ed0a36 100644 --- a/src/templates/sheets/actor/tabs/effects.hbs +++ b/src/templates/sheets/actor/tabs/effects.hbs @@ -7,7 +7,7 @@ SPDX-License-Identifier: MIT
                                            {{#unless (isEmpty data.effects)}} -
                                              +
                                                {{> systems/ds4/templates/sheets/actor/components/effect-list-header.hbs}} {{#each enrichedEffects as |effectData id| }} {{> systems/ds4/templates/sheets/actor/components/effect-list-entry.hbs effectData=effectData}} diff --git a/src/templates/sheets/actor/tabs/spells.hbs b/src/templates/sheets/actor/tabs/spells.hbs index c3b5314f..64e6eac9 100644 --- a/src/templates/sheets/actor/tabs/spells.hbs +++ b/src/templates/sheets/actor/tabs/spells.hbs @@ -51,7 +51,7 @@ titleKey=titleKey}}
                                                {{#unless (isEmpty itemsByType.spell)}} -
                                                  +
                                                    {{#> systems/ds4/templates/sheets/actor/components/item-list-header.hbs isEquipable=true hideDescription=true}} {{!-- spell type --}}
                                                    {{localize 'DS4.SpellTypeAbbr'}}
                                                    @@ -72,11 +72,11 @@ titleKey=titleKey}} {{#> systems/ds4/templates/sheets/actor/components/item-list-entry.hbs itemData=itemData isEquipable=true hideDescription=true}} {{!-- spell type --}} - {{!-- spell bonus --}} - {{!-- max. distance --}}