Simplify handling of optional values in a couple of places

This commit is contained in:
Johannes Loher 2021-02-18 13:36:36 +01:00
parent 24d8926645
commit b2490a2e2f
2 changed files with 5 additions and 7 deletions

View file

@ -73,11 +73,9 @@ export class DS4ActorSheet extends ActorSheet<ActorSheet.Data<DS4Actor>> {
}
protected _getTooltipForValue(value: ModifiableMaybeData<number | null>): string {
return `${value.base ?? 0} (${game.i18n.localize("DS4.TooltipBaseValue")}) + ${
value.mod ?? 0
} (${game.i18n.localize("DS4.TooltipModifier")}) ${game.i18n.localize("DS4.TooltipEffects")} ${
value.total ?? 0
}`;
return `${value.base} (${game.i18n.localize("DS4.TooltipBaseValue")}) + ${value.mod} (${game.i18n.localize(
"DS4.TooltipModifier",
)}) ${game.i18n.localize("DS4.TooltipEffects")} ${value.total}`;
}
/** @override */