Display fallback icon iin the effects tab if no icon is available
This commit is contained in:
parent
710659510e
commit
e10a3f17ac
4 changed files with 9 additions and 2 deletions
|
@ -211,7 +211,7 @@
|
||||||
"DS4.CreatureBaseInfoSizeCategory": "Größenkategorie",
|
"DS4.CreatureBaseInfoSizeCategory": "Größenkategorie",
|
||||||
"DS4.CreatureBaseInfoExperiencePoints": "Erfahrungspunkte",
|
"DS4.CreatureBaseInfoExperiencePoints": "Erfahrungspunkte",
|
||||||
"DS4.CreatureBaseInfoDescription": "Beschreibung",
|
"DS4.CreatureBaseInfoDescription": "Beschreibung",
|
||||||
"DS4.WarningManageActiveEffectOnOwnedItem": "Das Verwalten von aktiven Effekten innerhalb eines besessen Items wird derzeit nicht unterstützt und wird in einem nachfolgenden Update hinzugefügt.",
|
"DS4.WarningManageActiveEffectOnOwnedItem": "Das Verwalten von aktiven Effekten innerhalb eines besessen Items wird derzeit nicht unterstützt und wird in einem nachfolgenden Update hinzugefügt. Falls Sie eigentlich den auf den Aktor übertragenen Effekt verwalten wollen, können Sie dies im 'Effekte'-Tab des Aktorbogens tun.",
|
||||||
"DS4.WarningActorCannotOwnItem": "Der Aktor '{actorName}' vom Typ '{actorType}' kann das Item '{itemName}' vom Typ '{itemType}' nicht besitzen.",
|
"DS4.WarningActorCannotOwnItem": "Der Aktor '{actorName}' vom Typ '{actorType}' kann das Item '{itemName}' vom Typ '{itemType}' nicht besitzen.",
|
||||||
"DS4.ErrorDiceCoupFumbleOverlap": "Es gibt eine Überlappung zwischen Patzern und Immersiegen.",
|
"DS4.ErrorDiceCoupFumbleOverlap": "Es gibt eine Überlappung zwischen Patzern und Immersiegen.",
|
||||||
"DS4.ErrorSlayingDiceRecursionLimitExceeded": "Die maximale Rekursionstiefe für slayende Würfelwürfe wurde überschritten.",
|
"DS4.ErrorSlayingDiceRecursionLimitExceeded": "Die maximale Rekursionstiefe für slayende Würfelwürfe wurde überschritten.",
|
||||||
|
|
|
@ -211,7 +211,7 @@
|
||||||
"DS4.CreatureBaseInfoSizeCategory": "Size Category",
|
"DS4.CreatureBaseInfoSizeCategory": "Size Category",
|
||||||
"DS4.CreatureBaseInfoExperiencePoints": "Experience Points",
|
"DS4.CreatureBaseInfoExperiencePoints": "Experience Points",
|
||||||
"DS4.CreatureBaseInfoDescription": "Description",
|
"DS4.CreatureBaseInfoDescription": "Description",
|
||||||
"DS4.WarningManageActiveEffectOnOwnedItem": "Managing Active Effects within an Owned Item is not currently supported and will be added in a subsequent update.",
|
"DS4.WarningManageActiveEffectOnOwnedItem": "Managing Active Effects within an Owned Item is not currently supported and will be added in a subsequent update. If you actually want to manage the effect that has been transferred to the actor, you can do so in the 'Effects' tab in the actor sheet.",
|
||||||
"DS4.WarningActorCannotOwnItem": "The actor '{actorName}' of type '{actorType}' cannot own the item '{itemName}' of type '{itemType}'.",
|
"DS4.WarningActorCannotOwnItem": "The actor '{actorName}' of type '{actorType}' cannot own the item '{itemName}' of type '{itemType}'.",
|
||||||
"DS4.ErrorDiceCoupFumbleOverlap": "There is an overlap between Fumbles and Coups.",
|
"DS4.ErrorDiceCoupFumbleOverlap": "There is an overlap between Fumbles and Coups.",
|
||||||
"DS4.ErrorSlayingDiceRecursionLimitExceeded": "Maximum recursion depth for slaying dice roll exceeded.",
|
"DS4.ErrorSlayingDiceRecursionLimitExceeded": "Maximum recursion depth for slaying dice roll exceeded.",
|
||||||
|
|
|
@ -13,6 +13,11 @@ declare global {
|
||||||
|
|
||||||
type PromisedType<T> = T extends Promise<infer U> ? U : T;
|
type PromisedType<T> = T extends Promise<infer U> ? U : T;
|
||||||
export class DS4ActiveEffect extends ActiveEffect {
|
export class DS4ActiveEffect extends ActiveEffect {
|
||||||
|
/**
|
||||||
|
* A fallback icon that can be used if no icon is defined for the effect.
|
||||||
|
*/
|
||||||
|
static FALLBACK_ICON = "icons/svg/aura.svg";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A cached reference to the source document to avoid recurring database lookups
|
* A cached reference to the source document to avoid recurring database lookups
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
//
|
//
|
||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
import { DS4ActiveEffect } from "../../active-effect";
|
||||||
import { ModifiableDataBaseTotal } from "../../common/common-data";
|
import { ModifiableDataBaseTotal } from "../../common/common-data";
|
||||||
import { DS4 } from "../../config";
|
import { DS4 } from "../../config";
|
||||||
import { getCanvas, getGame } from "../../helpers";
|
import { getCanvas, getGame } from "../../helpers";
|
||||||
|
@ -49,6 +50,7 @@ export class DS4ActorSheet extends ActorSheet<ActorSheet.Options, DS4ActorSheetD
|
||||||
const enrichedEffectPromises = this.actor.effects.map(async (effect) => {
|
const enrichedEffectPromises = this.actor.effects.map(async (effect) => {
|
||||||
return {
|
return {
|
||||||
...effect.toObject(),
|
...effect.toObject(),
|
||||||
|
icon: effect.data.icon ?? DS4ActiveEffect.FALLBACK_ICON,
|
||||||
sourceName: await effect.getCurrentSourceName(),
|
sourceName: await effect.getCurrentSourceName(),
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue