Map editor ui fixes, switching back to game from map editor, draw/tap checkbox, and partial restoration of tile picker function
This commit is contained in:
@ -111,10 +111,15 @@ 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)
|
||||
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])
|
||||
}
|
||||
@ -145,7 +150,11 @@ function handlePointer(pointer: Phaser.Input.Pointer) {
|
||||
if (pointer.event.shiftKey) return
|
||||
|
||||
// Check if alt is pressed
|
||||
if (pointer.event.altKey) return
|
||||
if (pointer.event.altKey) {
|
||||
tilePicker(pointer);
|
||||
return
|
||||
}
|
||||
|
||||
// Check if draw mode is tile
|
||||
switch (mapEditor.tool.value) {
|
||||
case 'pencil':
|
||||
@ -157,9 +166,6 @@ function handlePointer(pointer: Phaser.Input.Pointer) {
|
||||
case 'paint':
|
||||
paint(pointer)
|
||||
break
|
||||
case 'tile picker':
|
||||
tilePicker(pointer)
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user