diff --git a/front/src/Phaser/Login/SelectCharacterScene.ts b/front/src/Phaser/Login/SelectCharacterScene.ts index 4f1316b0..b6d0b207 100644 --- a/front/src/Phaser/Login/SelectCharacterScene.ts +++ b/front/src/Phaser/Login/SelectCharacterScene.ts @@ -193,7 +193,6 @@ export class SelectCharacterScene extends AbstractCharacterScene { } catch (error) { console.warn(error); } - this.charactersDraggableGrid.setItemsInRow(this.gridRowsCount); this.populateGrid(); } @@ -203,12 +202,20 @@ export class SelectCharacterScene extends AbstractCharacterScene { this.selectedWoka = null; this.charactersDraggableGrid.clearAllItems(); const textures = this.playerTextures.getWokaCollectionTextures(this.getSelectedCollectionName()); + + let currentSelectedItem = null; for (let i = 0; i < textures.length; i += 1) { const slot = new WokaSlot(this, textures[i].id).setDisplaySize(wokaDimension, wokaDimension); + + //ini current Select Item to the first + if (i === 0) currentSelectedItem = slot; + this.charactersDraggableGrid.addItem(slot); } this.charactersDraggableGrid.moveContentToBeginning(); - void this.charactersDraggableGrid.moveContentTo(0.5, textures.length * 50); + + //Select the first Woka + if (currentSelectedItem) this.selectGridItem(currentSelectedItem); } private bindEventHandlers(): void {