Skip to content

Commit

Permalink
a
Browse files Browse the repository at this point in the history
  • Loading branch information
theripper93 committed Jan 29, 2025
1 parent 165b081 commit 7a23554
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion index.js.map

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions scripts/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,7 @@ export function initConfig() {

async _onLeftClick(event) {
ui.ARGON.interceptNextDialog(event.currentTarget);
const used = await this.item.use({ event, legacy: false }, { event });
const used = await this.item.use({event, legacy: false}, {event});
if (used) {
DND5eItemButton.consumeActionEconomy(this.activity);
const useOtherItem = this.activity?.consumption?.targets?.find(t => t.type === "itemUses");
Expand All @@ -797,14 +797,14 @@ export function initConfig() {
this.activity?.sheet?.render(true);
}

static consumeActionEconomy(item) {
const activationType = getActivationType(item);
static consumeActionEconomy(activity) {
const activationType = activity?.activation?.type;
let actionType = null;
for (const [type, types] of Object.entries(actionTypes)) {
if (types.includes(activationType)) actionType = type;
}
if (!actionType) return;
if (game.combat?.combatant?.actor !== item.parent) actionType = "reaction";
if (game.combat?.combatant?.actor !== activity.item.parent) actionType = "reaction";
if (actionType === "action") {
ui.ARGON.components.main[0].isActionUsed = true;
ui.ARGON.components.main[0].updateActionUse();
Expand Down

0 comments on commit 7a23554

Please sign in to comment.