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

@ -1,4 +1,4 @@
<div class="component dh-style card-preview-container selectable {{#if this.disabled}}disabled{{/if}}" data-action="selectPreview" data-path="{{this.path}}" data-uuid="{{this.uuid}}" {{#if selected}}data-selected="true"{{/if}}>
<div class="component dh-style card-preview-container selectable {{#if this.disabled}}disabled{{/if}}" data-action="selectPreview" data-path="{{this.path}}" data-uuid="{{this.uuid}}" data-is-multiclass="{{this.isMulticlass}}" data-feature-state="{{this.featureState}}" {{#if selected}}data-selected="true"{{/if}}>
<div class="preview-image-outer-container">
<img class="preview-image-container" src="{{this.img}}" />
{{#if this.selected}}
@ -7,5 +7,8 @@
</div>
{{/if}}
</div>
<div class="preview-text-container">{{this.name}}</div>
<div class="preview-text-container">
<div>{{this.name}}</div>
<strong>{{this.featureLabel}}</strong>
</div>
</div>

View file

@ -51,7 +51,11 @@
<div class="levelup-card-selection domain-cards">
{{#each this.domainCards}}
{{> "systems/daggerheart/templates/components/card-preview.hbs" this }}
{{#> "systems/daggerheart/templates/components/card-preview.hbs" this }}
{{#each this.emptySubtexts}}
<div>{{this}}</div>
{{/each}}
{{/"systems/daggerheart/templates/components/card-preview.hbs"}}
{{/each}}
</div>
</div>
@ -63,7 +67,7 @@
<div class="levelup-card-selection subclass-cards">
{{#each this.subclassCards}}
{{> "systems/daggerheart/templates/views/levelup/parts/selectable-card-preview.hbs" img=this.img name=this.name path=this.path selected=this.selected uuid=this.uuid disabled=this.disabled }}
{{> "systems/daggerheart/templates/views/levelup/parts/selectable-card-preview.hbs" img=this.img header=this.featureLabel name=this.name path=this.path selected=this.selected uuid=this.uuid isMulticlass=this.isMulticlass featureState=this.featureState disabled=this.disabled }}
{{/each}}
</div>
</div>
@ -74,7 +78,9 @@
<h3>{{localize "DAGGERHEART.Application.LevelUp.summary.multiclass"}}</h3>
<div class="levelup-card-selection multiclass-cards" data-path="{{this.multiclass.path}}" data-tier="{{this.multiclass.tier}}" data-min-cost="{{this.multiclass.minCost}}" data-amount="{{this.multiclass.amount}}" data-value="{{this.multiclass.value}}" data-type="{{this.multiclass.type}}">
{{> "systems/daggerheart/templates/components/card-preview.hbs" this.multiclass }}
{{#> "systems/daggerheart/templates/components/card-preview.hbs" this.multiclass }}
{{this.multiclass.emptySubtext}}
{{/"systems/daggerheart/templates/components/card-preview.hbs"}}
<div class="levelup-domains-selection-container">
{{#each this.multiclass.domains}}
<div class="levelup-domain-selection-container {{#if this.disabled}}disabled{{/if}}" {{#if (not this.disabled)}}data-action="selectDomain" data-uuid="{{../multiclass.uuid}}" data-domain="{{this.id}}" data-path="{{../multiclass.path}}" {{/if}}>
@ -88,6 +94,20 @@
</div>
{{/each}}
</div>
<div class="levelup-domains-selection-container">
{{#each this.multiclass.subclasses}}
<div class="levelup-domain-selection-container {{#if this.disabled}}disabled{{/if}}" {{#if (not this.disabled)}}data-action="selectSubclass" data-uuid="{{../multiclass.uuid}}" data-subclass="{{this.uuid}}" data-path="{{../multiclass.path}}" {{/if}}>
<div class="levelup-domain-label">{{localize this.name}}</div>
<img src="{{this.img}}" />
{{#if this.selected}}
<div class="levelup-domain-selected">
<i class="fa-solid fa-check"></i>
</div>
{{/if}}
</div>
{{/each}}
</div>
</div>
</div>
{{/if}}

View file

@ -95,11 +95,14 @@
{{#if this.advancements.traits}}
<div>
<h5>{{localize "DAGGERHEART.Application.LevelUp.summary.traits"}}</h5>
<div class="summary-selection-container">
{{#each this.advancements.traits}}
<div class="summary-selection">{{this}}</div>
<div class="increase-container">
{{this.label}}: {{this.old}}
<i class="fa-solid fa-arrow-right-long"></i>
{{this.new}}
</div>
{{/each}}
</div>
</div>
{{/if}}
@ -124,6 +127,30 @@
</div>
</div>
{{/if}}
{{#if this.advancements.subclass}}
<div>
<h5>{{localize "DAGGERHEART.Application.LevelUp.summary.subclass"}}</h5>
<div class="summary-selection-container">
{{#each this.advancements.subclass}}
<div class="summary-selection">{{this.name}} - {{this.featureLabel}}</div>
{{/each}}
</div>
</div>
{{/if}}
{{#if this.advancements.multiclass}}
{{#with this.advancements.multiclass}}
<div>
<h5>{{localize "DAGGERHEART.Application.LevelUp.summary.multiclass"}}</h5>
<div class="summary-selection-container">
<div class="summary-selection">{{this.name}}</div>
<div class="summary-selection">{{this.domain}}</div>
<div class="summary-selection">{{this.subclass}}</div>
</div>
</div>
{{/with}}
{{/if}}
</div>
</fieldset>