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 f258c65403
commit ca307d4de3
7 changed files with 316 additions and 126 deletions

View File

@ -11,6 +11,7 @@
@clear="clear"
@open-maps="mapModal?.open"
@open-settings="mapSettingsModal?.open"
@open-teleport-settings="teleportModal?.open"
@close-editor="mapEditor.toggleActive"
@close-lists="tileList?.close"
@closeLists="objectList?.close"
@ -45,6 +46,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()
@ -54,6 +56,7 @@ const mapModal = useTemplateRef('mapModal')
const tileList = useTemplateRef('tileList')
const objectList = useTemplateRef('objectList')
const mapSettingsModal = useTemplateRef('mapSettingsModal')
const teleportSettings = useTemplateRef('teleportModal')
const isLoaded = ref(false)
@ -96,14 +99,8 @@ 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, depth, isRotated, positionX, positionY }) => ({ id, mapObject, depth, isRotated, positionX, positionY })) ?? []
}