Using sheet prepare on text template if available
This commit is contained in:
@@ -217,7 +217,8 @@ export class ActorL5r5e extends Actor {
|
||||
* @return {Promise<string|null>}
|
||||
*/
|
||||
async renderTextTemplate() {
|
||||
const tpl = await renderTemplate(`${CONFIG.l5r5e.paths.templates}actors/actor-text.html`, this);
|
||||
const data = (await this.sheet?.getData()) || this;
|
||||
const tpl = await renderTemplate(`${CONFIG.l5r5e.paths.templates}actors/actor-text.html`, data);
|
||||
if (!tpl) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -134,9 +134,12 @@ export class ItemL5r5e extends Item {
|
||||
* @return {Promise<string|null>}
|
||||
*/
|
||||
async renderTextTemplate() {
|
||||
const data = (await this.sheet?.getData()) || this;
|
||||
if (data instanceof ItemL5r5e) {
|
||||
await game.l5r5e.HelpersL5r5e.refreshItemProperties(this);
|
||||
}
|
||||
const type = this.type.replace("_", "-"); // ex: item_pattern
|
||||
await game.l5r5e.HelpersL5r5e.refreshItemProperties(this);
|
||||
const tpl = await renderTemplate(`${CONFIG.l5r5e.paths.templates}items/${type}/${type}-text.html`, this);
|
||||
const tpl = await renderTemplate(`${CONFIG.l5r5e.paths.templates}items/${type}/${type}-text.html`, data);
|
||||
if (!tpl) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -7,7 +7,8 @@ export class JournalL5r5e extends JournalEntry {
|
||||
* @return {Promise<string|null>}
|
||||
*/
|
||||
async renderTextTemplate() {
|
||||
const tpl = await renderTemplate(`${CONFIG.l5r5e.paths.templates}journal/journal-text.html`, this);
|
||||
const data = (await this.sheet?.getData()) || this;
|
||||
const tpl = await renderTemplate(`${CONFIG.l5r5e.paths.templates}journal/journal-text.html`, data);
|
||||
if (!tpl) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -11,10 +11,7 @@
|
||||
<li><strong>{{localize 'l5r5e.bought_at_rank'}}</strong> : {{data.data.bought_at_rank}}</li>
|
||||
</ul>
|
||||
{{!--Linked property--}}
|
||||
{{!--
|
||||
<strong>{{localize 'l5r5e.linked_property'}}</strong> : {{{data.data.linkedProperty.name}}}
|
||||
linked_property_id
|
||||
--}}
|
||||
<strong>{{localize 'l5r5e.linked_property'}}</strong> : {{{data.linkedProperty.name}}}
|
||||
{{!--item-infos--}}
|
||||
<p><strong>{{localize 'l5r5e.description'}}</strong> : {{{data.data.description}}}</p>
|
||||
<p><strong>{{localize 'l5r5e.book_reference'}}</strong> : {{data.data.book_reference}}</p>
|
||||
|
||||
@@ -20,7 +20,15 @@
|
||||
<strong>{{localize 'l5r5e.advancements.total_xp_spent'}}</strong> : {{data.data.xp_used_total}}
|
||||
</li>
|
||||
</ul>
|
||||
{{!-- {{#each data.embedItemsList as |advancement|}} {{json advancement}} {{/each}} --}}
|
||||
{{!--advancements--}}
|
||||
{{#if data.embedItemsList}}
|
||||
<p>
|
||||
<strong>{{localize 'l5r5e.advancements.title'}}</strong>
|
||||
<ul>
|
||||
{{#each data.embedItemsList as |advancement|}}<li>{{advancement.name}} ({{advancement.data.xp_used}})</li>{{/each}}
|
||||
</ul>
|
||||
</p>
|
||||
{{/if}}
|
||||
{{!--item-infos--}}
|
||||
<p><strong>{{localize 'l5r5e.description'}}</strong> : {{{data.data.description}}}</p>
|
||||
<p><strong>{{localize 'l5r5e.book_reference'}}</strong> : {{data.data.book_reference}}</p>
|
||||
|
||||
Reference in New Issue
Block a user