From 4b9af6a383358729d6352a42e4349ae2803fbb20 Mon Sep 17 00:00:00 2001 From: sladecraven Date: Wed, 28 Sep 2022 15:53:50 +0200 Subject: [PATCH] Allow items links in editors --- module/actor-sheet.js | 5 ++++- module/item-sheet.js | 9 ++++++++- system.json | 4 ++-- templates/actor-sheet.html | 4 ++-- templates/editor-notes-gm.html | 2 +- templates/item-action-sheet.html | 2 +- templates/item-commongear-sheet.html | 2 +- templates/item-consequence-sheet.html | 2 +- templates/item-geneline-sheet.html | 4 ++-- templates/item-injury-sheet.html | 2 +- templates/item-language-sheet.html | 2 +- templates/item-malady-sheet.html | 2 +- templates/item-skill-sheet.html | 2 +- templates/item-skillexperience-sheet.html | 2 +- templates/item-subculture-sheet.html | 2 +- templates/item-weakness-sheet.html | 2 +- 16 files changed, 29 insertions(+), 19 deletions(-) diff --git a/module/actor-sheet.js b/module/actor-sheet.js index a68338c..1be1bf4 100644 --- a/module/actor-sheet.js +++ b/module/actor-sheet.js @@ -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 diff --git a/module/item-sheet.js b/module/item-sheet.js index 6daa504..841563e 100644 --- a/module/item-sheet.js +++ b/module/item-sheet.js @@ -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; } diff --git a/system.json b/system.json index cb3adc6..21f241d 100644 --- a/system.json +++ b/system.json @@ -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" } \ No newline at end of file diff --git a/templates/actor-sheet.html b/templates/actor-sheet.html index 98cc4d3..f2de1c8 100644 --- a/templates/actor-sheet.html +++ b/templates/actor-sheet.html @@ -390,12 +390,12 @@

Biography :

- {{editor data.history target="system.history" button=true owner=owner editable=editable}} + {{editor history target="system.history" button=true owner=owner editable=editable}}

Notes :

- {{editor data.notes target="system.notes" button=true owner=owner editable=editable}} + {{editor notes target="system.notes" button=true owner=owner editable=editable}}

{{>"systems/foundryvtt-shadows-over-sol/templates/editor-notes-gm.html"}} diff --git a/templates/editor-notes-gm.html b/templates/editor-notes-gm.html index 4c17392..efc203c 100644 --- a/templates/editor-notes-gm.html +++ b/templates/editor-notes-gm.html @@ -1,6 +1,6 @@ {{#if data.isGM}}

GM Notes :

- {{editor data.gmnotes target="system.gmnotes" button=true owner=owner editable=editable}} + {{editor gmnotes target="system.gmnotes" button=true owner=owner editable=editable}}
{{/if}} diff --git a/templates/item-action-sheet.html b/templates/item-action-sheet.html index 5ff5d6b..d3b75a1 100644 --- a/templates/item-action-sheet.html +++ b/templates/item-action-sheet.html @@ -36,7 +36,7 @@
- {{editor data.description target="system.description" button=true owner=owner editable=editable}} + {{editor description target="system.description" button=true owner=owner editable=editable}}
diff --git a/templates/item-commongear-sheet.html b/templates/item-commongear-sheet.html index ea91518..8f9b6e5 100644 --- a/templates/item-commongear-sheet.html +++ b/templates/item-commongear-sheet.html @@ -46,6 +46,6 @@
- {{editor data.description target="system.description" button=true owner=owner editable=editable}} + {{editor description target="system.description" button=true owner=owner editable=editable}}
diff --git a/templates/item-consequence-sheet.html b/templates/item-consequence-sheet.html index ead2e39..0e04353 100644 --- a/templates/item-consequence-sheet.html +++ b/templates/item-consequence-sheet.html @@ -27,7 +27,7 @@
- {{editor data.description target="system.description" button=true owner=owner editable=editable}} + {{editor description target="system.description" button=true owner=owner editable=editable}}
diff --git a/templates/item-geneline-sheet.html b/templates/item-geneline-sheet.html index ab52044..e6299c6 100644 --- a/templates/item-geneline-sheet.html +++ b/templates/item-geneline-sheet.html @@ -13,7 +13,7 @@
- {{editor data.description target="system.description" button=true owner=owner editable=editable}} + {{editor description target="system.description" button=true owner=owner editable=editable}}
@@ -31,7 +31,7 @@
- {{editor data.weakness target="system.weakness" button=true owner=owner editable=editable}} + {{editor weakness target="system.weakness" button=true owner=owner editable=editable}}
diff --git a/templates/item-injury-sheet.html b/templates/item-injury-sheet.html index 433d531..8e8bd52 100644 --- a/templates/item-injury-sheet.html +++ b/templates/item-injury-sheet.html @@ -17,7 +17,7 @@
- {{editor data.description target="system.description" button=true owner=owner editable=editable}} + {{editor description target="system.description" button=true owner=owner editable=editable}}
diff --git a/templates/item-language-sheet.html b/templates/item-language-sheet.html index 216ebc0..c6941da 100644 --- a/templates/item-language-sheet.html +++ b/templates/item-language-sheet.html @@ -13,7 +13,7 @@
- {{editor data.description target="system.description" button=true owner=owner editable=editable}} + {{editor description target="system.description" button=true owner=owner editable=editable}}
diff --git a/templates/item-malady-sheet.html b/templates/item-malady-sheet.html index 67daede..51eac36 100644 --- a/templates/item-malady-sheet.html +++ b/templates/item-malady-sheet.html @@ -24,7 +24,7 @@
- {{editor data.notes target="system.notes" button=true owner=owner editable=editable}} + {{editor notes target="system.notes" button=true owner=owner editable=editable}}
diff --git a/templates/item-skill-sheet.html b/templates/item-skill-sheet.html index 3c65779..a1c7794 100644 --- a/templates/item-skill-sheet.html +++ b/templates/item-skill-sheet.html @@ -27,7 +27,7 @@ {{/each}} - {{editor data.description target="system.description" button=true owner=owner editable=editable}} + {{editor description target="system.description" button=true owner=owner editable=editable}} diff --git a/templates/item-skillexperience-sheet.html b/templates/item-skillexperience-sheet.html index b37462a..3a1e3dd 100644 --- a/templates/item-skillexperience-sheet.html +++ b/templates/item-skillexperience-sheet.html @@ -25,7 +25,7 @@
- {{editor data.description target="system.description" button=true owner=owner editable=editable}} + {{editor description target="system.description" button=true owner=owner editable=editable}}
diff --git a/templates/item-subculture-sheet.html b/templates/item-subculture-sheet.html index e40926c..7c02e2a 100644 --- a/templates/item-subculture-sheet.html +++ b/templates/item-subculture-sheet.html @@ -13,7 +13,7 @@
- {{editor data.description target="system.description" button=true owner=owner editable=editable}} + {{editor description target="system.description" button=true owner=owner editable=editable}}
diff --git a/templates/item-weakness-sheet.html b/templates/item-weakness-sheet.html index 4706f9f..f122046 100644 --- a/templates/item-weakness-sheet.html +++ b/templates/item-weakness-sheet.html @@ -26,7 +26,7 @@
- {{editor data.description target="system.description" button=true owner=owner editable=editable}} + {{editor description target="system.description" button=true owner=owner editable=editable}}