onDrop depuis compendium async
Permettre de retrouver l'Item du compendium pour tester si un acteur peut le recevoir
This commit is contained in:
@ -1,4 +1,6 @@
|
||||
import { DialogSplitItem } from "./dialog-split-item.js";
|
||||
import { RdDItem } from "./item.js";
|
||||
import { SystemCompendiums } from "./settings/system-compendiums.js";
|
||||
|
||||
export class RdDSheetUtility {
|
||||
|
||||
@ -19,8 +21,11 @@ export class RdDSheetUtility {
|
||||
return $(event.currentTarget)?.parents(".item");
|
||||
}
|
||||
|
||||
static prepareItemDropParameters(destItemId, actor, dragData, objetVersConteneur) {
|
||||
const item = fromUuidSync(dragData.uuid)
|
||||
static async prepareItemDropParameters(destItemId, actor, dragData, objetVersConteneur) {
|
||||
let item = fromUuidSync(dragData.uuid);
|
||||
if (item.pack && !item.system){
|
||||
item = await RdDItem.getCorrespondingItem(item);
|
||||
}
|
||||
if (actor.canReceive(item)) {
|
||||
return {
|
||||
destId: destItemId,
|
||||
|
Reference in New Issue
Block a user