Skip to content

Commit b16587d

Browse files
committed
fix: update OutlineFilter to use @pixi/filter-outline API
- Change remaining old-style OutlineFilter constructor call - Fixes webpack build errors from missing pixi-filters package - Resolves CI failure in PR #2514
1 parent 17647d4 commit b16587d

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

src/client/graphics/layers/StructureIconsLayer.ts

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
import { OutlineFilter } from "@pixi/filter-outline";
12
import { extend } from "colord";
23
import a11yPlugin from "colord/plugins/a11y";
3-
import { OutlineFilter } from "pixi-filters";
44
import * as PIXI from "pixi.js";
55
import bitmapFont from "../../../../resources/fonts/round_6x6_modified.xml";
66
import { Theme } from "../../../core/configuration/Config";
@@ -272,7 +272,7 @@ export class StructureIconsLayer implements Layer {
272272
canUpgrade: false,
273273
});
274274
this.ghostUnit.container.filters = [
275-
new OutlineFilter({ thickness: 2, color: "rgba(255, 0, 0, 1)" }),
275+
new OutlineFilter(2, 0xff0000) as any,
276276
];
277277
return;
278278
}
@@ -290,15 +290,15 @@ export class StructureIconsLayer implements Layer {
290290
);
291291
if (this.potentialUpgrade) {
292292
this.potentialUpgrade.iconContainer.filters = [
293-
new OutlineFilter({ thickness: 2, color: "rgba(0, 255, 0, 1)" }),
293+
new OutlineFilter(2, 0x00ff00) as any,
294294
];
295295
this.potentialUpgrade.dotContainer.filters = [
296-
new OutlineFilter({ thickness: 2, color: "rgba(0, 255, 0, 1)" }),
296+
new OutlineFilter(2, 0x00ff00) as any,
297297
];
298298
}
299299
} else if (unit.canBuild === false) {
300300
this.ghostUnit.container.filters = [
301-
new OutlineFilter({ thickness: 2, color: "rgba(255, 0, 0, 1)" }),
301+
new OutlineFilter(2, 0xff0000) as any,
302302
];
303303
}
304304

@@ -502,12 +502,8 @@ export class StructureIconsLayer implements Layer {
502502
render.iconContainer.alpha = structureInfos.visible ? 1 : 0.3;
503503
render.dotContainer.alpha = structureInfos.visible ? 1 : 0.3;
504504
if (structureInfos.visible && focusStructure) {
505-
render.iconContainer.filters = [
506-
new OutlineFilter({ thickness: 2, color: "rgb(255, 255, 255)" }),
507-
];
508-
render.dotContainer.filters = [
509-
new OutlineFilter({ thickness: 2, color: "rgb(255, 255, 255)" }),
510-
];
505+
render.iconContainer.filters = [new OutlineFilter(2, 0xffffff) as any];
506+
render.dotContainer.filters = [new OutlineFilter(2, 0xffffff) as any];
511507
} else {
512508
render.iconContainer.filters = [];
513509
render.dotContainer.filters = [];

0 commit comments

Comments
 (0)