Skip to content

Commit

Permalink
Merge branch 'eran-macro-speakers' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Eranziel committed Sep 3, 2021
2 parents 2546f13 + b27d9d5 commit 1dbc01e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
4 changes: 3 additions & 1 deletion src/module/actor/lancer-actor-sheet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,9 @@ export class LancerActorSheet<T extends LancerActorType> extends ActorSheet<
if (!item) return ui.notifications!.warn(`Error rolling macro: Couldn't find weapon with ID ${weaponId}.`);

const weapon = item;
prepareItemMacro(this.actor.id!, weapon.id!);
// @ts-ignore
let id = this.token ? this.token.id : this.actor.id!;
prepareItemMacro(id, weapon.id!);
});

// TODO: This should really just be a single item-macro class
Expand Down
13 changes: 9 additions & 4 deletions src/module/actor/npc-sheet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@ export class LancerNPCSheet extends LancerActorSheet<EntryType.NPC> {
ev.stopPropagation(); // Avoids triggering parent event handlers

const el = $(ev.currentTarget).closest(".item")[0] as HTMLElement;

prepareItemMacro(this.actor.id!, <string>el.getAttribute("data-id")).then();
// @ts-ignore
let id = this.token ? this.token.id : this.actor.id!;
prepareItemMacro(id, <string>el.getAttribute("data-id")).then();
});

// Stat rollers
Expand All @@ -74,8 +75,10 @@ export class LancerNPCSheet extends LancerActorSheet<EntryType.NPC> {
bonus: statInput.value,
};

// @ts-ignore
let id = this.token ? this.token.id : this.actor.id!;
console.log(`${lp} Rolling ${mData.title} check, bonus: ${mData.bonus}`);
prepareStatMacro(this.actor.id!, this.getStatPath(ev)!);
prepareStatMacro(id, this.getStatPath(ev)!);
});

// Trigger rollers
Expand All @@ -88,7 +91,9 @@ export class LancerNPCSheet extends LancerActorSheet<EntryType.NPC> {
ev.stopPropagation();
const techElement = $(ev.currentTarget).closest(".item")[0] as HTMLElement;
let techId = techElement.getAttribute("data-id");
prepareItemMacro(this.actor.id!, techId!);
// @ts-ignore
let id = this.token ? this.token.id : this.actor.id!;
prepareItemMacro(id, techId!);
});

// Item/Macroable Dragging
Expand Down

0 comments on commit 1dbc01e

Please sign in to comment.