From d99930a67ebaaac48b3969dbbc241122965d2cfe Mon Sep 17 00:00:00 2001 From: Hanusiak Piotr Date: Thu, 13 Jan 2022 16:17:49 +0100 Subject: [PATCH] save last zoom value if setting the camera viewport without locking it --- front/src/Phaser/Game/CameraManager.ts | 1 + front/src/Phaser/Game/GameScene.ts | 10 ---------- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/front/src/Phaser/Game/CameraManager.ts b/front/src/Phaser/Game/CameraManager.ts index 5925fb11..dea79412 100644 --- a/front/src/Phaser/Game/CameraManager.ts +++ b/front/src/Phaser/Game/CameraManager.ts @@ -80,6 +80,7 @@ export class CameraManager extends Phaser.Events.EventEmitter { return; } this.setCameraMode(CameraMode.Positioned); + this.waScaleManager.saveZoom(); const currentZoomModifier = this.waScaleManager.zoomModifier; const zoomModifierChange = this.getZoomModifierChange(setTo.width, setTo.height); this.camera.stopFollow(); diff --git a/front/src/Phaser/Game/GameScene.ts b/front/src/Phaser/Game/GameScene.ts index 4e3f7be3..dde9688d 100644 --- a/front/src/Phaser/Game/GameScene.ts +++ b/front/src/Phaser/Game/GameScene.ts @@ -1128,16 +1128,6 @@ ${escapedMessage} }) ); - // this.iframeSubscriptionList.push( - // iframeListener.cameraFocusOnStream.subscribe((cameraFocusOnEvent) => { - // this.cameraManager.enterFocusMode( - // { ...cameraFocusOnEvent }, - // undefined, - // cameraFocusOnEvent.smooth ? 1000 : 0 - // ); - // }) - // ); - this.iframeSubscriptionList.push( iframeListener.cameraFollowPlayerStream.subscribe((cameraFollowPlayerEvent) => { this.cameraManager.leaveFocusMode(this.CurrentPlayer, cameraFollowPlayerEvent.smooth ? 1000 : 0);