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
This commit is contained in:
WBHarry 2025-06-07 20:30:12 +02:00 committed by GitHub
parent 53be047e12
commit 746e0f239a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 190 additions and 224 deletions

View file

@ -9,7 +9,7 @@
<a
class='effect-control'
data-action='editFeature'
data-feature={{feature.uuid}}
data-feature='{{feature.uuid}}'
data-tooltip='{{localize "DAGGERHEART.Tooltip.openItemWorld"}}'
>
<i class="fa-solid fa-globe"></i>
@ -17,7 +17,7 @@
<a
class='effect-control'
data-action='deleteFeature'
data-feature={{feature.uuid}}
data-feature='{{feature.uuid}}'
data-tooltip='{{localize "DAGGERHEART.Tooltip.delete"}}'
>
<i class='fas fa-trash'></i>

View file

@ -5,22 +5,16 @@
>
<fieldset>
<legend>{{localize "DAGGERHEART.Sheets.Subclass.Tabs.Foundation"}}</legend>
{{#each source.system.foundationFeature.abilities as |feature key|}}
{{> 'systems/daggerheart/templates/sheets/global/partials/feature-section-item.hbs' feature=feature}}
{{/each}}
{{> 'systems/daggerheart/templates/sheets/global/partials/feature-section-item.hbs' feature=source.system.foundationFeature}}
</fieldset>
<fieldset>
<legend>{{localize "DAGGERHEART.Sheets.Subclass.Tabs.Specialization"}}</legend>
{{#each source.system.specializationFeature.abilities as |feature key|}}
{{> 'systems/daggerheart/templates/sheets/global/partials/feature-section-item.hbs' feature=feature}}
{{/each}}
{{> 'systems/daggerheart/templates/sheets/global/partials/feature-section-item.hbs' feature=source.system.specializationFeature}}
</fieldset>
<fieldset>
<legend>{{localize "DAGGERHEART.Sheets.Subclass.Tabs.Mastery"}}</legend>
{{#each source.system.masteryFeature.abilities as |feature key|}}
{{> 'systems/daggerheart/templates/sheets/global/partials/feature-section-item.hbs' feature=feature}}
{{/each}}
{{> 'systems/daggerheart/templates/sheets/global/partials/feature-section-item.hbs' feature=source.system.masteryFeature}}
</fieldset>
</section>

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

@ -4,17 +4,17 @@
<div class="class-info">
<div class="flexrow">
<img class="portrait" src="{{document.img}}" alt="{{document.name}}" data-edit="img">
{{#if document.system.class}}
{{#if document.system.class.value}}
<div class="flexcol">
<h2 class="class-title flex0" data-action="viewObject" data-value="{{document.system.class.uuid}}" data-tab="guide">
<h2 class="class-title flex0" data-action="viewObject" data-value="{{document.system.class.value.uuid}}" data-tab="guide">
<img class="domain-image" src="{{domains.first}}" />
<span>{{document.system.class.name}}</span>
<span>{{document.system.class.value.name}}</span>
<img class="domain-image" src="{{domains.second}}" />
</h2>
<span class="domain-title flex0">
<span>{{document.system.class.system.domains.[0]}}</span>
<span>{{document.system.class.value.system.domains.[0]}}</span>
<span>and</span>
<span>{{document.system.class.system.domains.[1]}}</span>
<span>{{document.system.class.value.system.domains.[1]}}</span>
</div>
{{else}}
<div class="flexcol">
@ -56,7 +56,7 @@
<button data-action="selectAncestry" class="option-select"><i class="fa-solid fa-user-large"></i></button>
{{/objectSelector}}
{{#objectSelector title="Subclass" ids=(join document.system.subclass.uuid) values=(join document.system.subclass.name) titleFontSize=14}}
<button data-action="selectSubclass" class="option-select" {{#if (not ../document.system.class)}}disabled{{/if}}><i class="fa-solid fa-fw fa-search"></i></button>
<button data-action="selectSubclass" class="option-select" {{#if (not ../document.system.class.value)}}disabled{{/if}}><i class="fa-solid fa-fw fa-search"></i></button>
{{/objectSelector}}
</div>
</div>