Add eyes, height, weight, hair, skin and personality fields to character sheet Biography tab

This commit is contained in:
Zakkon 2025-09-29 14:09:01 +02:00
parent fd92540792
commit 37ed9fe29c
6 changed files with 84 additions and 23 deletions

View file

@ -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"

View file

@ -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'
};

View file

@ -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({})
})
}),

View file

@ -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;
}
}
}
}
}

View file

@ -212,7 +212,11 @@
"documentTypes": {
"Actor": {
"character": {
"htmlFields": ["biography.background", "biography.connections"]
"htmlFields": [
"biography.personality",
"biography.background",
"biography.connections"
]
},
"companion": {},
"adversary": {

View file

@ -4,33 +4,58 @@
data-group='{{tabs.biography.group}}'
>
<div class="items-section">
<fieldset class="flex">
<legend>{{localize 'DAGGERHEART.ACTORS.Character.story.characteristics'}}</legend>
<div class="input">
<div class="items-section">
<div class="top">
<ul class="unlist characteristics">
<li>
<span>{{localize 'DAGGERHEART.ACTORS.Character.pronouns'}}</span>
{{formInput systemFields.biography.fields.characteristics.fields.pronouns value=source.system.biography.characteristics.pronouns enriched=source.system.biography.characteristics.pronouns localize=true toggled=true}}
</div>
<div class="input">
</li>
<li>
<span>{{localize 'DAGGERHEART.ACTORS.Character.age'}}</span>
{{formInput systemFields.biography.fields.characteristics.fields.age value=source.system.biography.characteristics.age enriched=source.system.biography.characteristics.age localize=true toggled=true}}
</div>
<div class="input">
</li>
<li>
<span>{{localize 'DAGGERHEART.ACTORS.Character.eyes'}}</span>
{{formInput systemFields.biography.fields.characteristics.fields.eyes value=source.system.biography.characteristics.eyes enriched=source.system.biography.characteristics.eyes localize=true toggled=true}}
</li>
<li>
<span>{{localize 'DAGGERHEART.ACTORS.Character.height'}}</span>
{{formInput systemFields.biography.fields.characteristics.fields.height value=source.system.biography.characteristics.height enriched=source.system.biography.characteristics.height localize=true toggled=true}}
</li>
<li>
<span>{{localize 'DAGGERHEART.ACTORS.Character.weight'}}</span>
{{formInput systemFields.biography.fields.characteristics.fields.weight value=source.system.biography.characteristics.weight enriched=source.system.biography.characteristics.weight localize=true toggled=true}}
</li>
<li>
<span>{{localize 'DAGGERHEART.ACTORS.Character.hair'}}</span>
{{formInput systemFields.biography.fields.characteristics.fields.hair value=source.system.biography.characteristics.hair enriched=source.system.biography.characteristics.hair localize=true toggled=true}}
</li>
<li>
<span>{{localize 'DAGGERHEART.ACTORS.Character.skin'}}</span>
{{formInput systemFields.biography.fields.characteristics.fields.skin value=source.system.biography.characteristics.skin enriched=source.system.biography.characteristics.skin localize=true toggled=true}}
</li>
<li>
<span>{{localize 'DAGGERHEART.ACTORS.Character.faith'}}</span>
{{formInput systemFields.biography.fields.characteristics.fields.faith value=source.system.biography.characteristics.faith enriched=source.system.biography.characteristics.faith localize=true toggled=true}}
</div>
</li>
</ul>
</div>
</fieldset>
<fieldset>
<legend>{{localize 'DAGGERHEART.ACTORS.Character.story.backgroundTitle'}}</legend>
{{formInput background.field value=background.value enriched=background.enriched toggled=true}}
</fieldset>
<fieldset>
<legend>{{localize 'DAGGERHEART.ACTORS.Character.story.connectionsTitle'}}</legend>
{{formInput connections.field value=connections.value enriched=connections.enriched toggled=true}}
</fieldset>
</div>
<fieldset>
<legend>{{localize 'DAGGERHEART.ACTORS.Character.story.personalityTitle'}}</legend>
{{formInput personality.field value=personality.value enriched=personality.enriched toggled=true}}
</fieldset>
<fieldset>
<legend>{{localize 'DAGGERHEART.ACTORS.Character.story.backgroundTitle'}}</legend>
{{formInput background.field value=background.value enriched=background.enriched toggled=true}}
</fieldset>
<fieldset>
<legend>{{localize 'DAGGERHEART.ACTORS.Character.story.connectionsTitle'}}</legend>
{{formInput connections.field value=connections.value enriched=connections.enriched toggled=true}}
</fieldset>
</div>
</section>