diff --git a/src/nitro/camera/IRoomCameraWidgetEffect.ts b/src/nitro/camera/IRoomCameraWidgetEffect.ts index 954947b1..e408a24a 100644 --- a/src/nitro/camera/IRoomCameraWidgetEffect.ts +++ b/src/nitro/camera/IRoomCameraWidgetEffect.ts @@ -6,4 +6,5 @@ export interface IRoomCameraWidgetEffect minLevel: number; texture: Texture; colorMatrix: number[]; + blendMode: number; } diff --git a/src/nitro/camera/IRoomCameraWidgetManager.ts b/src/nitro/camera/IRoomCameraWidgetManager.ts index 029f1ee7..886609f5 100644 --- a/src/nitro/camera/IRoomCameraWidgetManager.ts +++ b/src/nitro/camera/IRoomCameraWidgetManager.ts @@ -5,7 +5,7 @@ import { IRoomCameraWidgetSelectedEffect } from './IRoomCameraWidgetSelectedEffe export interface IRoomCameraWidgetManager { init(): void; - applyEffects(image: HTMLImageElement, selectedEffects: IRoomCameraWidgetSelectedEffect[]): HTMLImageElement; + applyEffects(image: HTMLImageElement, selectedEffects: IRoomCameraWidgetSelectedEffect[], isZoomed: boolean): HTMLImageElement; events: IEventDispatcher; effects: Map; isLoaded: boolean; diff --git a/src/nitro/camera/RoomCameraWidgetEffect.ts b/src/nitro/camera/RoomCameraWidgetEffect.ts index 8cd285ea..e081b689 100644 --- a/src/nitro/camera/RoomCameraWidgetEffect.ts +++ b/src/nitro/camera/RoomCameraWidgetEffect.ts @@ -7,13 +7,15 @@ export class RoomCameraWidgetEffect implements IRoomCameraWidgetEffect private _minLevel: number = -1; private _texture: Texture = null; private _colorMatrix: number[] = null; + private _blendMode: number = null; - constructor(name: string, minLevel: number = -1, texture: Texture = null, colorMatrix: number[] = null) + constructor(name: string, minLevel: number = -1, texture: Texture = null, colorMatrix: number[] = null, blendMode: number = null) { this._name = name; this._minLevel = minLevel; this._texture = texture; this._colorMatrix = colorMatrix; + this._blendMode = blendMode; } public get name(): string @@ -41,6 +43,16 @@ export class RoomCameraWidgetEffect implements IRoomCameraWidgetEffect this._colorMatrix = colorMatrix; } + public get blendMode(): number + { + return this._blendMode; + } + + public set blendMode(blendMode: number) + { + this._blendMode = blendMode; + } + public get minLevel(): number { return this._minLevel; diff --git a/src/nitro/camera/RoomCameraWidgetManager.ts b/src/nitro/camera/RoomCameraWidgetManager.ts index 98c818b8..92b938c4 100644 --- a/src/nitro/camera/RoomCameraWidgetManager.ts +++ b/src/nitro/camera/RoomCameraWidgetManager.ts @@ -28,7 +28,7 @@ export class RoomCameraWidgetManager implements IRoomCameraWidgetManager this._isLoaded = true; const imagesUrl = Nitro.instance.getConfiguration('image.library.url') + 'Habbo-Stories/'; - const effects = Nitro.instance.getConfiguration<{ name: string, colorMatrix?: number[], minLevel: number, enabled: boolean }[]>('camera.available.effects'); + const effects = Nitro.instance.getConfiguration<{ name: string, colorMatrix?: number[], minLevel: number, blendMode?: number, enabled: boolean }[]>('camera.available.effects'); for(const effect of effects) { @@ -42,7 +42,8 @@ export class RoomCameraWidgetManager implements IRoomCameraWidgetManager } else { - cameraEffect.texture = Texture.from(imagesUrl + effect.name + '.png'); + cameraEffect.texture = Texture.from(imagesUrl + effect.name + '.png'); + cameraEffect.blendMode = effect.blendMode; } this._effects.set(cameraEffect.name, cameraEffect); @@ -51,7 +52,7 @@ export class RoomCameraWidgetManager implements IRoomCameraWidgetManager this.events.dispatchEvent(new RoomCameraWidgetManagerEvent(RoomCameraWidgetManagerEvent.INITIALIZED)); } - public applyEffects(image: HTMLImageElement, selectedEffects: IRoomCameraWidgetSelectedEffect[]): HTMLImageElement + public applyEffects(image: HTMLImageElement, selectedEffects: IRoomCameraWidgetSelectedEffect[], isZoomed: boolean): HTMLImageElement { const container = new Container(); const texture = Texture.from(image); @@ -78,8 +79,9 @@ export class RoomCameraWidgetManager implements IRoomCameraWidgetManager } else { - const effectSprite = new Sprite(effect.texture); - effectSprite.alpha = selectedEffect.alpha; + const effectSprite = new Sprite(effect.texture); + effectSprite.alpha = selectedEffect.alpha; + effectSprite.blendMode = effect.blendMode; container.addChild(effectSprite); }