diff --git a/module/actor/actor-sheet.js b/module/actor/actor-sheet.js index 08afd9e..201570b 100644 --- a/module/actor/actor-sheet.js +++ b/module/actor/actor-sheet.js @@ -47,13 +47,24 @@ export class DeltaGreenActorSheet extends ActorSheet { } /** @override */ - getData() { + async getData() { const data = super.getData(); // Prepare items. if (this.actor.type == 'agent') { this._prepareCharacterItems(data); } + + switch (this.actor.type) { + case "agent": + data.enrichedDescription = await TextEditor.enrichHTML(this.object.system.physicalDescription, {async: true}); + break; + case "npc": + case "unnatural": + data.enrichedDescription = await TextEditor.enrichHTML(this.object.system.notes, {async: true}); + break; + default: + } return data; } diff --git a/module/item/item-sheet.js b/module/item/item-sheet.js index 29f8ad1..277eb31 100644 --- a/module/item/item-sheet.js +++ b/module/item/item-sheet.js @@ -25,8 +25,9 @@ export class DeltaGreenItemSheet extends ItemSheet { /* -------------------------------------------- */ /** @override */ - getData() { + async getData() { const data = super.getData(); + data.enrichedDescription = await TextEditor.enrichHTML(this.object.system.description, {async: true}); return data; } diff --git a/templates/actor/cv-partial.html b/templates/actor/cv-partial.html index 148b02a..336975f 100644 --- a/templates/actor/cv-partial.html +++ b/templates/actor/cv-partial.html @@ -50,5 +50,5 @@
- {{editor actor.system.physicalDescription target="system.physicalDescription" button=true owner=owner editable=editable}} + {{editor enrichedDescription target="system.physicalDescription" button=true owner=owner editable=editable}}
\ No newline at end of file diff --git a/templates/actor/limited-sheet.html b/templates/actor/limited-sheet.html index 8126f1b..9400c44 100644 --- a/templates/actor/limited-sheet.html +++ b/templates/actor/limited-sheet.html @@ -13,7 +13,7 @@

-

+

diff --git a/templates/actor/npc-sheet.html b/templates/actor/npc-sheet.html index aa0da74..c0173a2 100644 --- a/templates/actor/npc-sheet.html +++ b/templates/actor/npc-sheet.html @@ -1,5 +1,4 @@
- {{!-- Sheet Header --}}
@@ -91,7 +90,7 @@ {{!-- Checkbox to hide/show skills that are at zero --}}
{{localize 'DG.UnnaturalSheet.HideUntrainedSkillsLabel'}}: - +
@@ -143,7 +142,7 @@
- {{editor actor.system.notes target="system.notes" button=true owner=owner editable=editable}} + {{editor enrichedDescription target="system.notes" button=true owner=owner editable=editable}}
diff --git a/templates/actor/unnatural-sheet.html b/templates/actor/unnatural-sheet.html index ac20b0d..f5f0c92 100644 --- a/templates/actor/unnatural-sheet.html +++ b/templates/actor/unnatural-sheet.html @@ -1,5 +1,4 @@ - {{!-- Sheet Header --}}
@@ -88,7 +87,7 @@ {{!-- Checkbox to hide/show skills that are at zero --}}
{{localize 'DG.UnnaturalSheet.HideUntrainedSkillsLabel'}}: - +
@@ -140,7 +139,7 @@
- {{editor actor.system.notes target="system.notes" button=true owner=owner editable=editable}} + {{editor enrichedDescription target="system.notes" button=true owner=owner editable=editable}}
diff --git a/templates/item/item-armor-sheet.html b/templates/item/item-armor-sheet.html index 934a75e..f89c01e 100644 --- a/templates/item/item-armor-sheet.html +++ b/templates/item/item-armor-sheet.html @@ -11,22 +11,22 @@ {{localize 'DG.ItemWindow.Armor.Expense'}}: {{localize 'DG.ItemWindow.Armor.Equipped'}}: - +
{{localize 'DG.ItemWindow.Armor.ArmorRating'}}: - +
@@ -41,7 +41,7 @@ {{!-- Description Tab --}}
- {{editor system.description target="system.description" button=true owner=owner editable=editable}} + {{editor enrichedDescription target="system.description" button=true owner=owner editable=editable}}
diff --git a/templates/item/item-bond-sheet.html b/templates/item/item-bond-sheet.html index 54ef5f0..4cb083b 100644 --- a/templates/item/item-bond-sheet.html +++ b/templates/item/item-bond-sheet.html @@ -9,12 +9,12 @@ {{localize 'DG.Bonds.Score'}}: - {{localize 'DG.Bonds.Relationship'}}: - + @@ -30,7 +30,7 @@ {{!-- Description Tab --}}
- {{editor system.description target="system.description" button=true owner=owner editable=editable}} + {{editor enrichedDescription target="system.description" button=true owner=owner editable=editable}}
diff --git a/templates/item/item-gear-sheet.html b/templates/item/item-gear-sheet.html index 79de9c4..2a816b3 100644 --- a/templates/item/item-gear-sheet.html +++ b/templates/item/item-gear-sheet.html @@ -12,15 +12,15 @@ {{localize 'DG.ItemWindow.Gear.Expense'}}: {{localize 'DG.ItemWindow.Gear.Equipped'}}: - + @@ -38,7 +38,7 @@ {{!-- Description Tab --}}
- {{editor system.description target="system.description" button=true owner=owner editable=editable}} + {{editor enrichedDescription target="system.description" button=true owner=owner editable=editable}}
diff --git a/templates/item/item-motivation-sheet.html b/templates/item/item-motivation-sheet.html index 4a07283..94e8e2a 100644 --- a/templates/item/item-motivation-sheet.html +++ b/templates/item/item-motivation-sheet.html @@ -13,7 +13,7 @@
{{localize 'DG.ItemWindow.Motivations.IsDisorder'}}: - @@ -25,7 +25,7 @@ title="{{localize 'DG.ItemWindow.Motivations.MotivationNameTooltip'}}" {{!-- If a motivation has been crossed off after a breaking point, do a strikeout on it and disable it. --}} - {{#if system.crossedOut}} + {{#if item.system.crossedOut}} style="text-decoration: line-through;" disabled {{/if}} @@ -33,17 +33,17 @@ {{!-- Only Show the Disorders Section if Motivation Lost Checked --}} - {{#if system.crossedOut}} + {{#if item.system.crossedOut}} {{localize 'DG.ItemWindow.Motivations.Disorder'}}: - {{localize 'DG.ItemWindow.Motivations.DisorderHasBeenCured'}}: - @@ -54,7 +54,7 @@
- {{editor system.description target="system.description" button=true owner=owner editable=editable}} + {{editor enrichedDescription target="system.description" button=true owner=owner editable=editable}}
diff --git a/templates/item/item-weapon-sheet.html b/templates/item/item-weapon-sheet.html index e85a2ba..c8e0c49 100644 --- a/templates/item/item-weapon-sheet.html +++ b/templates/item/item-weapon-sheet.html @@ -11,15 +11,15 @@ {{localize 'DG.ItemWindow.Weapons.Expense'}}: {{localize 'DG.ItemWindow.Gear.Equipped'}}: - + @@ -30,56 +30,56 @@ {{localize 'DG.ItemWindow.Weapons.Skill'}}: {{localize 'DG.ItemWindow.Weapons.IsLethality'}}: - {{localize 'DG.ItemWindow.Weapons.KillRadius'}}: - +
{{localize 'DG.ItemWindow.Weapons.Range'}}: - + {{!-- If a weapon is 'Lethal', need to show the d100% Lethality input, otherwise only show the regular Damage formula (e.g. 1D6, 1D4+2, etc...) --}} - {{#unless system.isLethal}} + {{#unless item.system.isLethal}} {{localize 'DG.ItemWindow.Weapons.Damage'}}: - + {{/unless}} - {{#if system.isLethal}} + {{#if item.system.isLethal}} {{localize 'DG.ItemWindow.Weapons.Lethality'}} %: - {{/if}} {{localize 'DG.ItemWindow.Weapons.ArmorPiercing'}}: - +
@@ -87,7 +87,7 @@
{{localize 'DG.ItemWindow.Weapons.Ammo'}}: - +
@@ -103,7 +103,7 @@ {{!-- Description Tab --}}
- {{editor system.description target="system.description" button=true owner=owner editable=editable}} + {{editor enrichedDescription target="system.description" button=true owner=owner editable=editable}}