From 6adfc727c5ec80b2a7976bee95b96985ca7d133a Mon Sep 17 00:00:00 2001 From: Dennis Postma Date: Sat, 19 Oct 2024 22:36:08 +0200 Subject: [PATCH] return if shift is pressed for tiles, objects and event tiles (camera drag = active) --- src/components/gameMaster/zoneEditor/EventTiles.vue | 6 ++++++ src/components/gameMaster/zoneEditor/Objects.vue | 6 ++++++ src/components/gameMaster/zoneEditor/Tiles.vue | 6 ++++++ 3 files changed, 18 insertions(+) diff --git a/src/components/gameMaster/zoneEditor/EventTiles.vue b/src/components/gameMaster/zoneEditor/EventTiles.vue index 8f8a44e..76ecc63 100644 --- a/src/components/gameMaster/zoneEditor/EventTiles.vue +++ b/src/components/gameMaster/zoneEditor/EventTiles.vue @@ -39,6 +39,9 @@ function pencil(pointer: Phaser.Input.Pointer) { // Check if left mouse button is pressed if (!pointer.isDown) return + // Check if shift is not pressed, this means we are moving the camera + if (pointer.event.shiftKey) return + // Check if there is a tile const tile = getTile(props.tilemap, pointer.worldX, pointer.worldY) if (!tile) return @@ -84,6 +87,9 @@ function eraser(pointer: Phaser.Input.Pointer) { // Check if left mouse button is pressed if (!pointer.isDown) return + // Check if shift is not pressed, this means we are moving the camera + if (pointer.event.shiftKey) return + // Check if there is a tile const tile = getTile(props.tilemap, pointer.worldX, pointer.worldY) if (!tile) return diff --git a/src/components/gameMaster/zoneEditor/Objects.vue b/src/components/gameMaster/zoneEditor/Objects.vue index 5878bfc..8eacc87 100644 --- a/src/components/gameMaster/zoneEditor/Objects.vue +++ b/src/components/gameMaster/zoneEditor/Objects.vue @@ -51,6 +51,9 @@ function pencil(pointer: Phaser.Input.Pointer) { // Check if left mouse button is pressed if (!pointer.isDown) return + // Check if shift is not pressed, this means we are moving the camera + if (pointer.event.shiftKey) return + // Check if there is a tile const tile = getTile(props.tilemap, pointer.worldX, pointer.worldY) if (!tile) return @@ -88,6 +91,9 @@ function eraser(pointer: Phaser.Input.Pointer) { // Check if left mouse button is pressed if (!pointer.isDown) return + // Check if shift is not pressed, this means we are moving the camera + if (pointer.event.shiftKey) return + // Check if there is a tile const tile = getTile(props.tilemap, pointer.worldX, pointer.worldY) if (!tile) return diff --git a/src/components/gameMaster/zoneEditor/Tiles.vue b/src/components/gameMaster/zoneEditor/Tiles.vue index 3f1adfd..3a44ea1 100644 --- a/src/components/gameMaster/zoneEditor/Tiles.vue +++ b/src/components/gameMaster/zoneEditor/Tiles.vue @@ -62,6 +62,9 @@ function pencil(pointer: Phaser.Input.Pointer) { // Check if left mouse button is pressed if (!pointer.isDown) return + // Check if shift is not pressed, this means we are moving the camera + if (pointer.event.shiftKey) return + // Check if there is a tile const tile = getTile(tiles, pointer.worldX, pointer.worldY) if (!tile) return @@ -86,6 +89,9 @@ function eraser(pointer: Phaser.Input.Pointer) { // Check if left mouse button is pressed if (!pointer.isDown) return + // Check if shift is not pressed, this means we are moving the camera + if (pointer.event.shiftKey) return + // Check if there is a tile const tile = getTile(tiles, pointer.worldX, pointer.worldY) if (!tile) return