1.6.0 Custom Sheet Changes

Looking at the changes made which are breaking for custom sheets. Gonna make a thread for this.
7 Replies
Calego
CalegoOP3y ago
Spell Item Labels are different
Calego
CalegoOP3y ago
Symptom: object Object in your spellbook tab where components should be. Cause: labels.components has had a breaking change. Fix:
{{#each labels.components.all}}
<span class="spell-component{{#if tag}} tag{{/if}}">{{abbr}}</span>
{{/each}}
{{#each labels.components.all}}
<span class="spell-component{{#if tag}} tag{{/if}}">{{abbr}}</span>
{{/each}}
No description
Calego
CalegoOP3y ago
Here's how I'm handling backwards compatibility if it's interesting to you folks:
// in my getData method:
sheetData.systemFeatures = {
componentLabels: !foundry.utils.isNewerVersion('1.6.0', systemVersion),
};
// in my getData method:
sheetData.systemFeatures = {
componentLabels: !foundry.utils.isNewerVersion('1.6.0', systemVersion),
};
then in the hbs check the systemFeatures flags with an if to handle things correctly:
{{#if @root/systemFeatures.componentLabels}}

{{#each labels.components.all}}
<span class="spell-component{{#if tag}} tag{{/if}}">{{abbr}}</span>
{{/each}}
{{else}}

{{#each labels.components}}
<span class="spell-component {{this}}">{{this}}</span>
{{/each}}

{{/if}}
{{#if @root/systemFeatures.componentLabels}}

{{#each labels.components.all}}
<span class="spell-component{{#if tag}} tag{{/if}}">{{abbr}}</span>
{{/each}}
{{else}}

{{#each labels.components}}
<span class="spell-component {{this}}">{{this}}</span>
{{/each}}

{{/if}}
@sdenec I know the above will affect you. @fyorl (hi!) might hit you too. if anyone knows jopeek of the dndbeyond sheet's handle, I do not. does not affect Monster Blocks interestingly, well played zeel.
Calego
CalegoOP3y ago
It is possible now that a user's game activates additional Ability Scores, 2 are part of system settings: Honor and Sanity. If your ability scores run horizontally, odds are your layout breaks. Honestly... I don't intend to support this with my sheets... But it's something to be aware of in case you get issues opened.
No description
Calego
CalegoOP3y ago
It is now expected that Level items have a dropdown to allow leveling up/down from the actor sheet, as the item sheet no longer has the "level" field. This is the respective hbs for this dropdown in the core sheet's actor-features.html:
{{else if (eq item.type "class")}}
<div class="item-detail item-action">
<select class="level-selector">
{{#select 0}}
{{#each item.availableLevels}}
<option value="{{this.delta}}" {{disabled this.disabled}}>
{{localize "DND5E.LevelNumber" level=this.level}}
{{#if this.delta}}({{numberFormat this.delta sign=true}}){{/if}}
</option>
{{/each}}
{{/select}}
</select>
</div>
{{/if}}
{{else if (eq item.type "class")}}
<div class="item-detail item-action">
<select class="level-selector">
{{#select 0}}
{{#each item.availableLevels}}
<option value="{{this.delta}}" {{disabled this.disabled}}>
{{localize "DND5E.LevelNumber" level=this.level}}
{{#if this.delta}}({{numberFormat this.delta sign=true}}){{/if}}
</option>
{{/each}}
{{/select}}
</select>
</div>
{{/if}}
Calego
CalegoOP3y ago
There's more to it than this for the class display. Subclasses are displayed under their classes now, and those shouldn't have the level dropdown, but should have a little thing in front of their name.
No description
Calego
CalegoOP3y ago
<h4>
{{#if (eq item.type "subclass")}}&rdsh;{{/if}}
{{item.name}}
{{#if item.data.isOriginalClass}} <i class="original-class fas fa-sun" title="{{localize 'DND5E.ClassOriginal'}}"></i>{{/if}}
</h4>
<h4>
{{#if (eq item.type "subclass")}}&rdsh;{{/if}}
{{item.name}}
{{#if item.data.isOriginalClass}} <i class="original-class fas fa-sun" title="{{localize 'DND5E.ClassOriginal'}}"></i>{{/if}}
</h4>
Want results from more Discord servers?
Add your server