From b744e53f9473e66cdfd53db6ebd715f37a2a7717 Mon Sep 17 00:00:00 2001 From: Johannes Loher Date: Sat, 10 Jul 2021 21:02:48 +0200 Subject: [PATCH 1/2] Combine biography and profile tabs --- src/lang/de.json | 2 +- src/lang/en.json | 2 +- src/module/actor/sheets/actor-sheet.ts | 2 +- src/module/handlebars/handlebars-partials.ts | 4 ++- src/scss/components/_description.scss | 6 ++++ src/scss/components/_forms.scss | 1 + src/scss/components/_profile.scss | 28 ++++++++++++++++++ src/scss/ds4.scss | 2 ++ src/scss/tabs/_biography.scss | 11 +++++++ .../sheets/actor/character-sheet.hbs | 14 ++++----- .../sheets/actor/components/biography.hbs | 10 +++++++ .../sheets/actor/components/profile.hbs | 29 +++++++++++++++++++ .../{talents-abilities.hbs => abilities.hbs} | 2 +- src/templates/sheets/actor/tabs/biography.hbs | 11 +++++-- src/templates/sheets/actor/tabs/profile.hbs | 29 ------------------- 15 files changed, 108 insertions(+), 45 deletions(-) create mode 100644 src/scss/components/_profile.scss create mode 100644 src/scss/tabs/_biography.scss create mode 100644 src/templates/sheets/actor/components/biography.hbs create mode 100644 src/templates/sheets/actor/components/profile.hbs rename src/templates/sheets/actor/tabs/{talents-abilities.hbs => abilities.hbs} (97%) delete mode 100644 src/templates/sheets/actor/tabs/profile.hbs diff --git a/src/lang/de.json b/src/lang/de.json index 6740a40d..74b2e99c 100644 --- a/src/lang/de.json +++ b/src/lang/de.json @@ -15,7 +15,7 @@ "DS4.HeadingEffects": "Effekte", "DS4.HeadingInventory": "Inventar", "DS4.HeadingProfile": "Profil", - "DS4.HeadingTalentsAbilities": "Talente & Fähigkeiten", + "DS4.HeadingAbilities": "Fähigkeiten", "DS4.HeadingSpells": "Zaubersprüche", "DS4.HeadingDescription": "Beschreibung", "DS4.HeadingSpecialCreatureAbilities": "Besondere Fähigkeiten", diff --git a/src/lang/en.json b/src/lang/en.json index b3ebd5f7..22a4ac0c 100644 --- a/src/lang/en.json +++ b/src/lang/en.json @@ -15,7 +15,7 @@ "DS4.HeadingEffects": "Effects", "DS4.HeadingInventory": "Inventory", "DS4.HeadingProfile": "Profile", - "DS4.HeadingTalentsAbilities": "Talents & Abilities", + "DS4.HeadingAbilities": "Abilities", "DS4.HeadingSpells": "Spells", "DS4.HeadingDescription": "Description", "DS4.HeadingSpecialCreatureAbilities": "Special Abilities", diff --git a/src/module/actor/sheets/actor-sheet.ts b/src/module/actor/sheets/actor-sheet.ts index 012d621d..c254ee97 100644 --- a/src/module/actor/sheets/actor-sheet.ts +++ b/src/module/actor/sheets/actor-sheet.ts @@ -26,7 +26,7 @@ export class DS4ActorSheet extends ActorSheet { const templatePaths = [ + "systems/ds4/templates/sheets/actor/components/biography.hbs", "systems/ds4/templates/sheets/actor/components/character-progression.hbs", "systems/ds4/templates/sheets/actor/components/check.hbs", "systems/ds4/templates/sheets/actor/components/checks.hbs", @@ -19,8 +20,10 @@ export default async function registerHandlebarsPartials(): Promise { "systems/ds4/templates/sheets/actor/components/items-overview.hbs", "systems/ds4/templates/sheets/actor/components/overview-add-button.hbs", "systems/ds4/templates/sheets/actor/components/overview-control-buttons.hbs", + "systems/ds4/templates/sheets/actor/components/profile.hbs", "systems/ds4/templates/sheets/actor/components/rollable-image.hbs", "systems/ds4/templates/sheets/actor/components/talent-rank-equation.hbs", + "systems/ds4/templates/sheets/actor/tabs/abilities.hbs", "systems/ds4/templates/sheets/actor/tabs/biography.hbs", "systems/ds4/templates/sheets/actor/tabs/character-inventory.hbs", "systems/ds4/templates/sheets/actor/tabs/creature-inventory.hbs", @@ -28,7 +31,6 @@ export default async function registerHandlebarsPartials(): Promise { "systems/ds4/templates/sheets/actor/tabs/profile.hbs", "systems/ds4/templates/sheets/actor/tabs/special-creature-abilities.hbs", "systems/ds4/templates/sheets/actor/tabs/spells.hbs", - "systems/ds4/templates/sheets/actor/tabs/talents-abilities.hbs", "systems/ds4/templates/sheets/actor/tabs/values.hbs", "systems/ds4/templates/sheets/item/components/body.hbs", "systems/ds4/templates/sheets/item/components/sheet-header.hbs", diff --git a/src/scss/components/_description.scss b/src/scss/components/_description.scss index b59f5ec8..78a2c4bc 100644 --- a/src/scss/components/_description.scss +++ b/src/scss/components/_description.scss @@ -75,4 +75,10 @@ .tox-edit-area { padding: 0 8px; } + .tox-toolbar-overlord { + background-color: transparent; + .tox-toolbar__primary { + background: transparent; + } + } } diff --git a/src/scss/components/_forms.scss b/src/scss/components/_forms.scss index 4062f8eb..c4e437ff 100644 --- a/src/scss/components/_forms.scss +++ b/src/scss/components/_forms.scss @@ -25,6 +25,7 @@ header.sheet-header { flex: 0 0 100px; height: 100px; margin: variables.$margin-sm 10px variables.$margin-sm 0; + border: none; } .header-fields { diff --git a/src/scss/components/_profile.scss b/src/scss/components/_profile.scss new file mode 100644 index 00000000..df2b065c --- /dev/null +++ b/src/scss/components/_profile.scss @@ -0,0 +1,28 @@ +/* + * SPDX-FileCopyrightText: 2021 Johannes Loher + * + * SPDX-License-Identifier: MIT + */ + +.ds4-profile { + display: flex; + flex-direction: column; + gap: 0.5em; + + &__entry { + display: flex; + flex-direction: column; + align-items: center; + } + + &__entry-input { + &--multiline { + resize: none; + } + } + + &__entry-label { + font-size: 0.8em; + font-weight: bold; + } +} diff --git a/src/scss/ds4.scss b/src/scss/ds4.scss index 9cdb7e64..7e33edde 100644 --- a/src/scss/ds4.scss +++ b/src/scss/ds4.scss @@ -34,7 +34,9 @@ @include meta.load-css("components/description"); @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/tabs"); @include meta.load-css("components/talent_rank_equation"); + @include meta.load-css("tabs/biography"); } diff --git a/src/scss/tabs/_biography.scss b/src/scss/tabs/_biography.scss new file mode 100644 index 00000000..0cda88fa --- /dev/null +++ b/src/scss/tabs/_biography.scss @@ -0,0 +1,11 @@ +/* + * SPDX-FileCopyrightText: 2021 Johannes Loher + * + * SPDX-License-Identifier: MIT + */ + +.ds4-biography-tab-content { + display: grid; + grid-template-columns: 1fr 3fr; + column-gap: 1em; +} diff --git a/src/templates/sheets/actor/character-sheet.hbs b/src/templates/sheets/actor/character-sheet.hbs index b5d23ca1..8e5eb279 100644 --- a/src/templates/sheets/actor/character-sheet.hbs +++ b/src/templates/sheets/actor/character-sheet.hbs @@ -9,8 +9,8 @@ SPDX-License-Identifier: MIT
{{!-- Sheet Header --}}
- Actor Icon + Actor Icon

@@ -81,8 +81,7 @@ SPDX-License-Identifier: MIT {{localize 'DS4.HeadingValues'}} {{localize 'DS4.HeadingInventory'}} {{localize 'DS4.HeadingSpells'}} - {{localize 'DS4.HeadingTalentsAbilities'}} - {{localize "DS4.HeadingProfile"}} + {{localize 'DS4.HeadingAbilities'}} {{localize 'DS4.HeadingBiography'}} @@ -99,11 +98,8 @@ SPDX-License-Identifier: MIT {{!-- Spells Tab --}} {{> systems/ds4/templates/sheets/actor/tabs/spells.hbs}} -{{!-- Talents Tab --}} -{{> systems/ds4/templates/sheets/actor/tabs/talents-abilities.hbs}} - -{{! Profile Tab --}} -{{> systems/ds4/templates/sheets/actor/tabs/profile.hbs}} +{{!-- Abilities Tab --}} +{{> systems/ds4/templates/sheets/actor/tabs/abilities.hbs}} {{!-- Biography Tab --}} {{> systems/ds4/templates/sheets/actor/tabs/biography.hbs}} diff --git a/src/templates/sheets/actor/components/biography.hbs b/src/templates/sheets/actor/components/biography.hbs new file mode 100644 index 00000000..12e00c03 --- /dev/null +++ b/src/templates/sheets/actor/components/biography.hbs @@ -0,0 +1,10 @@ +{{!-- +SPDX-FileCopyrightText: 2021 Johannes Loher + +SPDX-License-Identifier: MIT +--}} + +
+ {{editor content=data.data.profile.biography target="data.profile.biography" button=true owner=owner + editable=editable}} +
diff --git a/src/templates/sheets/actor/components/profile.hbs b/src/templates/sheets/actor/components/profile.hbs new file mode 100644 index 00000000..790412ef --- /dev/null +++ b/src/templates/sheets/actor/components/profile.hbs @@ -0,0 +1,29 @@ +{{!-- +SPDX-FileCopyrightText: 2021 Johannes Loher +SPDX-FileCopyrightText: 2021 Gesina Schwalbe + +SPDX-License-Identifier: MIT +--}} + +
+ {{#each data.data.profile as |profile-data-value profile-data-key|}} + {{#if (and (ne profile-data-key 'biography') (ne profile-data-key 'specialCharacteristics'))}} +
+ + +
+ {{/if}} + {{/each}} +
+ + +
+
diff --git a/src/templates/sheets/actor/tabs/talents-abilities.hbs b/src/templates/sheets/actor/tabs/abilities.hbs similarity index 97% rename from src/templates/sheets/actor/tabs/talents-abilities.hbs rename to src/templates/sheets/actor/tabs/abilities.hbs index a1ad4ba9..99217df6 100644 --- a/src/templates/sheets/actor/tabs/talents-abilities.hbs +++ b/src/templates/sheets/actor/tabs/abilities.hbs @@ -5,7 +5,7 @@ SPDX-FileCopyrightText: 2021 Gesina Schwalbe SPDX-License-Identifier: MIT --}} -
+
{{!-- TALENT --}}

{{localize 'DS4.ItemTypeTalentPlural'}}

{{#unless (isEmpty itemsByType.talent)}} diff --git a/src/templates/sheets/actor/tabs/biography.hbs b/src/templates/sheets/actor/tabs/biography.hbs index 42e2612e..1cd6e43c 100644 --- a/src/templates/sheets/actor/tabs/biography.hbs +++ b/src/templates/sheets/actor/tabs/biography.hbs @@ -5,6 +5,13 @@ SPDX-License-Identifier: MIT --}}
- {{editor content=data.data.profile.biography target="data.profile.biography" button=true owner=owner - editable=editable}} +
+ + + {{!-- remove indentation to avoid annoying Handlebars auto-indent --}} +{{> systems/ds4/templates/sheets/actor/components/profile.hbs}} +{{> systems/ds4/templates/sheets/actor/components/biography.hbs}} + + +
diff --git a/src/templates/sheets/actor/tabs/profile.hbs b/src/templates/sheets/actor/tabs/profile.hbs deleted file mode 100644 index 4cabb45a..00000000 --- a/src/templates/sheets/actor/tabs/profile.hbs +++ /dev/null @@ -1,29 +0,0 @@ -{{!-- -SPDX-FileCopyrightText: 2021 Johannes Loher -SPDX-FileCopyrightText: 2021 Gesina Schwalbe - -SPDX-License-Identifier: MIT ---}} - -
-
- {{#each data.data.profile as |profile-data-value profile-data-key|}} - {{#if (and (ne profile-data-key 'biography') (ne profile-data-key 'specialCharacteristics'))}} -
- - -
- {{/if}} - {{/each}} -
- - -
-
-
From 7f627df4161d5b3daeac2efb483e0ab8985ba79a Mon Sep 17 00:00:00 2001 From: Johannes Loher Date: Sun, 11 Jul 2021 01:02:38 +0200 Subject: [PATCH 2/2] Slightly improve basic properties --- src/scss/components/_basic_property.scss | 1 + src/scss/global/_fonts.scss | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/src/scss/components/_basic_property.scss b/src/scss/components/_basic_property.scss index eddda73d..0ae6550c 100644 --- a/src/scss/components/_basic_property.scss +++ b/src/scss/components/_basic_property.scss @@ -19,6 +19,7 @@ padding-right: 1px; & > label { + font-size: 0.9em; font-weight: bold; } diff --git a/src/scss/global/_fonts.scss b/src/scss/global/_fonts.scss index 4b4001ef..c837506c 100644 --- a/src/scss/global/_fonts.scss +++ b/src/scss/global/_fonts.scss @@ -5,6 +5,7 @@ */ @font-face { + font-display: swap; font-family: "Lora"; font-style: normal; font-weight: normal; @@ -12,6 +13,7 @@ } @font-face { + font-display: swap; font-family: "Lora"; font-style: normal; font-weight: bold; @@ -19,6 +21,7 @@ } @font-face { + font-display: swap; font-family: "Lora"; font-style: italic; font-weight: normal; @@ -26,6 +29,7 @@ } @font-face { + font-display: swap; font-family: "Lora"; font-style: italic; font-weight: bold; @@ -33,6 +37,7 @@ } @font-face { + font-display: swap; font-family: "Wood Stamp"; font-style: normal; font-weight: normal;