daggerheart/templates/sheets/parts/features.hbs
2025-05-22 16:53:39 +02:00

48 lines
No EOL
3.1 KiB
Handlebars

<fieldset class="left-main-container" style="flex: 1;">
<legend class="legend">
{{#if this.document.system.class}}
{{#if this.document.system.multiclass}}
<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>
{{/if}}
{{else}}
<span>{{localize "DAGGERHEART.Sheets.PC.Features.Title"}}</span>
{{/if}}
</legend>
<div class="features-container" style="font-size: 11px;">
{{#each this.features as |feature index|}}
<div class="feature-container">
<img class="feature-img" src="{{feature.img}}" />
<div class="feature-label icon-button" data-action="viewObject" data-value="{{feature.uuid}}">{{feature.name}}</div>
<button data-action="useFeature" data-id="{{feature.uuid}}"><i class="fa-solid fa-message"></i></button>
</div>
<div class="flexrow flex-centered">
<div>{{{feature.system.description}}}</div> {{!-- Maybe maybe --}}
{{#if (eq feature.system.featureType.type 'input')}}
<input class="feature-input flex0" type="text" data-feature="{{feature.uuid}}" value="{{feature.system.featureType.data.value}}" data-dtype="Number" />
{{/if}}
{{#if (eq feature.system.featureType.type 'dice')}}
<div class="feature-tick-container">
{{#times feature.system.featureType.data.max}}
{{#if (gt ../this.system.featureType.data.property this)}}
<div data-action="toggleFeatureDice" data-feature="{{../this.uuid}}" data-index="{{this}}" class="feature-tick {{#if (lookup (lookup ../this.system.featureType.data.numbers this) 'used')}}used{{/if}}">
{{#if (lookup (lookup ../this.system.featureType.data.numbers this) 'value')}}
<div class="feature-dice-value">{{lookup (lookup ../this.system.featureType.data.numbers this) 'value'}}</div>
{{else}}
<img src="icons/dice/{{../this.system.featureType.data.value}}black.svg" />
{{/if}}
</div>
{{else}}
<div class="feature-tick disabled"></div>
{{/if}}
{{/times}}
</div>
{{/if}}
</div>
{{/each}}
</div>
</fieldset>