Skip to content

Commit 813ce7a

Browse files
committed
1 parent 9f3bd69 commit 813ce7a

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

scripts/radial-status-effects.js

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,26 @@ import { getSetting, registerSetting } from "./utils.js";
33

44
const constants = CONSTANTS.RADIAL_STATUS_EFFECTS;
55

6+
/**
7+
* Whether drop shadow filters should be applied to effect backgrounds.
8+
* @type {boolean|null}
9+
*/
10+
let useDropShadow = null;
11+
12+
/**
13+
* Determine whether drop shadow filters should be used.
14+
* Disabled when Prime Performance is active (as bitmap caching breaks PIXI filters)
15+
* or when core performance mode is Medium or lower.
16+
* @returns {boolean}
17+
*/
18+
function shouldUseDropShadow() {
19+
if ( !PIXI.filters?.DropShadowFilter ) return false;
20+
if ( game.modules.get("fvtt-perf-optim")?.active ) return false;
21+
const perfMode = game.settings.get("core", "performanceMode") ?? CONST.CANVAS_PERFORMANCE_MODES.MAX;
22+
if ( perfMode <= CONST.CANVAS_PERFORMANCE_MODES.MED ) return false;
23+
return true;
24+
}
25+
626
/**
727
* Register settings and patches.
828
*/
@@ -64,7 +84,8 @@ function refreshEffectsPatch(wrapped, ...args) {
6484
const halfGridSize = gridSize * tokenTileFactor / 2;
6585
const bg = this.effects.bg.clear();
6686

67-
if ( !bg.filters?.length && PIXI.filters?.DropShadowFilter ) {
87+
if ( useDropShadow === null ) useDropShadow = shouldUseDropShadow();
88+
if ( useDropShadow && !bg.filters?.length ) {
6889
bg.filters = [new PIXI.filters.DropShadowFilter({
6990
blur: 2,
7091
quality: 2,

0 commit comments

Comments
 (0)