Prepared: reverse on right-click
This commit is contained in:
@@ -122,17 +122,18 @@ export default class HooksL5r5e {
|
|||||||
.then(() => HooksL5r5e._gmCombatBar(app, html, data));
|
.then(() => HooksL5r5e._gmCombatBar(app, html, data));
|
||||||
});
|
});
|
||||||
|
|
||||||
html.find(".prepared-control").on("click", (event) => {
|
html.find(".prepared-control").on("mousedown", (event) => {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
const preparedId = $(event.currentTarget).data("id");
|
const preparedId = $(event.currentTarget).data("id");
|
||||||
if (!Object.hasOwnProperty.call(prepared, preparedId)) {
|
if (!Object.hasOwnProperty.call(prepared, preparedId)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
const rev = event.which === 3;
|
||||||
const nextValue = {
|
const nextValue = {
|
||||||
false: "true",
|
false: rev ? "true" : "null",
|
||||||
true: "null",
|
true: rev ? "null" : "false",
|
||||||
null: "false",
|
null: rev ? "false" : "true",
|
||||||
};
|
};
|
||||||
game.settings
|
game.settings
|
||||||
.set("l5r5e", `initiative.prepared.${preparedId}`, nextValue[prepared[preparedId]])
|
.set("l5r5e", `initiative.prepared.${preparedId}`, nextValue[prepared[preparedId]])
|
||||||
|
|||||||
Reference in New Issue
Block a user