Added difficulty display and fixed spacing

This commit is contained in:
WBHarry 2026-05-30 22:32:28 +02:00
parent 2f0badf53a
commit 25f27c8891
6 changed files with 64 additions and 11 deletions

View file

@ -337,7 +337,7 @@
"NPC": {
"FIELDS": {
"difficulty": { "label": "Difficulty" },
"motive": { "label": "Motive" },
"motives": { "label": "Motives" },
"description": { "label": "Description" }
}
},

View file

@ -19,8 +19,8 @@ export default class DhpNPC extends BaseDataActor {
return {
...super.defineSchema(),
difficulty: new fields.NumberField({ nullable: true, initial: null, integer: true }),
description: new fields.StringField(),
motive: new fields.StringField(),
description: new fields.HTMLField(),
motives: new fields.HTMLField(),
notes: new fields.HTMLField()
};
}

View file

@ -35,7 +35,7 @@
.tags {
display: flex;
gap: 10px;
padding-bottom: 16px;
padding-bottom: 8px;
.tag {
display: flex;

View file

@ -12,19 +12,48 @@
}
}
.tags {
display: flex;
gap: 10px;
padding-bottom: 8px;
.tag {
display: flex;
flex-direction: row;
gap: 4px;
justify-content: center;
align-items: center;
padding: 3px 5px;
font-size: var(--font-size-12);
font: @font-body;
background: light-dark(@dark-15, @beige-15);
border: 1px solid light-dark(@dark, @beige);
border-radius: 3px;
}
.label {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
font-size: var(--font-size-12);
}
}
.info-section {
flex: 1;
padding: 0 15px;
padding-top: var(--header-height);
display: flex;
flex-direction: column;
gap: 8px;
.name-row {
display: flex;
gap: 5px;
align-items: center;
justify-content: space-between;
padding: 8px 0;
h1 {
display: flex;
@ -48,6 +77,12 @@
flex-direction: column;
gap: 12px;
padding: 16px 0;
.motives-and-tactics {
p:first-of-type {
margin: 0;
}
}
}
}
}

View file

@ -3,7 +3,15 @@
data-tab='{{tabs.details.id}}'
data-group='{{tabs.details.group}}'
>
{{formField systemFields.description value=document._source.system.description}}
{{formField systemFields.motive value=document._source.system.motive}}
{{formGroup systemFields.difficulty value=document._source.system.difficulty localize=true}}
<fieldset>
<legend>{{localize "DAGGERHEART.ACTORS.NPC.FIELDS.description.label"}}</legend>
{{formInput systemFields.description value=document._source.system.description}}
</fieldset>
<fieldset>
<legend>{{localize "DAGGERHEART.ACTORS.NPC.FIELDS.motives.label"}}</legend>
{{formInput systemFields.motives value=document._source.system.motives}}
</fieldset>
{{formGroup systemFields.difficulty value=document._source.system.difficulty localize=true}}
</section>

View file

@ -16,15 +16,25 @@
>{{source.name}}</h1>
</div>
{{#if source.system.difficulty}}
<div class="tags">
<div class="tag">
<span>{{localize "DAGGERHEART.GENERAL.difficulty"}}</span>
<span>{{source.system.difficulty}}</span>
</div>
</div>
{{/if}}
<line-div></line-div>
<div class="npc-info">
<span class="description">
<i>{{{description}}}</i>
</span>
<span class="motives-and-tatics">
<b>{{localize 'DAGGERHEART.ACTORS.NPC.FIELDS.motive.label'}}: </b>{{{source.system.motive}}}
</span>
<div class="motives-and-tactics">
<b>{{localize 'DAGGERHEART.ACTORS.NPC.FIELDS.motives.label'}}</b>
{{{source.system.motives}}}
</div>
</div>
</div>
</header>