Skip to content

Commit 75888a4

Browse files
authored
Merge pull request #170 from vtt-lair/feat/fail_buttons
disable fail buttons for midi until midi has patched issue
2 parents 8582ad2 + 76a0876 commit 75888a4

File tree

2 files changed

+48
-6
lines changed

2 files changed

+48
-6
lines changed

src/lmrtfy.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,12 @@ class LMRTFY {
222222
'M258.3,421.9l19.7,11.2c0.3,0.2,0.3,0.1,0.3-0.2l-0.4-7.9c0-0.3,0-0.4-0.3-0.4L258.3,421.9L258.3,421.9z M299.1,421.9l-20,2.8' +
223223
'c-0.3,0-0.2,0.2-0.2,0.4l0.4,8c0,0.2,0,0.3,0.3,0.2L299.1,421.9z"/>' +
224224
'</g>' +
225-
'</svg>'
225+
'</svg>';
226+
227+
// for now we don't allow can fails until midi-qol has update patching.js
228+
if (game.modules.get('midi-qol')) {
229+
LMRTFY.canFailChecks = false;
230+
}
226231

227232
if (game.settings.get('lmrtfy', 'deselectOnRequestorRender')) {
228233
Hooks.on("renderLMRTFYRequestor", () => {

src/roller.js

Lines changed: 42 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -471,42 +471,79 @@ class LMRTFYRoller extends Application {
471471
event.preventDefault();
472472
const ability = event.currentTarget.dataset.ability;
473473
if (game.system.id === 'pf2e') this.pf2Roll = this.pf2eRollFor.ABILITY;
474-
this._makeRoll(event, LMRTFY.abilityRollMethod, false, ability);
474+
475+
// for now we don't allow can fails until midi-qol has update patching.js
476+
if (game.modules.get('midi-qol')) {
477+
this._makeRoll(event, LMRTFY.abilityRollMethod, ability);
478+
} else {
479+
this._makeRoll(event, LMRTFY.abilityRollMethod, false, ability);
480+
}
475481
}
476482

477483
_onFailAbilityCheck(event) {
478484
event.preventDefault();
479485
const ability = event.currentTarget.dataset.ability;
480486
if (game.system.id === 'pf2e') this.pf2Roll = this.pf2eRollFor.ABILITY;
481-
this._makeRoll(event, LMRTFY.abilityRollMethod, true, ability);
487+
488+
// for now we don't allow can fails until midi-qol has update patching.js
489+
if (game.modules.get('midi-qol')) {
490+
this._makeRoll(event, LMRTFY.abilityRollMethod, ability);
491+
} else {
492+
this._makeRoll(event, LMRTFY.abilityRollMethod, true, ability);
493+
}
482494
}
483495

484496
_onAbilitySave(event) {
485497
event.preventDefault();
486498
const saves = event.currentTarget.dataset.ability;
487499
if (game.system.id === 'pf2e') this.pf2Roll = this.pf2eRollFor.SAVE;
488500
this._makeRoll(event, LMRTFY.saveRollMethod, false, saves);
501+
502+
// for now we don't allow can fails until midi-qol has update patching.js
503+
if (game.modules.get('midi-qol')) {
504+
this._makeRoll(event, LMRTFY.saveRollMethod, saves);
505+
} else {
506+
this._makeRoll(event, LMRTFY.saveRollMethod, false, saves);
507+
}
489508
}
490509

491510
_onFailAbilitySave(event) {
492511
event.preventDefault();
493512
const saves = event.currentTarget.dataset.ability;
494513
if (game.system.id === 'pf2e') this.pf2Roll = this.pf2eRollFor.SAVE;
495-
this._makeRoll(event, LMRTFY.saveRollMethod, true, saves);
514+
515+
// for now we don't allow can fails until midi-qol has update patching.js
516+
if (game.modules.get('midi-qol')) {
517+
this._makeRoll(event, LMRTFY.saveRollMethod, saves);
518+
} else {
519+
this._makeRoll(event, LMRTFY.saveRollMethod, true, saves);
520+
}
496521
}
497522

498523
_onSkillCheck(event) {
499524
event.preventDefault();
500525
const skill = event.currentTarget.dataset.skill;
501526
if (game.system.id === 'pf2e') this.pf2Roll = this.pf2eRollFor.SKILL;
502-
this._makeRoll(event, LMRTFY.skillRollMethod, false, skill);
527+
528+
// for now we don't allow can fails until midi-qol has update patching.js
529+
if (game.modules.get('midi-qol')) {
530+
this._makeRoll(event, LMRTFY.skillRollMethod, skill);
531+
} else {
532+
this._makeRoll(event, LMRTFY.skillRollMethod, false, skill);
533+
}
503534
}
504535

505536
_onFailSkillCheck(event) {
506537
event.preventDefault();
507538
const skill = event.currentTarget.dataset.skill;
508539
if (game.system.id === 'pf2e') this.pf2Roll = this.pf2eRollFor.SKILL;
509-
this._makeRoll(event, LMRTFY.skillRollMethod, true, skill);
540+
541+
// for now we don't allow can fails until midi-qol has update patching.js
542+
if (game.modules.get('midi-qol')) {
543+
this._makeRoll(event, LMRTFY.skillRollMethod, skill);
544+
} else {
545+
this._makeRoll(event, LMRTFY.skillRollMethod, true, skill);
546+
}
510547
}
511548

512549
async _onCustomFormula(event) {

0 commit comments

Comments
 (0)