From bc219d0139a43a05a3d3e046bd4ac3ff5196188c Mon Sep 17 00:00:00 2001
From: Piotr 'pwh' Hanusiak
Date: Mon, 25 Apr 2022 15:36:46 +0200
Subject: [PATCH] preserve current WOKA when getting into customization
---
front/src/Phaser/Login/CustomizeScene.ts | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/front/src/Phaser/Login/CustomizeScene.ts b/front/src/Phaser/Login/CustomizeScene.ts
index 6ac3079e..b86358f8 100644
--- a/front/src/Phaser/Login/CustomizeScene.ts
+++ b/front/src/Phaser/Login/CustomizeScene.ts
@@ -94,6 +94,15 @@ export class CustomizeScene extends AbstractCharacterScene {
}
public create(): void {
+ const savedWokaLayers = gameManager.getCharacterLayers();
+ if (savedWokaLayers && savedWokaLayers.length !== 0) {
+ this.selectedLayers = [];
+ for (let i = 0; i < savedWokaLayers.length; i += 1) {
+ this.selectedLayers.push(
+ this.layers[i].findIndex((item) => item.id === gameManager.getCharacterLayers()[i])
+ );
+ }
+ }
waScaleManager.zoomModifier = 1;
this.createSlotBackgroundTextures();
this.initializeCustomWokaPreviewer();