diff --git a/CHANGELOG.md b/CHANGELOG.md index 08d714d..8931111 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## Version 11.15 + +Fixing MATT integration, setting the current tokens with the tokens that were selected. + +Fixing 5e 3.0 issues that were introduced by system changes. + ## Version 11.14 Fixing spacing issues diff --git a/apps/contestedroll.js b/apps/contestedroll.js index 92abeda..d363708 100644 --- a/apps/contestedroll.js +++ b/apps/contestedroll.js @@ -65,7 +65,7 @@ export class ContestedRollApp extends Application { this.render(true); } - async requestRoll(roll) { + async requestRoll(roll, evt) { let msg = null; if (this.entries[0].token != undefined && this.entries[1].token != undefined) { let msgEntries = this.entries.map((item, index) => { @@ -166,7 +166,7 @@ export class ContestedRollApp extends Application { msg.setFlag('monks-tokenbar', 'active-tiles', this['active-tiles']); if (roll === true) - ContestedRoll.onRollAll('all', msg, this.opts); + ContestedRoll.onRollAll('all', msg, evt); else { let ids = this.entries.filter(e => e.fastForward).map(e => e.id); if (ids.length > 0) @@ -365,6 +365,8 @@ export class ContestedRoll { //roll the dice, using standard details from actor let keys = msgtoken.keys || {}; let e = Object.assign({}, evt); + if (!e.target) + e.target = evt.target; e.ctrlKey = evt?.ctrlKey; e.altKey = evt?.altKey; e.shiftKey = evt?.shiftKey; diff --git a/apps/savingthrow.js b/apps/savingthrow.js index cee3b5b..0e4e48e 100644 --- a/apps/savingthrow.js +++ b/apps/savingthrow.js @@ -188,7 +188,7 @@ export class SavingThrowApp extends Application { window.setTimeout(() => { this.setPosition({ height: 'auto' }); }, 100); } - async requestRoll(roll) { + async requestRoll(roll, evt) { let msg = null; if (this.entries.length > 0) { SavingThrow.lastTokens = this.entries.map(e => { @@ -362,7 +362,7 @@ export class SavingThrowApp extends Application { msg.setFlag('monks-tokenbar', 'active-tiles', this['active-tiles']); if (roll === true) - SavingThrow.onRollAll('all', msg, this.opts); + SavingThrow.onRollAll('all', msg, evt); else { let ids = this.entries.filter(e => e.fastForward).map(e => e.id); if (ids.length > 0) @@ -699,6 +699,8 @@ export class SavingThrow { //roll the dice, using standard details from actor let keys = msgtoken.keys || {}; let e = Object.assign({}, evt); + if (!e.target) + e.target = evt.target; e.ctrlKey = evt?.ctrlKey; e.altKey = evt?.altKey; e.shiftKey = evt?.shiftKey; diff --git a/module.json b/module.json index 582ce05..4b21cc0 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": "11.14", + "version": "11.15", "authors": [ { "name": "IronMonk", @@ -77,7 +77,7 @@ "css/tokenbar.css" ], "url": "https://github.com/ironmonk88/monks-tokenbar", - "download": "https://github.com/ironmonk88/monks-tokenbar/archive/11.14.zip", + "download": "https://github.com/ironmonk88/monks-tokenbar/archive/11.15.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/monks-tokenbar.js b/monks-tokenbar.js index ad2465b..cab331d 100644 --- a/monks-tokenbar.js +++ b/monks-tokenbar.js @@ -1484,7 +1484,7 @@ Hooks.on("setupTileActions", (app) => { }, group: 'monks-tokenbar', fn: async (args = {}) => { - const { action, tile, tokens, userid, value, method, change } = args; + const { action, tile, tokens, userid, value, method, change, event } = args; let entities = await game.MonksActiveTiles.getEntities(args); //if (entities.length == 0) @@ -1529,7 +1529,7 @@ Hooks.on("setupTileActions", (app) => { if (action.data.fastforward === true) { //need to delay slightly so the original action has time to save a state properly. window.setTimeout(function () { - SavingThrow.onRollAll('all', msg); + SavingThrow.onRollAll('all', msg, event.nativeEvent); }, 100); } } @@ -1537,7 +1537,7 @@ Hooks.on("setupTileActions", (app) => { savingthrow.render(true); //if we got here then we need to pause before continuing and wait until the request has been fulfilled - return { pause: true }; + return { pause: true, tokens: entities }; }, content: async (trigger, action) => { let parts = action.data?.request.split(':'); @@ -1632,7 +1632,7 @@ Hooks.on("setupTileActions", (app) => { }, group: 'monks-tokenbar', fn: async (args = {}) => { - const { action, tile, tokens, userid, value, method, change } = args; + const { action, tile, tokens, userid, value, method, change, event } = args; let entities1 = await game.MonksActiveTiles.getEntities(args, "tokens", action.data.entity1); let entities2 = await game.MonksActiveTiles.getEntities(args, "tokens", action.data.entity2); @@ -1680,7 +1680,7 @@ Hooks.on("setupTileActions", (app) => { if (action.data.fastforward === true) { //need to delay slightly so the original action has time to save a state properly. window.setTimeout(function () { - ContestedRoll.onRollAll('all', msg); + ContestedRoll.onRollAll('all', msg, event); }, 100); } } @@ -1688,7 +1688,7 @@ Hooks.on("setupTileActions", (app) => { contested.render(true); //if we got here then we need to pause before continuing and wait until the request has been fulfilled - return { pause: true }; + return { pause: true, tokens: [entity1, entity2] }; }, content: async (trigger, action) => { let parts = action.data?.request1.split(':'); diff --git a/templates/contestedrollchatmsg.html b/templates/contestedrollchatmsg.html index 448eb49..115fb46 100644 --- a/templates/contestedrollchatmsg.html +++ b/templates/contestedrollchatmsg.html @@ -34,7 +34,6 @@

-