Teleport modal restored, and expanded undo/redo to include all placed and erase edits across each map element type (map object advanced actions WIP)

This commit is contained in:
2025-02-08 15:07:21 -06:00
parent 5f2c7a09b1
commit 0c450b24ed
7 changed files with 244 additions and 123 deletions

View File

@ -34,6 +34,7 @@ import { MapStorage } from '@/storage/storages'
import { useGameStore } from '@/stores/gameStore'
import { Game, Scene } from 'phavuer'
import { ref, useTemplateRef } from 'vue'
import teleportModal from '@/components/gameMaster/mapEditor/partials/TeleportModal.vue'
const mapStorage = new MapStorage()
const mapEditor = useMapEditorComposable()
@ -41,6 +42,7 @@ const gameStore = useGameStore()
const mapModal = useTemplateRef('mapModal')
const mapSettingsModal = useTemplateRef('mapSettingsModal')
const teleportSettings = useTemplateRef('teleportModal')
const isLoaded = ref(false)
@ -86,15 +88,9 @@ function save() {
if (!currentMap) return
const data = {
...currentMap,
mapId: currentMap.id,
name: currentMap.name,
width: currentMap.width,
height: currentMap.height,
tiles: currentMap.tiles,
pvp: currentMap.pvp,
mapEffects: currentMap.mapEffects,
mapEventTiles: currentMap.mapEventTiles,
placedMapObjects: currentMap.placedMapObjects.map(({ id, mapObject, isRotated, positionX, positionY }) => ({ id, mapObject, isRotated, positionX, positionY })) ?? []
placedMapObjects: currentMap.placedMapObjects.map(({ id, mapObject, depth, isRotated, positionX, positionY }) => ({ id, mapObject, depth, isRotated, positionX, positionY })) ?? []
}
gameStore.connection?.emit('gm:map:update', data, (response: MapT) => {