Skip to content

Commit

Permalink
12.04
Browse files Browse the repository at this point in the history
  • Loading branch information
ironmonk88 committed Oct 31, 2024
1 parent f8f6303 commit 9b66b20
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 21 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## Version 12.04

Fix issue with code to fix a DSD issue.

Fixed issue with strange repositioning bug.

Attempting to cut down on the number of people having issues while using an older version of D&D.

## Version 12.03

Tried to fix the issue with Dice So Nice not revealing roll.
Expand Down
14 changes: 1 addition & 13 deletions apps/tokenbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,15 +159,6 @@ export class TokenBar extends Application {
game.user.setFlag("monks-tokenbar", "position", this.pos);
}

let checkLeft = Math.clamp(this.pos.left, 0, window.innerWidth - 200);
let checkTop = Math.clamp(this.pos.top, 0, window.innerHeight - 20);

if (checkLeft != this.pos.left || checkTop != this.pos.top) {
this.pos.left = checkLeft;
this.pos.top = checkTop;
game.user.setFlag("monks-tokenbar", "position", this.pos);
}

let result = '';
if (this.pos != undefined) {
result = Object.entries(this.pos).filter(k => {
Expand Down Expand Up @@ -494,7 +485,7 @@ export class TokenBar extends Application {
super.activateListeners(html);

if (game.user.isGM) {
for (let group of this.buttons) {
for (let group of (this.buttons || [])) {
for (let button of group) {
if (button.click)
$('#' + button.id).on('click', $.proxy(button.click, this));
Expand Down Expand Up @@ -573,9 +564,6 @@ export class TokenBar extends Application {
//else
position.left = xPos;// + 1;

position.left = Math.clamp(position.left, 0, window.innerWidth - 200);
position.top = Math.clamp(position.top, 0, window.innerHeight - 20);


elmnt.style.bottom = (position.bottom ? position.bottom + "px" : null);
elmnt.style.right = (position.right ? position.right + "px" : null);
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": "12.03",
"version": "12.04",
"authors": [
{
"name": "IronMonk",
Expand Down Expand Up @@ -82,7 +82,7 @@
"css/tokenbar.css"
],
"url": "https://github.com/ironmonk88/monks-tokenbar",
"download": "https://github.com/ironmonk88/monks-tokenbar/archive/12.03.zip",
"download": "https://github.com/ironmonk88/monks-tokenbar/archive/12.04.zip",
"manifest": "https://github.com/ironmonk88/monks-tokenbar/releases/latest/download/module.json",
"bugs": "https://github.com/ironmonk88/monks-tokenbar/issues",
"id": "monks-tokenbar",
Expand Down
12 changes: 6 additions & 6 deletions monks-tokenbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,11 +303,11 @@ export class MonksTokenBar {
}
} else {
if (game.system.id == "burningwheel") {
const a = RegExp.escape(Handlebars.escapeExpression(choices))
, s = new RegExp(` value=["']${a}["']`);
return options.fn(this).replace(s, "$& selected")
} else
Object.entries(choices).forEach(e => option(...e));
const a = RegExp.escape(Handlebars.escapeExpression(choices))
, s = new RegExp(` value=["']${a}["']`);
return options.fn(this).replace(s, "$& selected")
} else
Object.entries(choices).forEach(e => option(...e));
}
return new Handlebars.SafeString(html);
}
Expand Down Expand Up @@ -1866,7 +1866,7 @@ Hooks.on("updateUser", (user, data, options, userId) => {
Hooks.on("diceSoNiceRollComplete", (messageid) => {
if (game.user.isGM) {
let message = game.messages.find(m => m.id == messageid);
if (message != undefined && message.hasFlag("monks-tokenbar")) {
if (message != undefined) {
let flags = {};
for (let key of Object.keys(foundry.utils.getProperty(message, "flags.monks-tokenbar") || {})) {
if (key.startsWith('token')) {
Expand Down
2 changes: 2 additions & 0 deletions systems/dnd5e-rolls.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ export class DnD5eRolls extends BaseRolls {
}

get showXP() {
if (!foundry.utils.isNewerVersion(game.system.version, "4.0"))
return !game.settings.get('dnd5e', 'disableExperienceTracking');
return game.settings.get('dnd5e', 'levelingMode') != "noxp";
}

Expand Down

0 comments on commit 9b66b20

Please sign in to comment.