Changes to mapeditorcomposable, fix pencil and fill tool for tiles

Locked in, made mapeditor my bi-
This commit is contained in:
2025-01-26 23:28:15 +01:00
parent cfac1d508b
commit 14aa696197
15 changed files with 206 additions and 101 deletions

View File

@ -32,14 +32,12 @@ import { loadAllTilesIntoScene } from '@/composables/mapComposable'
import { useMapEditorComposable } from '@/composables/useMapEditorComposable'
import { MapStorage } from '@/storage/storages'
import { useGameStore } from '@/stores/gameStore'
import { useMapEditorStore } from '@/stores/mapEditorStore'
import { Game, Scene } from 'phavuer'
import { ref } from 'vue'
const mapStorage = new MapStorage()
const mapEditor = useMapEditorComposable()
const gameStore = useGameStore()
const mapEditorStore = useMapEditorStore()
const isLoaded = ref(false)
@ -92,8 +90,8 @@ function save() {
placedMapObjects: mapEditor.currentMap.value.placedMapObjects?.map(({ id, mapObject, depth, isRotated, positionX, positionY }) => ({ id, mapObject, depth, isRotated, positionX, positionY })) ?? []
}
if (mapEditorStore.isSettingsModalShown) {
mapEditorStore.toggleSettingsModal()
if (mapEditor.isSettingsModalShown.value) {
mapEditor.toggleSettingsModal()
}
gameStore.connection?.emit('gm:map:update', data, (response: MapT) => {
@ -106,6 +104,6 @@ function clear() {
// Clear placed objects, event tiles and tiles
mapEditor.clearMap()
mapEditorStore.triggerClearTiles()
mapEditor.triggerClearTiles()
}
</script>