From d7fb8fd61a64f16f5e6bf722efdfba9ecb46ad50 Mon Sep 17 00:00:00 2001 From: Johannes Loher Date: Sun, 21 Feb 2021 04:09:48 +0100 Subject: [PATCH] use notification wrapper --- src/module/actor/sheets/actor-sheet.ts | 3 ++- src/module/item/item-sheet.ts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/module/actor/sheets/actor-sheet.ts b/src/module/actor/sheets/actor-sheet.ts index 5860e5d..1534131 100644 --- a/src/module/actor/sheets/actor-sheet.ts +++ b/src/module/actor/sheets/actor-sheet.ts @@ -2,6 +2,7 @@ import { ModifiableMaybeData } from "../../common/common-data"; import { DS4 } from "../../config"; import { DS4Item } from "../../item/item"; import { DS4ItemData } from "../../item/item-data"; +import notifications from "../../ui/notifications"; import { DS4Actor } from "../actor"; /** @@ -257,7 +258,7 @@ export class DS4ActorSheet extends ActorSheet> { ): Promise> { const item = await DS4Item.fromDropData(data); if (item && !this.actor.canOwnItemType(item.data.type)) { - ui.notifications?.warn( + notifications.warn( game.i18n.format("DS4.WarningActorCannotOwnItem", { actorName: this.actor.name, actorType: this.actor.data.type, diff --git a/src/module/item/item-sheet.ts b/src/module/item/item-sheet.ts index 8cd2c32..924a0dd 100644 --- a/src/module/item/item-sheet.ts +++ b/src/module/item/item-sheet.ts @@ -1,4 +1,5 @@ import { DS4 } from "../config"; +import notifications from "../ui/notifications"; import { DS4Item } from "./item"; import { isDS4ItemDataTypePhysical } from "./item-data"; @@ -82,7 +83,7 @@ export class DS4ItemSheet extends ItemSheet> { event.preventDefault(); if (this.item.isOwned) { - return ui.notifications?.warn(game.i18n.localize("DS4.WarningManageActiveEffectOnOwnedItem")); + return notifications.warn(game.i18n.localize("DS4.WarningManageActiveEffectOnOwnedItem")); } const a = event.currentTarget; const li = $(a).parents(".effect");