Restored tile editing and proper map clearing behavior

This commit is contained in:
2025-02-04 14:09:57 -06:00
parent cf54ab842a
commit aee18956f3
5 changed files with 21 additions and 20 deletions

View File

@ -98,16 +98,17 @@ function save() {
const currentMap = mapEditor.currentMap.value
if (!currentMap) return
console.log(currentMap.tiles)
const data = {
mapId: {...currentMap},
mapId: currentMap.id,
name: currentMap.name,
width: currentMap.width,
height: currentMap.height,
tiles: {...currentMap.tiles},
tiles: currentMap.tiles,
pvp: currentMap.pvp,
mapEffects: {...currentMap.mapEffects},
mapEventTiles: {...currentMap.mapEventTiles},
placedMapObjects: currentMap.placedMapObjects?.map(({ id, mapObject, depth, isRotated, positionX, positionY }) => ({ id, mapObject: {...mapObject}, depth, isRotated, positionX, positionY })) ?? []
mapEffects: currentMap.mapEffects,
mapEventTiles: currentMap.mapEventTiles,
placedMapObjects: currentMap.placedMapObjects.map(({ id, mapObject, depth, isRotated, positionX, positionY }) => ({ id, mapObject: {...mapObject}, depth, isRotated, positionX, positionY })) ?? []
}
gameStore.connection?.emit('gm:map:update', data, (response: MapT) => {
@ -127,5 +128,6 @@ function clear() {
// Clear placed objects, event tiles and tiles
mapEditor.clearMap()
mapEditor.triggerClearTiles()
}
</script>