diff --git a/src/ds4.scss b/src/ds4.scss index 5eae4571..2fedca1f 100644 --- a/src/ds4.scss +++ b/src/ds4.scss @@ -19,4 +19,5 @@ @import "scss/components/description"; @import "scss/components/character_values"; @import "scss/components/attributes_traits"; + @import "scss/components/combat_values"; } diff --git a/src/module/ds4.ts b/src/module/ds4.ts index 99227746..358074b0 100644 --- a/src/module/ds4.ts +++ b/src/module/ds4.ts @@ -38,6 +38,7 @@ async function registerHandlebarsPartials() { "systems/ds4/templates/item/partials/body.hbs", "systems/ds4/templates/actor/partials/items-overview.hbs", "systems/ds4/templates/actor/partials/attributes-traits.hbs", + "systems/ds4/templates/actor/partials/combat-values.hbs", ]; return loadTemplates(templatePaths); } @@ -68,7 +69,7 @@ Hooks.once("setup", function () { ]; // Exclude some from sorting where the default order matters - const noSort = ["attributes", "traits"]; + const noSort = ["attributes", "traits", "combatValues"]; // Localize and sort CONFIG objects for (const o of toLocalize) { diff --git a/src/scss/components/_character_values.scss b/src/scss/components/_character_values.scss index b27e2252..69ccc0ff 100644 --- a/src/scss/components/_character_values.scss +++ b/src/scss/components/_character_values.scss @@ -1,53 +1,5 @@ header.sheet-header { .character-values { flex: 0 0 100%; - .combat-values { - margin-top: $margin-sm; - .combat-value-with-formula { - display: grid; - place-items: center; - $size: 60px; - row-gap: $margin-sm; - .combat-value { - @include centered-content; - height: $size; - width: $size; - flex: 0 0 auto; - background-size: contain; - font-size: 1.5em; - &.hitPoints { - background-image: url("#{$official-assets-path}/DS4-HP.png"); - } - &.defense { - background-image: url("#{$official-assets-path}/DS4-DEF.png"); - } - &.initiative { - background-image: url("#{$official-assets-path}/DS4-INI.png"); - } - &.movement { - background-image: url("#{$official-assets-path}/DS4-MR.png"); - } - &.meleeAttack { - background-image: url("#{$official-assets-path}/DS4-MAT.png"); - } - &.rangedAttack { - background-image: url("#{$official-assets-path}/DS4-RAT.png"); - } - &.spellcasting { - background-image: url("#{$official-assets-path}/DS4-SPC.png"); - } - &.targetedSpellcasting { - background-image: url("#{$official-assets-path}/DS4-TSC.png"); - } - } - - .combat-value-formula { - width: $size; - input { - text-align: center; - } - } - } - } } } diff --git a/src/scss/components/_combat_values.scss b/src/scss/components/_combat_values.scss new file mode 100644 index 00000000..5b7ad3d2 --- /dev/null +++ b/src/scss/components/_combat_values.scss @@ -0,0 +1,48 @@ +.combat-values { + margin-top: $margin-sm; + .combat-value-with-formula { + display: grid; + place-items: center; + $size: 60px; + row-gap: $margin-sm; + .combat-value { + @include centered-content; + height: $size; + width: $size; + flex: 0 0 auto; + background-size: contain; + font-size: 1.5em; + &.hitPoints { + background-image: url("#{$official-assets-path}/DS4-HP.png"); + } + &.defense { + background-image: url("#{$official-assets-path}/DS4-DEF.png"); + } + &.initiative { + background-image: url("#{$official-assets-path}/DS4-INI.png"); + } + &.movement { + background-image: url("#{$official-assets-path}/DS4-MR.png"); + } + &.meleeAttack { + background-image: url("#{$official-assets-path}/DS4-MAT.png"); + } + &.rangedAttack { + background-image: url("#{$official-assets-path}/DS4-RAT.png"); + } + &.spellcasting { + background-image: url("#{$official-assets-path}/DS4-SPC.png"); + } + &.targetedSpellcasting { + background-image: url("#{$official-assets-path}/DS4-TSC.png"); + } + } + + .combat-value-formula { + width: $size; + input { + text-align: center; + } + } + } +} diff --git a/src/templates/actor/actor-sheet.hbs b/src/templates/actor/actor-sheet.hbs index f288880e..475ce2fd 100644 --- a/src/templates/actor/actor-sheet.hbs +++ b/src/templates/actor/actor-sheet.hbs @@ -83,75 +83,8 @@ {{> systems/ds4/templates/actor/partials/attributes-traits.hbs}} + {{> systems/ds4/templates/actor/partials/combat-values.hbs}} -