Allow items links in editors

This commit is contained in:
sladecraven 2022-09-28 15:53:50 +02:00
parent d94c1a4dce
commit 4b9af6a383
16 changed files with 29 additions and 19 deletions

View File

@ -22,7 +22,7 @@ export class SoSActorSheet extends ActorSheet {
}
/* -------------------------------------------- */
getData() {
async getData() {
const objectData = this.object
let formData = {
title: this.title,
@ -34,6 +34,9 @@ export class SoSActorSheet extends ActorSheet {
cssClass: this.isEditable ? "editable" : "locked",
data: foundry.utils.deepClone(this.object.system),
effects: this.object.effects.map(e => foundry.utils.deepClone(e.data)),
history: await TextEditor.enrichHTML(this.object.system.history, {async: true}),
notes: await TextEditor.enrichHTML(this.object.system.notes, {async: true}),
gmnotes: await TextEditor.enrichHTML(this.object.system.gmnotes, {async: true}),
limited: this.object.limited,
options: this.options,
owner: this.document.isOwner

View File

@ -56,7 +56,8 @@ export class SoSItemSheet extends ItemSheet {
effects: this.object.effects.map(e => foundry.utils.deepClone(e.system)),
limited: this.object.limited,
options: this.options,
owner: this.document.isOwner
owner: this.document.isOwner,
description: await TextEditor.enrichHTML(this.object.system.description, {async: true}),
};
formData.isGM = game.user.isGM;
@ -66,6 +67,12 @@ export class SoSItemSheet extends ItemSheet {
if ( objectData.type == 'skill' && this.object.options?.actor) {
formData.skillExperienceList = this.object.options.actor.getSkillExperience( objectData.name )
}
if ( objectData.type == 'geneline') {
formData.weakness = await TextEditor.enrichHTML(this.object.system.weakness, {async: true})
}
if ( objectData.type == 'malady') {
formData.notes = await TextEditor.enrichHTML(this.object.system.notes, {async: true})
}
return formData;
}

View File

@ -4,7 +4,7 @@
"description": "Shadows over Sol for FoundryVTT",
"url": "https://www.uberwald.me/gitea/public/foundryvtt-shadows-over-sol/",
"license": "LICENSE.txt",
"version": "10.0.6",
"version": "10.0.7",
"compatibility": {
"minimum": "10",
"verified": "10.285",
@ -109,7 +109,7 @@
],
"socket": true,
"manifest": "https://www.uberwald.me/gitea/public/foundryvtt-shadows-over-sol/raw/branch/v10/system.json",
"download": "https://www.uberwald.me/gitea/public/foundryvtt-shadows-over-sol/archive/foundryvtt-shadows-over-sol-10.0.6.zip",
"download": "https://www.uberwald.me/gitea/public/foundryvtt-shadows-over-sol/archive/foundryvtt-shadows-over-sol-10.0.7.zip",
"gridDistance": 5,
"gridUnits": "ft"
}

View File

@ -390,12 +390,12 @@
<hr>
<h3>Biography : </h3>
<div class="form-group editor">
{{editor data.history target="system.history" button=true owner=owner editable=editable}}
{{editor history target="system.history" button=true owner=owner editable=editable}}
</div>
<hr>
<h3>Notes : </h3>
<div class="form-group editor">
{{editor data.notes target="system.notes" button=true owner=owner editable=editable}}
{{editor notes target="system.notes" button=true owner=owner editable=editable}}
</div>
<hr>
{{>"systems/foundryvtt-shadows-over-sol/templates/editor-notes-gm.html"}}

View File

@ -1,6 +1,6 @@
{{#if data.isGM}}
<h3>GM Notes : </h3>
<div class="form-group editor">
{{editor data.gmnotes target="system.gmnotes" button=true owner=owner editable=editable}}
{{editor gmnotes target="system.gmnotes" button=true owner=owner editable=editable}}
</div>
{{/if}}

View File

@ -36,7 +36,7 @@
<div class="flexcol">
<label class="generic-label">Description</label>
<div class="form-group medium-editor">
{{editor data.description target="system.description" button=true owner=owner editable=editable}}
{{editor description target="system.description" button=true owner=owner editable=editable}}
</div>
</div>
</div>

View File

@ -46,6 +46,6 @@
<div class="flexcol">
<label class="generic-label">Description</label>
<div class="form-group medium-editor">
{{editor data.description target="system.description" button=true owner=owner editable=editable}}
{{editor description target="system.description" button=true owner=owner editable=editable}}
</div>
</div>

View File

@ -27,7 +27,7 @@
<div class="flexcol">
<label class="generic-label">Description</label>
<div class="form-group medium-editor">
{{editor data.description target="system.description" button=true owner=owner editable=editable}}
{{editor description target="system.description" button=true owner=owner editable=editable}}
</div>
</div>
</div>

View File

@ -13,7 +13,7 @@
<div class="flexcol">
<label class="generic-label">Description</label>
<div class="form-group medium-editor">
{{editor data.description target="system.description" button=true owner=owner editable=editable}}
{{editor description target="system.description" button=true owner=owner editable=editable}}
</div>
</div>
<div class="flexcol">
@ -31,7 +31,7 @@
<div class="flexcol">
<label class="generic-label">Weakness</label>
<div class="form-group small-editor">
{{editor data.weakness target="system.weakness" button=true owner=owner editable=editable}}
{{editor weakness target="system.weakness" button=true owner=owner editable=editable}}
</div>
</div>
</div>

View File

@ -17,7 +17,7 @@
<div class="flexcol">
<label class="generic-label">Description</label>
<div class="form-group medium-editor">
{{editor data.description target="system.description" button=true owner=owner editable=editable}}
{{editor description target="system.description" button=true owner=owner editable=editable}}
</div>
</div>
</div>

View File

@ -13,7 +13,7 @@
<div class="flexcol">
<label class="generic-label">Description</label>
<div class="form-group medium-editor">
{{editor data.description target="system.description" button=true owner=owner editable=editable}}
{{editor description target="system.description" button=true owner=owner editable=editable}}
</div>
</div>
</div>

View File

@ -24,7 +24,7 @@
<div class="flexcol">
<label class="generic-label">Notes</label>
<div class="form-group medium-editor">
{{editor data.notes target="system.notes" button=true owner=owner editable=editable}}
{{editor notes target="system.notes" button=true owner=owner editable=editable}}
</div>
</div>
</div>

View File

@ -27,7 +27,7 @@
{{/each}}
</ul>
<label class="generic-label">Description</label>
{{editor data.description target="system.description" button=true owner=owner editable=editable}}
{{editor description target="system.description" button=true owner=owner editable=editable}}
</div>
</section>

View File

@ -25,7 +25,7 @@
<div class="flexcol">
<label class="generic-label">Description</label>
<div class="form-group medium-editor">
{{editor data.description target="system.description" button=true owner=owner editable=editable}}
{{editor description target="system.description" button=true owner=owner editable=editable}}
</div>
</div>
</div>

View File

@ -13,7 +13,7 @@
<div class="flexcol">
<label class="generic-label">Description</label>
<div class="form-group medium-editor">
{{editor data.description target="system.description" button=true owner=owner editable=editable}}
{{editor description target="system.description" button=true owner=owner editable=editable}}
</div>
</div>
<div class="flexcol">

View File

@ -26,7 +26,7 @@
<div class="flexcol">
<label class="generic-label">Description</label>
<div class="form-group medium-editor">
{{editor data.description target="system.description" button=true owner=owner editable=editable}}
{{editor description target="system.description" button=true owner=owner editable=editable}}
</div>
</div>
</div>