🆙 Fixed the Door not visable when window is on wall

This commit is contained in:
duckietm
2026-05-04 12:01:45 +02:00
parent 2f7b80e894
commit 6ab93ee146
3 changed files with 28 additions and 6 deletions
@@ -5,7 +5,7 @@ import { RoomObjectUpdateMessage } from './RoomObjectUpdateMessage';
export class ObjectRoomMaskUpdateMessage extends RoomObjectUpdateMessage
{
public static ADD_MASK: string = 'RORMUM_ADD_MASK';
public static REMOVE_MASK: string = 'RORMUM_ADD_MASK';
public static REMOVE_MASK: string = 'RORMUM_REMOVE_MASK';
public static DOOR: string = 'door';
public static WINDOW: string = 'window';
public static HOLE: string = 'hole';
@@ -812,6 +812,24 @@ export class RoomPlane implements IRoomPlane
layerContainer.destroy({ children: true });
}
private applyPlaneSpriteMasksTo(container: Container): void
{
if(!this._planeSprite || !this._planeSprite.children) return;
for(const child of this._planeSprite.children)
{
if(child instanceof Sprite)
{
const maskClone = new Sprite(child.texture);
maskClone.position.copyFrom(child.position);
maskClone.scale.copyFrom(child.scale);
container.addChild(maskClone);
}
}
if(this._maskFilter && (container.children.length > 1)) container.filters = [this._maskFilter];
}
private renderBackgroundColor(): void
{
if(!this._planeTexture || this._landscapeBackgroundColor === null) return;
@@ -828,6 +846,8 @@ export class RoomPlane implements IRoomPlane
const colorContainer = new Container();
colorContainer.addChild(colorGraphics);
this.applyPlaneSpriteMasksTo(colorContainer);
const transform = this.getMatrixForDimensions(canvasWidth, canvasHeight);
GetRenderer().render({
@@ -869,6 +889,8 @@ export class RoomPlane implements IRoomPlane
const colorContainer = new Container();
colorContainer.addChild(colorGraphics);
this.applyPlaneSpriteMasksTo(colorContainer);
const transform = this.getMatrixForDimensions(canvasWidth, canvasHeight);
GetRenderer().render({