From e258e08fadec54d00dee6c98c5852e423e4ea29c Mon Sep 17 00:00:00 2001 From: Dorako Date: Mon, 8 May 2023 08:22:47 +0900 Subject: [PATCH] 2.1.11 --- CHANGELOG.md | 4 ++++ modules/pixi.js | 12 ++++-------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9496a85..7fbee8f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# 2.1.11 + +- (Refinement) Adjust starting angle of Token Effects HUD icons. + # 2.1.10 - (Refinement) Add anti-aliasing to Token Effects HUD icons, courtesy of @Wasp. diff --git a/modules/pixi.js b/modules/pixi.js index 994ce43..3ce0df0 100644 --- a/modules/pixi.js +++ b/modules/pixi.js @@ -59,16 +59,12 @@ Hooks.once("init", () => { let tex = await loadTexture(src, { fallback: "icons/svg/hazard.svg" }); let icon = new PIXI.Sprite(tex); if (src != game.settings.get("pf2e", "deathIcon")) { - // If the circular mask hasn't been created yet - if(!circularMaskTexture){ + if (!circularMaskTexture) { // Define a new render texture that is 110x110 circularMaskTexture = PIXI.RenderTexture.create(110, 110); // Define the mask sprite - const renderedMaskSprite = new PIXI.Graphics() - .beginFill(0xffffff) - .drawCircle(55, 55, 55) - .endFill(); + const renderedMaskSprite = new PIXI.Graphics().beginFill(0xffffff).drawCircle(55, 55, 55).endFill(); // Blur the mask sprite const blurFilter = new PIXI.filters.BlurFilter(2); renderedMaskSprite.filters = [blurFilter]; @@ -192,8 +188,8 @@ Hooks.once("init", () => { const tokenTileFactor = token?.document?.width ?? 1; const sizeOffset = sizeToOffset(actorSize); const offset = sizeOffset * tokenTileFactor * gridSize; - const quarterRotation = 0.5 * Math.PI; - const { x, y } = polar_to_cartesian(offset, (ratio + 0) * 2 * Math.PI + quarterRotation); + const initialRotation = (0.5 + (1 / max) * Math.PI) * Math.PI; + const { x, y } = polar_to_cartesian(offset, (ratio + 0) * 2 * Math.PI + initialRotation); // debugger; effectIcon.position.x = x / 2 + (gridSize * tokenTileFactor) / 2; effectIcon.position.y = (-1 * y) / 2 + (gridSize * tokenTileFactor) / 2;