From 37ed9fe29c9065a4037eedfcf0386f740da11a9e Mon Sep 17 00:00:00 2001 From: Zakkon Date: Mon, 29 Sep 2025 14:09:01 +0200 Subject: [PATCH] Add eyes, height, weight, hair, skin and personality fields to character sheet Biography tab --- lang/en.json | 6 ++ .../applications/sheets/actors/character.mjs | 1 + module/data/actor/character.mjs | 6 ++ .../sheets/actors/character/biography.less | 19 +++++ system.json | 6 +- .../sheets/actors/character/biography.hbs | 69 +++++++++++++------ 6 files changed, 84 insertions(+), 23 deletions(-) diff --git a/lang/en.json b/lang/en.json index 37e6cfff..23663014 100755 --- a/lang/en.json +++ b/lang/en.json @@ -172,7 +172,13 @@ "maxEvasionBonus": "Max Evasion Increase", "maxHPBonus": "Max HP Increase", "pronouns": "Pronouns", + "weight": "Weight", + "height": "Height", + "skin": "Skin", + "hair": "Hair", + "eyes": "Eyes", "story": { + "personalityTitle": "Personality", "backgroundTitle": "Background", "characteristics": "Characteristics", "connectionsTitle": "Connections" diff --git a/module/applications/sheets/actors/character.mjs b/module/applications/sheets/actors/character.mjs index a140a7c9..0fc2fe51 100644 --- a/module/applications/sheets/actors/character.mjs +++ b/module/applications/sheets/actors/character.mjs @@ -236,6 +236,7 @@ export default class CharacterSheet extends DHBaseActorSheet { const { TextEditor } = foundry.applications.ux; const paths = { + personality: 'biography.personality', background: 'biography.background', connections: 'biography.connections' }; diff --git a/module/data/actor/character.mjs b/module/data/actor/character.mjs index ddcc5bf5..aa411aa5 100644 --- a/module/data/actor/character.mjs +++ b/module/data/actor/character.mjs @@ -85,11 +85,17 @@ export default class DhCharacter extends BaseDataActor { }) ), biography: new fields.SchemaField({ + personality: new fields.HTMLField(), background: new fields.HTMLField(), connections: new fields.HTMLField(), characteristics: new fields.SchemaField({ pronouns: new fields.StringField({}), age: new fields.StringField({}), + eyes: new fields.StringField({}), + height: new fields.StringField({}), + weight: new fields.StringField({}), + hair: new fields.StringField({}), + skin: new fields.StringField({}), faith: new fields.StringField({}) }) }), diff --git a/styles/less/sheets/actors/character/biography.less b/styles/less/sheets/actors/character/biography.less index e07d7080..93af0a43 100644 --- a/styles/less/sheets/actors/character/biography.less +++ b/styles/less/sheets/actors/character/biography.less @@ -15,6 +15,25 @@ scrollbar-width: thin; scrollbar-color: light-dark(@dark-blue, @golden) transparent; + + .top { + display: flex; + padding-left: 0.25rem; + } + .characteristics { + width: 520px; + display: grid; + grid-template-columns: 180px 160px 140px; + gap: 1rem; + } + .unlist { + list-style: none; + padding: 0; + margin: 0; + li { + margin: 0; + } + } } } } diff --git a/system.json b/system.json index 8e5a7610..62ebe618 100644 --- a/system.json +++ b/system.json @@ -212,7 +212,11 @@ "documentTypes": { "Actor": { "character": { - "htmlFields": ["biography.background", "biography.connections"] + "htmlFields": [ + "biography.personality", + "biography.background", + "biography.connections" + ] }, "companion": {}, "adversary": { diff --git a/templates/sheets/actors/character/biography.hbs b/templates/sheets/actors/character/biography.hbs index 6913f279..51111186 100644 --- a/templates/sheets/actors/character/biography.hbs +++ b/templates/sheets/actors/character/biography.hbs @@ -4,33 +4,58 @@ data-group='{{tabs.biography.group}}' > -
-
- {{localize 'DAGGERHEART.ACTORS.Character.story.characteristics'}} - -
+ +
+
+
    +
  • {{localize 'DAGGERHEART.ACTORS.Character.pronouns'}} {{formInput systemFields.biography.fields.characteristics.fields.pronouns value=source.system.biography.characteristics.pronouns enriched=source.system.biography.characteristics.pronouns localize=true toggled=true}} -
- -
+ +
  • {{localize 'DAGGERHEART.ACTORS.Character.age'}} {{formInput systemFields.biography.fields.characteristics.fields.age value=source.system.biography.characteristics.age enriched=source.system.biography.characteristics.age localize=true toggled=true}} -
  • - -
    + +
  • + {{localize 'DAGGERHEART.ACTORS.Character.eyes'}} + {{formInput systemFields.biography.fields.characteristics.fields.eyes value=source.system.biography.characteristics.eyes enriched=source.system.biography.characteristics.eyes localize=true toggled=true}} +
  • +
  • + {{localize 'DAGGERHEART.ACTORS.Character.height'}} + {{formInput systemFields.biography.fields.characteristics.fields.height value=source.system.biography.characteristics.height enriched=source.system.biography.characteristics.height localize=true toggled=true}} +
  • +
  • + {{localize 'DAGGERHEART.ACTORS.Character.weight'}} + {{formInput systemFields.biography.fields.characteristics.fields.weight value=source.system.biography.characteristics.weight enriched=source.system.biography.characteristics.weight localize=true toggled=true}} +
  • +
  • + {{localize 'DAGGERHEART.ACTORS.Character.hair'}} + {{formInput systemFields.biography.fields.characteristics.fields.hair value=source.system.biography.characteristics.hair enriched=source.system.biography.characteristics.hair localize=true toggled=true}} +
  • +
  • + {{localize 'DAGGERHEART.ACTORS.Character.skin'}} + {{formInput systemFields.biography.fields.characteristics.fields.skin value=source.system.biography.characteristics.skin enriched=source.system.biography.characteristics.skin localize=true toggled=true}} +
  • +
  • {{localize 'DAGGERHEART.ACTORS.Character.faith'}} {{formInput systemFields.biography.fields.characteristics.fields.faith value=source.system.biography.characteristics.faith enriched=source.system.biography.characteristics.faith localize=true toggled=true}} -
  • + + +
    -
    -
    - {{localize 'DAGGERHEART.ACTORS.Character.story.backgroundTitle'}} - {{formInput background.field value=background.value enriched=background.enriched toggled=true}} -
    -
    - {{localize 'DAGGERHEART.ACTORS.Character.story.connectionsTitle'}} - {{formInput connections.field value=connections.value enriched=connections.enriched toggled=true}} -
    -
    +
    + {{localize 'DAGGERHEART.ACTORS.Character.story.personalityTitle'}} + {{formInput personality.field value=personality.value enriched=personality.enriched toggled=true}} +
    +
    + {{localize 'DAGGERHEART.ACTORS.Character.story.backgroundTitle'}} + {{formInput background.field value=background.value enriched=background.enriched toggled=true}} +
    +
    + {{localize 'DAGGERHEART.ACTORS.Character.story.connectionsTitle'}} + {{formInput connections.field value=connections.value enriched=connections.enriched toggled=true}} +
    + + + \ No newline at end of file