Sync
This commit is contained in:
@ -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) {
|
||||
|
Reference in New Issue
Block a user