This commit is contained in:
2022-01-12 16:25:55 +01:00
parent 3384157580
commit adcb4a49c9
11 changed files with 134 additions and 41 deletions

View File

@ -65,6 +65,7 @@ export class PegasusItemSheet extends ItemSheet {
limited: this.object.limited,
options: this.options,
owner: this.document.isOwner,
mr: (this.object.type == 'specialisation'),
isGM: game.user.isGM
}
@ -338,10 +339,31 @@ export class PegasusItemSheet extends ItemSheet {
}
}
}
/* -------------------------------------------- */
async addEffectSpec( event, item, dataItem) {
let newItem = duplicate(item.data);
if ( event.toElement.className == 'drop-effect-spec') {
let specArray = duplicate(this.object.data.data.recoveryrollspec);
specArray.push( newItem );
await this.object.update( { 'data.recoveryrollspec': specArray} );
}
}
/* -------------------------------------------- */
async _onDrop(event) {
//console.log(event);
if (this.object.type == 'effect' ) {
let data = event.dataTransfer.getData('text/plain');
if (data) {
let dataItem = JSON.parse( data );
let item = await this.searchItem( dataItem);
if ( item.data.type == 'specialisation') {
return this.addEffectSpec( event, item, dataItem);
}
}
}
if (this.object.type == 'race' ) {
let data = event.dataTransfer.getData('text/plain');
if (data) {