You've already forked Nitro_Render_V3
mirror of
https://github.com/duckietm/Nitro_Render_V3.git
synced 2026-06-20 07:26:18 +00:00
Align with Pixi v8: Filter[] union, WebGLRenderer narrow, ImageLike
Four sites where Pixi v8's stricter typing tripped tsgo: - AvatarImage: container.filters is typed as 'readonly Filter[] | null' in v8 (no longer a single-Filter union). The old fallback branch 'else container.filters = [container.filters, …]' tried to treat a readonly array as a single Filter; collapsed to the array-spread path which now covers both undefined and non-empty cases. Added Filter to the pixi.js import. - FurnitureBadgeDisplayVisualization.updateSprite() had a 4-arg override (sprite, asset, scale, layerId) of the parent's 2-arg signature (scale, layerId). The sprite/asset were never used from the parameters — the body only mutated 'sprite'. Refactored to fetch the sprite via this.getSprite(layerId) inside the override body so the signature matches the base. - ExtendedSprite: 'renderer.gl' / 'glRenderTarget.resolveTargetFramebuffer' exist only on WebGLRenderer / GlRenderTarget (not the WebGPU variants). The runtime check 'renderer.type === RendererType.WEBGL' guarantees this; cast at the boundary to satisfy the typechecker. - TextureUtils.generateImage: Pixi v8's Extractor.image() returns the union ImageLike (HTMLCanvasElement | HTMLImageElement); the public signature promises HTMLImageElement. Cast at return — the Pixi default backend returns HTMLImageElement here.
This commit is contained in:
+6
-2
@@ -170,14 +170,18 @@ export class FurnitureBadgeDisplayVisualization extends FurnitureAnimatedVisuali
|
||||
return assetName;
|
||||
}
|
||||
|
||||
protected updateSprite(sprite: IRoomObjectSprite, asset: IGraphicAsset, scale: number, layerId: number): void
|
||||
protected updateSprite(scale: number, layerId: number): void
|
||||
{
|
||||
super.updateSprite(sprite, asset, scale, layerId);
|
||||
super.updateSprite(scale, layerId);
|
||||
|
||||
const tag = this.getLayerTag(scale, this.direction, layerId);
|
||||
|
||||
if(tag === FurnitureBadgeDisplayVisualization.BADGE_TAG)
|
||||
{
|
||||
const sprite = this.getSprite(layerId);
|
||||
|
||||
if(!sprite) return;
|
||||
|
||||
sprite.visible = true;
|
||||
sprite.alpha = 255;
|
||||
sprite.color = 0xFFFFFF;
|
||||
|
||||
Reference in New Issue
Block a user