async _toggleTokenLink(event) {
const isLinked = this.actor.prototypeToken.actorLink;
console.log(event);
// Update the actor
await this.actor.prototypeToken.update({ actorLink: !(isLinked) });
// Update the button
event.button.title = localize(isLinked ? 'tokenIsLinkedToActor' : 'tokenIsUnlinkedFromActor');
event.button.icon = isLinked ? LINKED_ICON : UNLINKED_ICON;
return event.button;
}
async _toggleTokenLink(event) {
const isLinked = this.actor.prototypeToken.actorLink;
console.log(event);
// Update the actor
await this.actor.prototypeToken.update({ actorLink: !(isLinked) });
// Update the button
event.button.title = localize(isLinked ? 'tokenIsLinkedToActor' : 'tokenIsUnlinkedFromActor');
event.button.icon = isLinked ? LINKED_ICON : UNLINKED_ICON;
return event.button;
}