Skip to content

Commit

Permalink
11.15 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ironmonk88 committed Mar 6, 2024
1 parent 3935af9 commit c212d92
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 13 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 4 additions & 2 deletions apps/contestedroll.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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;
Expand Down
6 changes: 4 additions & 2 deletions apps/savingthrow.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions module.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -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,
Expand Down
12 changes: 6 additions & 6 deletions monks-tokenbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -1529,15 +1529,15 @@ 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);
}
}
else
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(':');
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -1680,15 +1680,15 @@ 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);
}
}
else
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(':');
Expand Down
1 change: 0 additions & 1 deletion templates/contestedrollchatmsg.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ <h4 class="noselect">
</a>
</div>
</div>
<div class="dice-tooltip" style="display:none;"></div>
</div>
</div>
</li>
Expand Down

0 comments on commit c212d92

Please sign in to comment.