From 959bfcc3e43508a9f96e26d2fb72b19c8fc428af Mon Sep 17 00:00:00 2001 From: Johannes Loher Date: Mon, 12 Jul 2021 00:12:59 +0200 Subject: [PATCH] Cleanup up creature sheet --- src/lang/de.json | 2 + src/lang/en.json | 2 + src/module/handlebars/handlebars-partials.ts | 5 +- ...aracter_header.scss => _actor_header.scss} | 2 +- ...ogression.scss => _actor_progression.scss} | 2 +- ...properties.scss => _actor_properties.scss} | 8 +- src/scss/components/_character_values.scss | 11 --- src/scss/ds4.scss | 9 +-- .../sheets/actor/character-sheet.hbs | 6 +- .../sheets/actor/components/actor-header.hbs | 29 +++++++ .../actor/components/actor-progression.hbs | 48 ++++++++++++ .../actor/components/character-header.hbs | 25 ------ .../components/character-progression.hbs | 48 ------------ .../actor/components/character-properties.hbs | 76 ++++++++++--------- .../actor/components/creature-properties.hbs | 52 +++++++++++++ src/templates/sheets/actor/creature-sheet.hbs | 57 ++------------ 16 files changed, 198 insertions(+), 184 deletions(-) rename src/scss/components/{_character_header.scss => _actor_header.scss} (97%) rename src/scss/components/{_character_progression.scss => _actor_progression.scss} (97%) rename src/scss/components/{_character_properties.scss => _actor_properties.scss} (77%) delete mode 100644 src/scss/components/_character_values.scss create mode 100644 src/templates/sheets/actor/components/actor-header.hbs create mode 100644 src/templates/sheets/actor/components/actor-progression.hbs delete mode 100644 src/templates/sheets/actor/components/character-header.hbs delete mode 100644 src/templates/sheets/actor/components/character-progression.hbs create mode 100644 src/templates/sheets/actor/components/creature-properties.hbs diff --git a/src/lang/de.json b/src/lang/de.json index 74b2e99..8b2b80c 100644 --- a/src/lang/de.json +++ b/src/lang/de.json @@ -121,6 +121,8 @@ "DS4.SpellMinimumLevelsSorcerer": "Zugangsstufe für Schwarzmagier", "DS4.SpellMinimumLevelsSorcererAbbr": "Zugangsstufe Sch", "DS4.SpellPrice": "Preis (Gold)", + "DS4.ActorName": "Name", + "DS4.ActorImageAltText": "Bild des Aktors", "DS4.ActorTypeCharacter": "Charakter", "DS4.ActorTypeCreature": "Kreatur", "DS4.Attribute": "Attribut", diff --git a/src/lang/en.json b/src/lang/en.json index 22a4ac0..91ddc37 100644 --- a/src/lang/en.json +++ b/src/lang/en.json @@ -121,6 +121,8 @@ "DS4.SpellMinimumLevelsSorcerer": "Minimum level for Sorcerers", "DS4.SpellMinimumLevelsSorcererAbbr": "Min lvl SRC", "DS4.SpellPrice": "Price (Gold)", + "DS4.ActorName": "Name", + "DS4.ActorImageAltText": "Image of the Actor", "DS4.ActorTypeCharacter": "Character", "DS4.ActorTypeCreature": "Creature", "DS4.Attribute": "Attribute", diff --git a/src/module/handlebars/handlebars-partials.ts b/src/module/handlebars/handlebars-partials.ts index a5f7466..60067ec 100644 --- a/src/module/handlebars/handlebars-partials.ts +++ b/src/module/handlebars/handlebars-partials.ts @@ -6,16 +6,17 @@ export default async function registerHandlebarsPartials(): Promise { const templatePaths = [ + "systems/ds4/templates/sheets/actor/components/actor-header.hbs", + "systems/ds4/templates/sheets/actor/components/actor-progression.hbs", "systems/ds4/templates/sheets/actor/components/biography.hbs", - "systems/ds4/templates/sheets/actor/components/character-progression.hbs", "systems/ds4/templates/sheets/actor/components/character-properties.hbs", - "systems/ds4/templates/sheets/actor/components/character-header.hbs", "systems/ds4/templates/sheets/actor/components/check.hbs", "systems/ds4/templates/sheets/actor/components/checks.hbs", "systems/ds4/templates/sheets/actor/components/combat-value.hbs", "systems/ds4/templates/sheets/actor/components/combat-values.hbs", "systems/ds4/templates/sheets/actor/components/core-value.hbs", "systems/ds4/templates/sheets/actor/components/core-values.hbs", + "systems/ds4/templates/sheets/actor/components/creature-properties.hbs", "systems/ds4/templates/sheets/actor/components/currency.hbs", "systems/ds4/templates/sheets/actor/components/item-list-entry.hbs", "systems/ds4/templates/sheets/actor/components/item-list-header.hbs", diff --git a/src/scss/components/_character_header.scss b/src/scss/components/_actor_header.scss similarity index 97% rename from src/scss/components/_character_header.scss rename to src/scss/components/_actor_header.scss index f69efd2..a9828e1 100644 --- a/src/scss/components/_character_header.scss +++ b/src/scss/components/_actor_header.scss @@ -6,7 +6,7 @@ @use "../utils/typography"; -.ds4-character-header { +.ds4-actor-header { display: flex; flex-grow: 0; flex-shrink: 0; diff --git a/src/scss/components/_character_progression.scss b/src/scss/components/_actor_progression.scss similarity index 97% rename from src/scss/components/_character_progression.scss rename to src/scss/components/_actor_progression.scss index d1d03d8..3d5679f 100644 --- a/src/scss/components/_character_progression.scss +++ b/src/scss/components/_actor_progression.scss @@ -10,7 +10,7 @@ @use "../utils/variables"; @use "../utils/mixins"; -.ds4-character-progression { +.ds4-actor-progression { @include mixins.mark-invalid-or-disabled-input; display: flex; gap: 0.5em; diff --git a/src/scss/components/_character_properties.scss b/src/scss/components/_actor_properties.scss similarity index 77% rename from src/scss/components/_character_properties.scss rename to src/scss/components/_actor_properties.scss index 1962afd..0f73504 100644 --- a/src/scss/components/_character_properties.scss +++ b/src/scss/components/_actor_properties.scss @@ -7,8 +7,9 @@ */ @use "../utils/mixins"; +@use "../utils/variables"; -.ds4-character-properties { +.ds4-actor-properties { @include mixins.mark-invalid-or-disabled-input; display: flex; gap: 0.25em; @@ -23,6 +24,11 @@ white-space: nowrap; } + &__property-select { + width: 100%; + height: variables.$default-input-height; + } + &__property-multi-input { display: flex; gap: 0.125em; diff --git a/src/scss/components/_character_values.scss b/src/scss/components/_character_values.scss deleted file mode 100644 index 5dfb464..0000000 --- a/src/scss/components/_character_values.scss +++ /dev/null @@ -1,11 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2021 Johannes Loher - * - * SPDX-License-Identifier: MIT - */ - -header.sheet-header { - .character-values { - flex: 0 0 100%; - } -} diff --git a/src/scss/ds4.scss b/src/scss/ds4.scss index 1185def..a6afe38 100644 --- a/src/scss/ds4.scss +++ b/src/scss/ds4.scss @@ -20,11 +20,11 @@ /* Styles limited to ds4 sheets */ .ds4 { + @include meta.load-css("components/actor_header"); + @include meta.load-css("components/actor_progression"); + @include meta.load-css("components/actor_properties"); @include meta.load-css("components/apps"); @include meta.load-css("components/basic_property"); - @include meta.load-css("components/character_progression"); - @include meta.load-css("components/character_properties"); - @include meta.load-css("components/character_values"); @include meta.load-css("components/check"); @include meta.load-css("components/checks"); @include meta.load-css("components/combat_value"); @@ -34,12 +34,11 @@ @include meta.load-css("components/currency"); @include meta.load-css("components/description"); @include meta.load-css("components/forms"); - @include meta.load-css("components/character_header"); @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"); @include meta.load-css("components/sheet_tab_nav"); + @include meta.load-css("components/sheet"); @include meta.load-css("components/talent_rank_equation"); @include meta.load-css("tabs/biography"); } diff --git a/src/templates/sheets/actor/character-sheet.hbs b/src/templates/sheets/actor/character-sheet.hbs index 6fc20bc..99ff588 100644 --- a/src/templates/sheets/actor/character-sheet.hbs +++ b/src/templates/sheets/actor/character-sheet.hbs @@ -7,8 +7,10 @@ SPDX-License-Identifier: MIT --}}
- {{!-- Character Header --}} - {{> systems/ds4/templates/sheets/actor/components/character-header.hbs}} + {{!-- Header --}} + {{#> systems/ds4/templates/sheets/actor/components/actor-header.hbs}} + {{> systems/ds4/templates/sheets/actor/components/character-properties.hbs}} + {{/systems/ds4/templates/sheets/actor/components/actor-header.hbs}} {{!-- Sheet Tab Navigation --}}