Iteration on effects tab of character sheet

This commit is contained in:
Kakeman89 2020-10-19 13:04:48 -04:00
parent a40f7adb9c
commit 90fab8d89f
5 changed files with 16 additions and 8 deletions

View file

@ -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":

View file

@ -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

View file

@ -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';