Add drag & drop support for effects between different sheets

Also refactor some effect related functionality into the DS4ActiveEffect class
This commit is contained in:
Johannes Loher 2021-08-19 03:04:40 +02:00
parent b1d0810100
commit 1e7368875c
5 changed files with 60 additions and 29 deletions

View file

@ -4,6 +4,7 @@
//
// SPDX-License-Identifier: MIT
import { DS4ActiveEffect } from "../active-effect";
import { DS4 } from "../config";
import { getGame } from "../helpers";
import notifications from "../ui/notifications";
@ -97,14 +98,8 @@ export class DS4ItemSheet extends ItemSheet<ItemSheet.Options, DS4ItemSheetData>
/**
* Create a new ActiveEffect for the item using default data.
*/
protected async createActiveEffect(): Promise<ActiveEffect | undefined> {
const createData = {
label: getGame().i18n.localize(`DS4.NewEffectLabel`),
icon: "icons/svg/aura.svg",
origin: this.item.uuid,
};
return ActiveEffect.create(createData, { parent: this.item });
protected createActiveEffect(): void {
DS4ActiveEffect.createDefault({ parent: this.item });
}
}