From 517e92b07bbc247f845df320814d5995d080cfb2 Mon Sep 17 00:00:00 2001 From: Andrei Date: Mon, 27 Jan 2025 14:49:27 -0600 Subject: [PATCH] Fully restored tile picker function --- .../gameMaster/mapEditor/mapPartials/MapTiles.vue | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/components/gameMaster/mapEditor/mapPartials/MapTiles.vue b/src/components/gameMaster/mapEditor/mapPartials/MapTiles.vue index 8c0c593..17264f5 100644 --- a/src/components/gameMaster/mapEditor/mapPartials/MapTiles.vue +++ b/src/components/gameMaster/mapEditor/mapPartials/MapTiles.vue @@ -74,7 +74,7 @@ function pencil(pointer: Phaser.Input.Pointer) { placeTile(tileMap.value, tileLayer.value, tile.x, tile.y, mapEditor.selectedTile.value) // Adjust mapEditorStore.map.tiles - map.tiles[tile.y][tile.x] = map.tiles[tile.y][tile.x] + map.tiles[tile.y][tile.x] = mapEditor.selectedTile.value } function eraser(pointer: Phaser.Input.Pointer) { @@ -111,15 +111,12 @@ function tilePicker(pointer: Phaser.Input.Pointer) { let map = mapEditor.currentMap.value if (!map) return - console.log("herer") if (!tileMap.value || !tileLayer.value) return // Check if there is a tile const tile = getTile(tileLayer.value, pointer.worldX, pointer.worldY) if (!tile) return - console.log(tile.index) - // Select the tile mapEditor.setSelectedTile(map.tiles[tile.y][tile.x]) } @@ -137,12 +134,8 @@ watch( ) function handlePointer(pointer: Phaser.Input.Pointer) { - if (!tileMap.value || !tileLayer.value) return - // Check if tool is pencil - if (mapEditor.drawMode.value !== 'tile') return - // Check if left mouse button is pressed if (!pointer.isDown) return