Skip to content

Commit

Permalink
feat: Adds support for shift-clicking to bring up, or skip, the roll …
Browse files Browse the repository at this point in the history
…dialog depending on user setting, and control-clicking to make roll secret in Basic Action Macros. With these caveats: For the buttons with names ending in '(toggle)' shift and control works as for effects, recall knowledge is *always* secret and the macro used does not currently support shift-clicking, for craft and repair neither works as the macro in question doesn't seem to support them.
  • Loading branch information
xdy committed Dec 31, 2022
1 parent 769cffc commit f8539b1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/module/feature/macros/basicActionMacros.ts
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ ${actionList
},
default: "close",
render: (html) => {
const action = (button) => {
const action = (button, event) => {
const action = actionList[button.dataset.action];
const current = action.action;
if (typeof current === "string") {
Expand All @@ -467,12 +467,12 @@ ${actionList
}
} else {
// @ts-ignore
action.action({ actors: [selectedActor] });
action.action({ event: event, actors: [selectedActor] });
}
};
if ("querySelectorAll" in html) {
html.querySelectorAll(".action-list button").forEach((button) =>
button.addEventListener("click", () => action(button))
button.addEventListener("click", (event) => action(button, event))
);
}
},
Expand Down

0 comments on commit f8539b1

Please sign in to comment.