diff --git a/src/components/gameMaster/mapEditor/Map.vue b/src/components/gameMaster/mapEditor/Map.vue index c7835dc..fb8da71 100644 --- a/src/components/gameMaster/mapEditor/Map.vue +++ b/src/components/gameMaster/mapEditor/Map.vue @@ -34,10 +34,16 @@ function handlePointerDown(pointer: Phaser.Input.Pointer) { switch (mapEditor.drawMode.value) { case 'tile': mapTiles.value.handlePointer(pointer) + break case 'map_object': mapObjects.value.handlePointer(pointer) + break case 'teleport': eventTiles.value.handlePointer(pointer) + break + case 'blocking tile': + eventTiles.value.handlePointer(pointer) + break } } diff --git a/src/components/gameMaster/mapEditor/mapPartials/MapEventTiles.vue b/src/components/gameMaster/mapEditor/mapPartials/MapEventTiles.vue index 8452731..518bd5d 100644 --- a/src/components/gameMaster/mapEditor/mapPartials/MapEventTiles.vue +++ b/src/components/gameMaster/mapEditor/mapPartials/MapEventTiles.vue @@ -30,10 +30,8 @@ function getImageProps(tile: MapEventTile) { } function pencil(pointer: Phaser.Input.Pointer, map: MapT) { - if (!tileLayer.value) return - // Check if there is a tile - const tile = getTile(tileLayer.value, pointer.worldX, pointer.worldY) + const tile = getTile(props.tileMap, pointer.worldX, pointer.worldY) if (!tile) return // Check if event tile already exists on position @@ -45,8 +43,8 @@ function pencil(pointer: Phaser.Input.Pointer, map: MapT) { const newEventTile = { id: uuidv4(), - mapId: map?.id, - map: map?.id, + mapId: map.id, + map: map.id, type: mapEditor.drawMode.value === 'blocking tile' ? MapEventTileType.BLOCK : MapEventTileType.TELEPORT, positionX: tile.x, positionY: tile.y, @@ -61,7 +59,7 @@ function pencil(pointer: Phaser.Input.Pointer, map: MapT) { : undefined } - map!.mapEventTiles = map!.mapEventTiles.concat(newEventTile as MapEventTile) + map.mapEventTiles.push(newEventTile) } function erase(pointer: Phaser.Input.Pointer, map: MapT) { @@ -88,6 +86,8 @@ function handlePointer(pointer: Phaser.Input.Pointer) { // Check if shift is not pressed, this means we are moving the camera if (pointer.event.shiftKey) return + if (pointer.event.altKey) return + switch (mapEditor.tool.value) { case 'pencil': pencil(pointer, map) diff --git a/src/components/gameMaster/mapEditor/partials/MapObjectList.vue b/src/components/gameMaster/mapEditor/partials/MapObjectList.vue index c26eeaf..84677f1 100644 --- a/src/components/gameMaster/mapEditor/partials/MapObjectList.vue +++ b/src/components/gameMaster/mapEditor/partials/MapObjectList.vue @@ -20,7 +20,7 @@
-
+
(null) const selectedPlacedObject = ref(null) const shouldClearTiles = ref(false) const teleportSettings = ref({ - toMapId: '', + toMapId: '1000', toPositionX: 0, toPositionY: 0, toRotation: 0