diff --git a/lang/en.json b/lang/en.json index 9407d95..ef8a8d8 100644 --- a/lang/en.json +++ b/lang/en.json @@ -74,5 +74,6 @@ "LMRTFY.DemonLordBoonsNote": "These rolls will be made with boons.", "LMRTFY.DemonLordBanesNote": "These rolls will be made with banes.", "LMRTFY.DemonLordAddMod": "Additional modifier:", - "LMRTFY.DemonLordNoCombat": "You are not in combat!" + "LMRTFY.DemonLordNoCombat": "You are not in combat!", + "LMRTFY.DemonLordNoBoonsBanes": "No Boons/Banes" } diff --git a/src/requestor.js b/src/requestor.js index 897d0a2..c2180ae 100644 --- a/src/requestor.js +++ b/src/requestor.js @@ -117,6 +117,7 @@ class LMRTFYRequestor extends FormApplication { this.element.find(".lmrtfy-bonus-button").click(this.bonusClick.bind(this)); this.element.find(".lmrtfy-formula-ability").click(this.modifierClick.bind(this)); this.element.find(".lmrtfy-clear-formula").click(this.clearCustomFormula.bind(this)); + if ((game.system.id) === "demonlord") this.element.find(".demonlord").change(this.clearDemonLordSettings.bind(this)); this._onUserChange(); } @@ -296,6 +297,18 @@ class LMRTFYRequestor extends FormApplication { this.combineFormula(); } + clearDemonLordSettings() { + if (($("#advantage").val() === "-1") || ($("#advantage").val() === "1")) { + $("#BBDice").prop('disabled', false); + $("#AddMod").prop('disabled', false); + } else { + $("#AddMod").val("0"); + $("#BBDice").val("0"); + $("#BBDice").prop('disabled', true); + $("#AddMod").prop('disabled', true); + } + } + async _updateObject(event, formData) { //console.log("LMRTFY submit: ", formData) const saveAsMacro = $(event.currentTarget).hasClass("lmrtfy-save-roll") diff --git a/templates/demonlord-request-rolls.html b/templates/demonlord-request-rolls.html index 2f875db..3d35e9f 100644 --- a/templates/demonlord-request-rolls.html +++ b/templates/demonlord-request-rolls.html @@ -38,7 +38,7 @@
- @@ -62,8 +62,8 @@
- + @@ -74,7 +74,7 @@
- @@ -136,41 +136,51 @@
-
+
- - - + + + -
+
- - - + + +
- - - + + +