diff --git a/CHANGELOG.md b/CHANGELOG.md index 5fb5d81..15793ea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,17 @@ +## Version 10.5 + +Fixed issue with Contested Rolls not responding to the ctrl or alt keys. + +Added the option for Contested Rolls to have the advantage and disadvantage buttons. + +Added the option to use the Meta key to target tokens using the tokenbar. + +Prevented players from double-clicking on tokens to request a roll if they aren't allowed to request rolls. + +Fixed incompatability with MidiQol. + +Fixed issue with Tormenta 20 system. Thank you Lander13 + ## Version 10.4 Fixed issue with contested roll not rendering the correct ids diff --git a/apps/contestedroll.js b/apps/contestedroll.js index 2ba53b7..28d953d 100644 --- a/apps/contestedroll.js +++ b/apps/contestedroll.js @@ -102,7 +102,8 @@ export class ContestedRollApp extends Application { rollmode: rollmode, modename: modename, tokens: msgEntries, - canGrab: MonksTokenBar.system.canGrab, //['dnd5e', 'sw5e'].includes(game.system.id), + canGrab: MonksTokenBar.system.canGrab, + showAdvantage: MonksTokenBar.system.showAdvantage, options: this.opts, what: 'contestedroll', }; @@ -318,7 +319,7 @@ export class ContestedRoll { e[k] = evt[k] || v; MonksTokenBar.system.parseKeys(e, keys); - promises.push(ContestedRoll._rollAbility({ id: id, uuid: msgtoken.uuid }, msgtoken.requests, rollmode, fastForward, evt, message.id)); + promises.push(ContestedRoll._rollAbility({ id: id, uuid: msgtoken.uuid }, msgtoken.requests, rollmode, fastForward, e, message.id)); } } }; diff --git a/apps/savingthrow.js b/apps/savingthrow.js index ccf49c4..53dffc1 100644 --- a/apps/savingthrow.js +++ b/apps/savingthrow.js @@ -514,8 +514,8 @@ export class SavingThrow { //roll the dice, using standard details from actor let keys = msgtoken.keys || {}; let e = Object.assign({}, evt); - e.ctrlKey = evt?.ctrlKey || $(evt?.originalEvent?.target).hasClass("disadvantage"); - e.altKey = evt?.altKey || $(evt?.originalEvent?.target).hasClass("advantage"); + e.ctrlKey = evt?.ctrlKey; + e.altKey = evt?.altKey; e.shiftKey = evt?.shiftKey; e.metaKey = evt?.metaKey; diff --git a/apps/tokenbar.js b/apps/tokenbar.js index 5724a5c..9b0fcba 100644 --- a/apps/tokenbar.js +++ b/apps/tokenbar.js @@ -632,7 +632,7 @@ export class TokenBar extends Application { if (!this.dbltimer) { this.dbltimer = window.setTimeout(async function () { if (that.doubleclick !== true) { - if (event?.originalEvent?.ctrlKey) { + if (event?.originalEvent?.ctrlKey || event?.originalEvent?.metaKey) { let token = canvas.tokens.get(entry?.id); if (!token) return; @@ -677,7 +677,7 @@ export class TokenBar extends Application { const li = event.currentTarget; const entry = this.tokens.find(t => t.id === li.dataset.tokenId); - if (setting("dblclick-action") == "request") { + if (setting("dblclick-action") == "request" && (game.user.isGM || setting("allow-roll"))) { let entries = MonksTokenBar.getTokenEntries([entry.token._object]); new SavingThrowApp(entries).render(true); } else { diff --git a/module.json b/module.json index 9b3a1e3..ff1ffc1 100644 --- a/module.json +++ b/module.json @@ -1,7 +1,7 @@ { "title": "Monk's TokenBar", "description": "Add a bar with all the current player tokens. Limit movement, roll saving throws, assign XP.", - "version": "10.4", + "version": "10.5", "authors": [ { "name": "IronMonk", @@ -64,7 +64,7 @@ "css/tokenbar.css" ], "url": "https://github.com/ironmonk88/monks-tokenbar", - "download": "https://github.com/ironmonk88/monks-tokenbar/archive/10.4.zip", + "download": "https://github.com/ironmonk88/monks-tokenbar/archive/10.5.zip", "manifest": "https://github.com/ironmonk88/monks-tokenbar/releases/latest/download/module.json", "bugs": "https://github.com/ironmonk88/monks-tokenbar/issues", "allowBugReporter": true, diff --git a/systems/dnd5e-rolls.js b/systems/dnd5e-rolls.js index 1587ca1..2dfa259 100644 --- a/systems/dnd5e-rolls.js +++ b/systems/dnd5e-rolls.js @@ -129,7 +129,7 @@ export class DnD5eRolls extends BaseRolls { roll({ id, actor, request, rollMode, fastForward = false, message }, callback, e) { let rollfn = null; - let options = { rollMode: rollMode, fastForward: fastForward, chatMessage: false, fromMars5eChatCard: true, event: e }; + let options = { rollMode: rollMode, fastForward: fastForward, chatMessage: false, fromMars5eChatCard: true, event: e, advantage: e.advantage, disadvantage: e.disadvantage }; let context = actor; let sysRequest = request.key; if (request.type == 'ability') { @@ -186,7 +186,9 @@ export class DnD5eRolls extends BaseRolls { } parseKeys(e, keys) { - e.ctrlKey = e.ctrlKey || keys.disadvantage; - e.altKey = e.altKey || keys.advantage; + e.advantage = $(e?.originalEvent?.target).hasClass("advantage"); + e.disadvantage = $(e?.originalEvent?.target).hasClass("disadvantage"); + e.ctrlKey = e.ctrlKey || keys.disadvantage || e.disadvantage; + e.altKey = e.altKey || keys.advantage || e.advantage; } } \ No newline at end of file diff --git a/templates/contestedrollchatmsg.html b/templates/contestedrollchatmsg.html index cb0708e..a454d36 100644 --- a/templates/contestedrollchatmsg.html +++ b/templates/contestedrollchatmsg.html @@ -25,7 +25,12 @@