Skip to content

Commit

Permalink
Updated for Foundry v10
Browse files Browse the repository at this point in the history
  • Loading branch information
illandril committed Aug 7, 2022
1 parent 6305a8a commit 351edeb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
11 changes: 5 additions & 6 deletions module/module.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
{
"name": "illandril-token-hud-scale",
"id": "illandril-token-hud-scale",
"title": "Illandril's Token HUD scaler",
"description": "Improves the visibility of the Token HUD and Status Effect icons. More specifically, this increases the scale of the Token HUD by 50%, adjusts the size of token status effects so they fit 3 across for the token (60% larger than standard for 1:1 tokens, much larger than standard for double-sized tokens, slightly smaller than standard for half-size tokens), and increases the opacity of the background behind both the Token HUD and Status Effect icons.",
"version": "1.5.1",
"library": "false",
"manifestPlusVersion": "1.2.0",
"minimumCoreVersion": "0.8.5",
"compatibleCoreVersion": "9",
"compatibility": {
"minimum": 10,
"verified": 10
},
"type": "module",
"author": "Joe Spandrusyszyn (illandril)",
"authors": [
{
"name": "Joe Spandrusyszyn (illandril)",
Expand All @@ -20,8 +21,6 @@
"reddit": "u/illandril"
}
],
"dependencies": [],
"conflicts": [],
"esmodules": [
"./scripts/index.js"
],
Expand Down
4 changes: 2 additions & 2 deletions module/scripts/effect-scaler.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function countEffects(token) {
if (!token) {
return 0;
}
const tokenEffects = token.data.effects;
const tokenEffects = token.document.effects;
const actorEffects = (token.actor && token.actor.temporaryEffects) || [];
let numEffects = tokenEffects.length;
actorEffects.forEach((actorEffect) => {
Expand All @@ -43,7 +43,7 @@ function updateEffectScales(token) {
const layout = Settings.EffectIconsLayout.get();
const above = layout === 'above';
const horizontal = above || layout === 'horizontal';
const iconsPerRow = Math.ceil(Settings.EffectIconsPerRow.get() * (horizontal ? token.data.width : token.data.height));
const iconsPerRow = Math.ceil(Settings.EffectIconsPerRow.get() * (horizontal ? token.document.width : token.document.height));

const w = (horizontal ? token.w : token.h) / iconsPerRow;
const bg = effectsHUD.children[0];
Expand Down
2 changes: 1 addition & 1 deletion module/scripts/hud-button-scaler.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Settings, { SETTINGS_UPDATED } from './settings.js';

const baselineSetPosition = TokenHUD.prototype.setPosition;
const rescaleSetPosition = function () {
const td = this.object.data;
const td = this.object.document;
const ratio = canvas.dimensions.size / 100;
let scale = Settings.HUDButtonScale.get();
if (Settings.EnableStaticSizedHUD.get()) {
Expand Down

0 comments on commit 351edeb

Please sign in to comment.