From 90fab8d89fd62fb3dc87ac447107681bcb36b2e0 Mon Sep 17 00:00:00 2001 From: Kakeman89 Date: Mon, 19 Oct 2020 13:04:48 -0400 Subject: [PATCH] Iteration on effects tab of character sheet --- less/character.less | 4 ++++ module/actor/sheets/base.js | 7 +++---- module/chat.js | 2 +- module/item/sheet.js | 3 +-- templates/actors/character-sheet.html | 8 +++++++- 5 files changed, 16 insertions(+), 8 deletions(-) diff --git a/less/character.less b/less/character.less index 62a81d32..908f97e6 100644 --- a/less/character.less +++ b/less/character.less @@ -172,4 +172,8 @@ resize: none; } } + + .biography { + max-width: calc(100% - 180px); + } } diff --git a/module/actor/sheets/base.js b/module/actor/sheets/base.js index ca7181ad..7a3bdc9a 100644 --- a/module/actor/sheets/base.js +++ b/module/actor/sheets/base.js @@ -101,8 +101,7 @@ export default class ActorSheet5e extends ActorSheet { this._prepareItems(data); // Prepare active effects - // TODO Disabled until 0.7.5 release - // this._prepareEffects(data); + this._prepareEffects(data); // Return data to the sheet return data @@ -176,7 +175,7 @@ export default class ActorSheet5e extends ActorSheet { e._getSourceName(); // Trigger a lookup for the source name if ( e.data.disabled ) categories.inactive.effects.push(e); else if ( e.isTemporary ) categories.temporary.effects.push(e); - else categories.inactive.push(e); + else categories.passive.effects.push(e); } // Add the prepared categories of effects to the rendering data @@ -744,7 +743,7 @@ export default class ActorSheet5e extends ActorSheet { const effect = this.actor.effects.get(li.dataset.effectId); switch ( a.dataset.action ) { case "edit": - return new ActiveEffectConfig(effect).render(true); + return effect.sheet.render(true); case "delete": return effect.delete(); case "toggle": diff --git a/module/chat.js b/module/chat.js index 3c4866bb..0d4bcd3d 100644 --- a/module/chat.js +++ b/module/chat.js @@ -13,7 +13,7 @@ export const highlightCriticalSuccessFailure = function(message, html, data) { // Ensure it is an un-modified d20 roll const isD20 = (d.faces === 20) && ( d.results.length === 1 ); if ( !isD20 ) return; - const isModifiedRoll = ("success" in d.rolls[0]) || d.options.marginSuccess || d.options.marginFailure; + const isModifiedRoll = ("success" in d.results[0]) || d.options.marginSuccess || d.options.marginFailure; if ( isModifiedRoll ) return; // Highlight successes and failures diff --git a/module/item/sheet.js b/module/item/sheet.js index 15685f21..c61258b1 100644 --- a/module/item/sheet.js +++ b/module/item/sheet.js @@ -40,8 +40,6 @@ export default class ItemSheet5e extends ItemSheet { getData() { const data = super.getData(); data.labels = this.item.labels; - - // Include CONFIG values data.config = CONFIG.SW5E; // Item Type, Status, and Details @@ -57,6 +55,7 @@ export default class ItemSheet5e extends ItemSheet { data.hasAttackRoll = this.item.hasAttack; data.isHealing = data.item.data.actionType === "heal"; data.isFlatDC = getProperty(data.item.data, "save.scaling") === "flat"; + data.isLine = ["line", "wall"].includes(data.item.data.target?.type); // Vehicles data.isCrewed = data.item.data.activation?.type === 'crew'; diff --git a/templates/actors/character-sheet.html b/templates/actors/character-sheet.html index f132cefe..cc9003be 100644 --- a/templates/actors/character-sheet.html +++ b/templates/actors/character-sheet.html @@ -114,6 +114,7 @@ {{ localize "SW5E.Inventory" }} {{ localize "SW5E.Features" }} {{ localize "SW5E.Powerbook" }} + {{ localize "SW5E.Effects" }} {{ localize "SW5E.Biography" }} @@ -227,7 +228,12 @@
{{> "systems/sw5e/templates/actors/parts/actor-powerbook.html"}}
- + + {{!-- Effects Tab --}} +
+ {{> "systems/sw5e/templates/actors/parts/actor-effects.html"}} +
+ {{!-- Biography Tab --}}