Refactor/84 data models structure (#131)

* - Move all DataModel item files to a new 'items' subfolder for better organization
- Add _module.mjs file to simplify imports
- Update all import paths
- Rename class for use the new acronym DH

* FIX: remove unnecessary import

* FEAT: BaseDataItem class
add TODO comments for future improvements
FIX: Remove effect field on template
FIX: remove unused DhpEffects file

* FEAT: new FormulaField class
FEAT: add getRollData on BaseDataItem Class
FEAT: weapon
FIX: remove inventoryWeapon field on Weapon Data Model

* FEAT: add class prepareBaseData for domains

* FEAT: new ForeignDocumentUUIDField
FIX: Remove unnecessary fields
FEAT: use ForeignDocumentUUIDField in the Item Class DataModel

* FIX: remove wrong option in String Field

* FIX: remove unused import

* FIX: ADD htmlFields description in manifest

* FIX: minor fixes

* REFACTOR: rename folder `data/items` -> `data/item`
REFACTOR: rename folder `data/messages` -> `data/chat-message`.

* FIX: imports
FIX: items sheet new paths
FIX: ItemDataModelMetadata type jsdoc

* FEAT: formatting code
FIX: fix fields used
FEAT: add jsdoc

* 110 - Class Data Model (#111)

* Added PreCreate/Create/Delete logic for Class/Subclass and set it as foreignUUID fields in PC

* Moved methods into TypedModelData

* Simplified Subclass

* Fixed up data model and a basic placeholder template (#117)

* 118 - adversary data model (#119)

* Fixed datamodel and set up basic template in new style

* Added in a temp attack button, because why not

* Restored HitPoints counting up

* 113 - Character Data Model (#114)

* Improved Character datamodel

* Removed additional unneccessary getters

* Preliminary cleanup in the class sheet

* Cleanup of 'pc' references

* Corrected Duality rolling from Character

* Fix to damage roll

* Added a basic BaseDataActor data model

* Gathered exports

* getRollData recursion fix

* Feature/112 items use action datamodel (#127)

* Create new actions classes

* actions types - attack roll

* fixes before merge

* First PR

* Add daggerheart.css to gitignore

* Update ToDo

* Remove console log

* Fixed chat /dr roll

* Remove jQuery

* Fixed so the different chat themes work again

* Fixed duality roll buttons

* Fix to advantage/disadvantage shortcut

* Extand action to other item types

* Roll fixes

* Fixes to adversary rolls

* resources

* Fixed adversary dice

---------

Co-authored-by: WBHarry <williambjrklund@gmail.com>

* Feature/116-implementation-of-pseudo-documents (#125)

* FEAT: add baseDataModel logic

* FEAT: new PseudoDocumentsField
FIX: BasePseudoDocument 's getEmbeddedDocument

* FEAT: PseudoDocument class

* FEAT: add TypedPseudoDocument
REFACTOR: PreudoDocument
FIX: Typos Bug

* FIX: CONFIG types

* FEAT: basic PseudoDocumentSheet

* FIX: remove schema
ADD: input of example

---------

Co-authored-by: Joaquin Pereyra <joaquinpereyra98@users.noreply.github.com>
Co-authored-by: WBHarry <williambjrklund@gmail.com>

* Levelup Followup (#126)

* Levelup applies bonuses to character

* Added visualisation of domain card levels

* Fixed domaincard level max for selections in a tier

* A trait can now only be level up once within the same tier

---------

Co-authored-by: Joaquin Pereyra <joaquinpereyra98@users.noreply.github.com>
Co-authored-by: joaquinpereyra98 <24190917+joaquinpereyra98@users.noreply.github.com>
Co-authored-by: Dapoulp <74197441+Dapoulp@users.noreply.github.com>
This commit is contained in:
WBHarry 2025-06-13 14:17:13 +02:00 committed by GitHub
parent 90bc2dc488
commit 187ee3e1bd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
153 changed files with 5481 additions and 4829 deletions

View file

@ -7,19 +7,19 @@
{{#each this.attributes as |attribute key|}}
<div class="attribute">
<div class="attribute-banner">
<img class="attribute-roll" data-action="attributeRoll" data-attribute="{{key}}" data-value="{{attribute.value}}" src="icons/svg/d12-grey.svg" />
<img class="attribute-roll" data-action="attributeRoll" data-attribute="{{key}}" data-value="{{attribute.total}}" src="icons/svg/d12-grey.svg" />
<div class="attribute-text">{{key}}</div>
</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.total 0)}} negative{{/if}}{{#if (and (not attribute.total) (not ../abilityScoresFinished))}} unselected{{/if}}" data-attribute="{{key}}">
{{#if (not (eq attribute.total 0))}}<option value="">{{attribute.total}}</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.total}}">{{option.name}}</option>
{{/each}}
</select>
{{else}}
<div class="attribute-text {{#if (lt attribute.value 0)}}negative{{/if}}">{{attribute.value}}</div>
<div class="attribute-text {{#if (lt attribute.total 0)}}negative{{/if}}">{{attribute.total}}</div>
{{/if}}
<img src="systems/daggerheart/assets/AttributeShield.svg" />
<div>

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.total}}</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" />
<div class="experience-value">{{experience.value}}</div>
<input name="{{concat "system.experiences." id ".description"}}" data-experience={{id}} value="{{experience.description}}" type="text" />
<div name="{{concat "system.experiences." id ".value"}}" class="experience-value">{{experience.total}}</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

@ -1,12 +1,12 @@
<fieldset class="left-main-container" style="flex: 1;">
<legend class="legend">
{{#if this.document.system.class}}
{{#if this.document.system.multiclass}}
{{#if this.document.system.class.value}}
{{#if this.document.system.multiclass.value}}
<span class="class-feature-selectable {{#if this.multiclass}}inactive{{/if}}" data-action="selectFeatureSet" data-multiclass="false">{{this.document.system.class.name}}&nbsp;{{localize "DAGGERHEART.General.Features"}}</span>
/&nbsp;
<span class="class-feature-selectable {{#if (not this.multiclass)}}inactive{{/if}}" data-action="selectFeatureSet" data-multiclass="true">{{this.document.system.multiclass.name}}&nbsp;{{localize "DAGGERHEART.General.Features"}}</span>
{{else}}
<span>{{this.document.system.class.name}}&nbsp;{{localize "DAGGERHEART.General.Features"}}</span>
<span>{{this.document.system.class.value.name}}&nbsp;{{localize "DAGGERHEART.General.Features"}}</span>
{{/if}}
{{else}}
<span>{{localize "DAGGERHEART.Sheets.PC.Features.Title"}}</span>

View file

@ -21,7 +21,7 @@
<i class="fa-solid fa-caret-left"></i>
<div class="health-category">{{localize "DAGGERHEART.Sheets.PC.Health.Severe"}}</div>
</div>
<i data-action="makeDeathMove" class="fas fa-skull death-save {{#if (lt resources.hitPoints.value document.system.resources.hitPoints.max)}}disabled{{/if}}" title="{{localize "DAGGERHEART.Sheets.PC.Health.DeathMoveTooltip"}}"></i>
<i data-action="makeDeathMove" class="fas fa-skull death-save {{#if (lt resources.hitPoints.value document.system.resources.hitPoints.maxTotal)}}disabled{{/if}}" title="{{localize "DAGGERHEART.Sheets.PC.Health.DeathMoveTooltip"}}"></i>
</div>
<div class="flexrow" style="flex-wrap: nowrap; align-items: center;">
<div class="flexcol flex0">
@ -30,22 +30,22 @@
</div>
<div class="flexcol">
<div class="flexrow" style="flex-wrap: nowrap;">
{{#times document.system.resources.hitPoints.max}}
{{#times document.system.resources.hitPoints.maxTotal}}
{{#with (add this 1)}}
<input class="resource-box" type="checkbox" data-action="toggleHP" data-value="{{this}}" {{ checked (gte ../../document.system.resources.hitPoints.value this) }} />
{{/with}}
{{/times}}
{{#times (subtract 12 document.system.resources.hitPoints.max)}}
{{#times (subtract 12 document.system.resources.hitPoints.maxTotal)}}
<input class="resource-box disabled" type="checkbox" disabled />
{{/times}}
</div>
<div class="flexrow">
{{#times document.system.resources.stress.max}}
{{#times document.system.resources.stress.maxTotal}}
{{#with (add this 1)}}
<input class="resource-box" type="checkbox" data-action="toggleStress" data-value="{{this}}" {{ checked (gte ../../document.system.resources.stress.value this) }} />
{{/with}}
{{/times}}
{{#times (subtract 12 document.system.resources.stress.max)}}
{{#times (subtract 12 document.system.resources.stress.maxTotal)}}
<input class="resource-box disabled" type="checkbox" disabled />
{{/times}}
</div>

View file

@ -5,45 +5,45 @@
<div class="proficiency-container">
<span>{{localize "DAGGERHEART.Sheets.PC.Weapons.ProficiencyTitle"}}</span>
{{#times 6}}
<i class="fa-solid fa-circle proficiency-dot {{#if (gt ../proficiency this)}}marked{{/if}}"></i>
<i class="fa-solid fa-circle proficiency-dot {{#if (gt ../proficiency.total this)}}marked{{/if}}"></i>
{{/times}}
</div>
<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>