#7 - Manage container
This commit is contained in:
@@ -382,4 +382,16 @@ export class SoSUtility extends Entity {
|
||||
defender.applyWounds( flipData );
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static async processItemDropEvent(actorSheet, event) {
|
||||
let dragData = JSON.parse(event.dataTransfer.getData("text/plain"));
|
||||
let dropID = $(event.target).parents(".item").attr("data-item-id"); // Only relevant if container drop
|
||||
let objectID = dragData.id || dragData.data._id;
|
||||
//console.log("drag/drop", dragData, actorSheet.actor._id, dropID, objectID);
|
||||
if (dragData.type == 'Item' && dropID) {
|
||||
actorSheet.actor.addObjectToContainer(objectID, dropID );
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user