Skip to content

Commit

Permalink
Pick only the first initiative match for quickroll
Browse files Browse the repository at this point in the history
Prevents double rolls from happening on click since the selector
will match the digital dice button as well as the modifier span inside of it
Closes #1154
  • Loading branch information
kakaroto committed Jul 26, 2024
1 parent 361d36c commit 076f120
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/dndbeyond/content-scripts/character.js
Original file line number Diff line number Diff line change
Expand Up @@ -2312,7 +2312,7 @@ function deactivateQuickRolls() {
const spells = $(".ct-spells-spell .ct-spells-spell__action,.ddbc-spells-spell .ddbc-spells-spell__action");
const spells_to_hit = $(".ct-spells-spell .ct-spells-spell__tohit .integrated-dice__container, .ddbc-spells-spell .ddbc-spells-spell__tohit .integrated-dice__container");
const spells_damage = $(".ct-spells-spell .ct-spells-spell__damage .integrated-dice__container, .ddc-spells-spell .ddc-spells-spell__damage .integrated-dice__container");
const initiative = $(".ct-combat__summary-group--initiative .integrated-dice__container, .ct-combat__summary-group--initiative span[class*='styles_numberDisplay'], .ct-combat-tablet__extra--initiative .integrated-dice__container, .ct-combat-tablet__extra--initiative span[class*='styles_numberDisplay'], .ct-combat-mobile__extras > section[class*='styles_boxMobile'] .integrated-dice__container, .ct-combat-mobile__extras > section[class*='styles_boxMobile'] span[class*='styles_numberDisplay']");
const initiative = $(".ct-combat__summary-group--initiative .integrated-dice__container, .ct-combat__summary-group--initiative span[class*='styles_numberDisplay'], .ct-combat-tablet__extra--initiative .integrated-dice__container, .ct-combat-tablet__extra--initiative span[class*='styles_numberDisplay'], .ct-combat-mobile__extras > section[class*='styles_boxMobile'] .integrated-dice__container, .ct-combat-mobile__extras > section[class*='styles_boxMobile'] span[class*='styles_numberDisplay']").eq(0);

hideTooltipIfDestroyed();
deactivateTooltipListeners(initiative);
Expand Down

0 comments on commit 076f120

Please sign in to comment.