Merge cleanup

This commit is contained in:
Andrei 2025-02-10 16:21:23 -06:00
parent 87ffc98cce
commit 59243e0e17
4 changed files with 5 additions and 10 deletions

View File

@ -113,10 +113,6 @@ function updateAndCommit(map?: MapT) {
commit()
commandStack.push(0)
commandIndex.value = commandStack.length
console.log(history.value)
console.log(commandStack)
console.log(commandIndex.value)
}
function addCommand(command: EditorCommand) {

View File

@ -25,6 +25,7 @@ import TilemapLayer = Phaser.Tilemaps.TilemapLayer
const scene = useScene()
const mapEditor = useMapEditorComposable()
const map = computed(() => mapEditor.currentMap.value!)
const emit = defineEmits<{(e: 'update', map: MapT): void, (e: 'updateAndCommit', map: MapT): void}>()
@ -141,7 +142,6 @@ function rotatePlacedMapObject(id: string, map: MapT) {
map.placedMapObjects.map((placed) => {
if (placed.id === id) {
console.log(placed.id)
placed.isRotated = !placed.isRotated
}})

View File

@ -108,7 +108,7 @@ import { computed, onBeforeUnmount, onMounted, ref } from 'vue'
const mapEditor = useMapEditorComposable()
const emit = defineEmits(['save', 'clear', 'open-maps', 'open-settings'])
const emit = defineEmits(['save', 'clear', 'open-maps', 'open-settings', 'open-teleport'])
// States
const toolbar = ref(null)
@ -150,7 +150,7 @@ function handleClick(tool: string) {
mapEditor.setTool(tool)
selectPencilOpen.value = tool === 'pencil' ? !selectPencilOpen.value : false
selectEraserOpen.value = tool === 'eraser' ? !selectEraserOpen.value : false
if (mapEditor.drawMode.value === 'teleport') emit("open-teleport")
}
function cycleToolMode(tool: 'pencil' | 'eraser') {

View File

@ -5,7 +5,7 @@
<div v-if="!isLoaded" class="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 text-white text-3xl font-ui">Loading...</div>
<div v-else>
<Map v-if="mapEditor.currentMap.value" :key="mapEditor.currentMap.value?.id" />
<Toolbar ref="toolbar" @save="save" @clear="clear" @open-maps="mapModal?.open" @open-settings="mapSettingsModal?.open" />
<Toolbar ref="toolbar" @save="save" @clear="clear" @open-maps="mapModal?.open" @open-settings="mapSettingsModal?.open" @open-teleport="teleportModal?.open"/>
<MapList ref="mapModal" @open-create-map="mapSettingsModal?.open" />
<TileList />
<MapObjectList />
@ -34,7 +34,6 @@ 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()
@ -42,7 +41,7 @@ const gameStore = useGameStore()
const mapModal = useTemplateRef('mapModal')
const mapSettingsModal = useTemplateRef('mapSettingsModal')
const teleportSettings = useTemplateRef('teleportModal')
const teleportModal = useTemplateRef('teleportModal')
const isLoaded = ref(false)