Improved Character datamodel

This commit is contained in:
WBHarry 2025-06-08 00:52:53 +02:00
parent 746e0f239a
commit 213a07b64c
20 changed files with 175 additions and 381 deletions

View file

@ -12,10 +12,10 @@
</div>
<div class="attribute-image">
{{#if ../editAttributes}}
<select class="attribute-value{{#if (lt attribute.base 0)}} negative{{/if}}{{#if (and (not attribute.base) (not ../abilityScoresFinished))}} unselected{{/if}}" data-attribute="{{key}}">
{{#if (not (eq attribute.base 0))}}<option value="">{{attribute.base}}</option>{{/if}}
<select class="attribute-value{{#if (lt attribute.value 0)}} negative{{/if}}{{#if (and (not attribute.value) (not ../abilityScoresFinished))}} unselected{{/if}}" data-attribute="{{key}}">
{{#if (not (eq attribute.value 0))}}<option value="">{{attribute.value}}</option>{{/if}}
{{#each ../abilityScoreArray as |option|}}
<option value="{{option.value}}"{{#if (eq option.value attribute.base)}} selected="selected"{{/if}}>{{option.name}}</option>
<option value="{{option.value}}">{{option.name}}</option>
{{/each}}
</select>
{{else}}

View file

@ -4,7 +4,7 @@
<div class="defense-row">
<div class="defense-section">
<div class="defense-container">
<div class="defense-value">{{document.system.evasion.value}}</div>
<div class="defense-value">{{document.system.evasion}}</div>
<img src="systems/daggerheart/assets/AttributeShield.svg" />
<div class="defense-banner">{{localize "DAGGERHEART.Sheets.PC.Defense.Evasion"}}</div>
</div>
@ -16,16 +16,18 @@
<img src="systems/daggerheart/assets/AttributeShield.svg" />
<div class="defense-banner">{{localize "DAGGERHEART.Sheets.PC.Defense.Armor"}}</div>
</div>
<div class="armor-marks">
{{#times (subtract 12 document.system.armorMarks.max)}}
<input class="mark disabled-mark" type="checkbox" disabled />
{{/times}}
{{#times document.system.armorMarks.max}}
{{#with (add this 1)}}
<input class="mark" type="checkbox" data-action="toggleMarks" data-value="{{this}}" {{ checked (gte ../../document.system.armor.system.marks.value this) }} />
{{/with}}
{{/times}}
</div>
{{#if document.system.armor.system.marks}}
<div class="armor-marks">
{{#times (subtract 12 document.system.armor.system.marks.max)}}
<input class="mark disabled-mark" type="checkbox" disabled />
{{/times}}
{{#times document.system.armor.system.marks.max}}
{{#with (add this 1)}}
<input class="mark" type="checkbox" data-action="toggleMarks" data-value="{{this}}" {{ checked (gte ../../document.system.armor.system.marks.value this) }} />
{{/with}}
{{/times}}
</div>
{{/if}}
</div>
</div>
</fieldset>

View file

@ -1,12 +1,12 @@
<fieldset class="left-main-container experience-container">
<legend class="legend">{{localize "DAGGERHEART.Sheets.PC.Experience.Title"}}</legend>
{{#each document.system.experiences as |experience index|}}
{{#each document.system.experiences as |experience id|}}
<div class="experience-row">
<input class="experience-description" data-index={{index}} value="{{experience.description}}" type="text" />
<input class="experience-description" data-experience={{id}} value="{{experience.description}}" type="text" />
<div class="experience-value">{{experience.value}}</div>
</div>
{{/each}}
{{#times (subtract 5 document.system.experiences.length)}}
{{#times (subtract 5 (length document.system.experiences))}}
<div class="experience-row">
<input type="text" class="disabled-experience" disabled />
<div class="experience-value empty"></div>

View file

@ -11,39 +11,39 @@
<div class="proficiency-container-visual-element"></div>
</div>
<div class="weapons-burden">
<i class="fa-solid fa-hand weapons-burden-icon left {{#if (or (eq weapons.burden "oneHanded") (eq weapons.burden "twoHanded"))}}active{{/if}}"></i>
<i class="fa-solid fa-hand weapons-burden-icon right {{#if (eq weapons.burden "twoHanded")}}active{{/if}}"></i>
<i class="fa-solid fa-hand weapons-burden-icon left {{#if (or (eq weaponBurden "oneHanded") (eq weaponBurden "twoHanded"))}}active{{/if}}"></i>
<i class="fa-solid fa-hand weapons-burden-icon right {{#if (eq weaponBurden "twoHanded")}}active{{/if}}"></i>
</div>
</legend>
<div class="active-item-container">
<h2 class="weapons-label-row">
{{localize "DAGGERHEART.Sheets.PC.Weapons.PrimaryTitle"}}
{{#if weapons.primary}}
<img class="damage-roll" data-action="attackRoll" data-weapon="{{weapons.primary.uuid}}" src="icons/svg/d12-grey.svg" />
{{#if primaryWeapon}}
<img class="damage-roll" data-action="attackRoll" data-weapon="{{primaryWeapon.uuid}}" src="icons/svg/d12-grey.svg" />
{{/if}}
</h2>
<div class="flexrow">
<input value="{{weapons.primary.name}}" type="text" />
<input value="{{localize weapons.primary.trait}}" type="text" />
<input value="{{localize weapons.primary.range.label}}" type="text" />
<input value="{{weapons.primary.damage.value}} {{#if weapons.primary}}({{localize weapons.primary.damage.type.abbreviation}}){{/if}}" type="text" />
<input value="{{primaryWeapon.name}}" type="text" />
<input value="{{localize primaryWeapon.trait}}" type="text" />
<input value="{{localize primaryWeapon.range.label}}" type="text" />
<input value="{{primaryWeapon.damage.value}} {{#if primaryWeapon}}({{localize primaryWeapon.damage.type.abbreviation}}){{/if}}" type="text" />
</div>
<input value="{{localize weapons.primary.feature.label}} {{#if weapons.primary.feature}}({{localize weapons.primary.feature.description}}){{/if}}" type="text" />
<input value="{{localize primaryWeapon.feature.label}} {{#if primaryWeapon.feature}}({{localize primaryWeapon.feature.description}}){{/if}}" type="text" />
</div>
<div class="active-item-container">
<h2 class="weapons-label-row">
{{localize "DAGGERHEART.Sheets.PC.Weapons.SecondaryTitle"}}
{{#if weapons.secondary}}
<img class="damage-roll" data-action="damageRoll" data-value="{{weapons.secondary.damage.value}}" src="icons/svg/d12-grey.svg" />
{{#if secondaryWeapon}}
<img class="damage-roll" data-action="damageRoll" data-value="{{secondaryWeapon.damage.value}}" src="icons/svg/d12-grey.svg" />
{{/if}}
</h2>
<div class="flexrow">
<input value="{{weapons.secondary.name}}" type="text" />
<input value="{{localize weapons.secondary.trait}}" type="text" />
<input value="{{localize weapons.secondary.range.label}}" type="text" />
<input value="{{weapons.secondary.damage.label}} {{#if weapons.secondary}}({{localize weapons.secondary.damage.type.abbreviation}}){{/if}}" type="text" />
<input value="{{secondaryWeapon.name}}" type="text" />
<input value="{{localize secondaryWeapon.trait}}" type="text" />
<input value="{{localize secondaryWeapon.range.label}}" type="text" />
<input value="{{secondaryWeapon.damage.label}} {{#if secondaryWeapon}}({{localize secondaryWeapon.damage.type.abbreviation}}){{/if}}" type="text" />
</div>
<input value="{{localize weapons.secondary.feature.name}} {{#if weapons.secondary.feature}}({{localize weapons.secondary.feature.description}}){{/if}}" style="text-overflow: ellipsis;" type="text" />
<input value="{{localize secondaryWeapon.feature.name}} {{#if secondaryWeapon.feature}}({{localize secondaryWeapon.feature.description}}){{/if}}" style="text-overflow: ellipsis;" type="text" />
</div>
</fieldset>

View file

@ -87,7 +87,7 @@
</div>
<div class="body-section flex3">
{{> "systems/daggerheart/templates/sheets/parts/attributes.hbs" }}
{{> "systems/daggerheart/templates/sheets/parts/weapons.hbs" weapons=document.system.equippedWeapons proficiency=document.system.proficiency.value }}
{{> "systems/daggerheart/templates/sheets/parts/weapons.hbs" primaryWeapon=document.system.primaryWeapon secondaryWeapon=document.system.secondaryWeapon weaponBurden=document.system.getWeaponBurden proficiency=document.system.proficiency.value }}
{{> "systems/daggerheart/templates/sheets/parts/armor.hbs" armor=document.system.armor }}
</div>
</div>