From 76a08766f0a2c0584e3c2a7a830442baba539044 Mon Sep 17 00:00:00 2001 From: Werner Date: Sun, 22 Jan 2023 21:58:43 +0100 Subject: [PATCH] disable fail buttons for midi until midi has patched issue --- src/lmrtfy.js | 7 ++++++- src/roller.js | 47 ++++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 48 insertions(+), 6 deletions(-) diff --git a/src/lmrtfy.js b/src/lmrtfy.js index 69f2007..872babf 100644 --- a/src/lmrtfy.js +++ b/src/lmrtfy.js @@ -222,7 +222,12 @@ class LMRTFY { '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' + '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"/>' + '' + - '' + ''; + + // for now we don't allow can fails until midi-qol has update patching.js + if (game.modules.get('midi-qol')) { + LMRTFY.canFailChecks = false; + } if (game.settings.get('lmrtfy', 'deselectOnRequestorRender')) { Hooks.on("renderLMRTFYRequestor", () => { diff --git a/src/roller.js b/src/roller.js index bae0792..51421d7 100644 --- a/src/roller.js +++ b/src/roller.js @@ -471,14 +471,26 @@ class LMRTFYRoller extends Application { event.preventDefault(); const ability = event.currentTarget.dataset.ability; if (game.system.id === 'pf2e') this.pf2Roll = this.pf2eRollFor.ABILITY; - this._makeRoll(event, LMRTFY.abilityRollMethod, false, ability); + + // for now we don't allow can fails until midi-qol has update patching.js + if (game.modules.get('midi-qol')) { + this._makeRoll(event, LMRTFY.abilityRollMethod, ability); + } else { + this._makeRoll(event, LMRTFY.abilityRollMethod, false, ability); + } } _onFailAbilityCheck(event) { event.preventDefault(); const ability = event.currentTarget.dataset.ability; if (game.system.id === 'pf2e') this.pf2Roll = this.pf2eRollFor.ABILITY; - this._makeRoll(event, LMRTFY.abilityRollMethod, true, ability); + + // for now we don't allow can fails until midi-qol has update patching.js + if (game.modules.get('midi-qol')) { + this._makeRoll(event, LMRTFY.abilityRollMethod, ability); + } else { + this._makeRoll(event, LMRTFY.abilityRollMethod, true, ability); + } } _onAbilitySave(event) { @@ -486,27 +498,52 @@ class LMRTFYRoller extends Application { const saves = event.currentTarget.dataset.ability; if (game.system.id === 'pf2e') this.pf2Roll = this.pf2eRollFor.SAVE; this._makeRoll(event, LMRTFY.saveRollMethod, false, saves); + + // for now we don't allow can fails until midi-qol has update patching.js + if (game.modules.get('midi-qol')) { + this._makeRoll(event, LMRTFY.saveRollMethod, saves); + } else { + this._makeRoll(event, LMRTFY.saveRollMethod, false, saves); + } } _onFailAbilitySave(event) { event.preventDefault(); const saves = event.currentTarget.dataset.ability; if (game.system.id === 'pf2e') this.pf2Roll = this.pf2eRollFor.SAVE; - this._makeRoll(event, LMRTFY.saveRollMethod, true, saves); + + // for now we don't allow can fails until midi-qol has update patching.js + if (game.modules.get('midi-qol')) { + this._makeRoll(event, LMRTFY.saveRollMethod, saves); + } else { + this._makeRoll(event, LMRTFY.saveRollMethod, true, saves); + } } _onSkillCheck(event) { event.preventDefault(); const skill = event.currentTarget.dataset.skill; if (game.system.id === 'pf2e') this.pf2Roll = this.pf2eRollFor.SKILL; - this._makeRoll(event, LMRTFY.skillRollMethod, false, skill); + + // for now we don't allow can fails until midi-qol has update patching.js + if (game.modules.get('midi-qol')) { + this._makeRoll(event, LMRTFY.skillRollMethod, skill); + } else { + this._makeRoll(event, LMRTFY.skillRollMethod, false, skill); + } } _onFailSkillCheck(event) { event.preventDefault(); const skill = event.currentTarget.dataset.skill; if (game.system.id === 'pf2e') this.pf2Roll = this.pf2eRollFor.SKILL; - this._makeRoll(event, LMRTFY.skillRollMethod, true, skill); + + // for now we don't allow can fails until midi-qol has update patching.js + if (game.modules.get('midi-qol')) { + this._makeRoll(event, LMRTFY.skillRollMethod, skill); + } else { + this._makeRoll(event, LMRTFY.skillRollMethod, true, skill); + } } async _onCustomFormula(event) {