From f14d9baaa115f332befc820e1909276b1718ff97 Mon Sep 17 00:00:00 2001 From: Dennis Postma Date: Wed, 5 Feb 2025 02:55:33 +0100 Subject: [PATCH 1/5] Send PVP value as integer --- src/components/gameMaster/mapEditor/partials/MapSettings.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/gameMaster/mapEditor/partials/MapSettings.vue b/src/components/gameMaster/mapEditor/partials/MapSettings.vue index ff80cbc..2707d2f 100644 --- a/src/components/gameMaster/mapEditor/partials/MapSettings.vue +++ b/src/components/gameMaster/mapEditor/partials/MapSettings.vue @@ -66,7 +66,8 @@ defineExpose({ function updateValue(event: Event) { let ev = event.target as HTMLInputElement - mapEditor.updateProperty(ev.name as 'name' | 'width' | 'height' | 'pvp' | 'mapEffects', ev.value) + const value = ev.name === 'pvp' ? (ev.checked ? 1 : 0) : ev.value + mapEditor.updateProperty(ev.name as 'name' | 'width' | 'height' | 'pvp' | 'mapEffects', value) } watch( From 14474f766572d9b8fc2f62c87bcda190077e9fd6 Mon Sep 17 00:00:00 2001 From: Dennis Postma Date: Wed, 5 Feb 2025 03:04:33 +0100 Subject: [PATCH 2/5] Removed map from mapEffects type --- src/application/types.ts | 1 - src/components/gameMaster/mapEditor/partials/MapSettings.vue | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/application/types.ts b/src/application/types.ts index 130296b..61e3b3d 100644 --- a/src/application/types.ts +++ b/src/application/types.ts @@ -79,7 +79,6 @@ export type Map = { export type MapEffect = { id: string - map: Map effect: string strength: number } diff --git a/src/components/gameMaster/mapEditor/partials/MapSettings.vue b/src/components/gameMaster/mapEditor/partials/MapSettings.vue index 2707d2f..bbc4b47 100644 --- a/src/components/gameMaster/mapEditor/partials/MapSettings.vue +++ b/src/components/gameMaster/mapEditor/partials/MapSettings.vue @@ -84,8 +84,7 @@ watch( const addEffect = () => { mapEffects.value.push({ - id: uuidv4() as UUID, // Simple unique id generation - map: mapEditor.currentMap.value!, + id: uuidv4(), effect: '', strength: 1 }) From 50daf01a01c52a5528f91182c70d0c4771061d22 Mon Sep 17 00:00:00 2001 From: Dennis Postma Date: Wed, 5 Feb 2025 03:36:24 +0100 Subject: [PATCH 3/5] Depth sorting works semi-better this way --- src/services/mapService.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/services/mapService.ts b/src/services/mapService.ts index 1fb7af7..3d89795 100644 --- a/src/services/mapService.ts +++ b/src/services/mapService.ts @@ -63,11 +63,11 @@ export function createTileArray(width: number, height: number, tile: string = 'b } export const calculateIsometricDepth = (positionX: number, positionY: number, width: number = 0, height: number = 0, isCharacter: boolean = false) => { - const baseDepth = (positionX + positionY) * 1000 + const baseDepth = positionX + positionY if (isCharacter) { - return baseDepth + 500 // Characters should always be above objects at the same position + return baseDepth } - return baseDepth + (width + height) / 4 + return baseDepth + (width + height) / (2 * config.tile_size.width) } async function loadTileTextures(tiles: TileT[], scene: Phaser.Scene) { From 2097a51f07ead9d7f31d2d9303045b6cafe9ae09 Mon Sep 17 00:00:00 2001 From: Dennis Postma Date: Wed, 5 Feb 2025 04:33:40 +0100 Subject: [PATCH 4/5] Put back Colin's FE changes --- .../mapEditor/partials/MapObjectList.vue | 78 ++++----- .../mapEditor/partials/TileList.vue | 149 +++++++++--------- 2 files changed, 117 insertions(+), 110 deletions(-) diff --git a/src/components/gameMaster/mapEditor/partials/MapObjectList.vue b/src/components/gameMaster/mapEditor/partials/MapObjectList.vue index 66a7dcd..38aa4b5 100644 --- a/src/components/gameMaster/mapEditor/partials/MapObjectList.vue +++ b/src/components/gameMaster/mapEditor/partials/MapObjectList.vue @@ -1,43 +1,47 @@