From 14aa696197b3d2c9006c32e591100fcbf876e4b3 Mon Sep 17 00:00:00 2001 From: Colin Kallemein Date: Sun, 26 Jan 2025 23:28:15 +0100 Subject: [PATCH] Changes to mapeditorcomposable, fix pencil and fill tool for tiles Locked in, made mapeditor my bi- --- src/App.vue | 10 +- src/components/gameMaster/GmPanel.vue | 6 +- .../partials/tile/TileDetails.vue | 1 - src/components/gameMaster/mapEditor/Map.vue | 6 +- .../mapEditor/mapPartials/MapTiles.vue | 41 +++--- .../mapEditor/partials/CreateMap.vue | 8 +- .../gameMaster/mapEditor/partials/MapList.vue | 10 +- .../mapEditor/partials/MapObjectList.vue | 13 +- .../mapEditor/partials/MapSettings.vue | 4 +- .../mapEditor/partials/TileList.vue | 10 +- .../gameMaster/mapEditor/partials/Toolbar.vue | 52 ++++---- src/components/screens/MapEditor.vue | 8 +- .../useMapEditorPointerHandlers.ts | 6 +- src/composables/useMapEditorComposable.ts | 124 +++++++++++++++++- src/composables/usePointerHandlers.ts | 8 +- 15 files changed, 206 insertions(+), 101 deletions(-) diff --git a/src/App.vue b/src/App.vue index 36ca8ab..971ca84 100644 --- a/src/App.vue +++ b/src/App.vue @@ -17,24 +17,24 @@ import BackgroundImageLoader from '@/components/utilities/BackgroundImageLoader. import Debug from '@/components/utilities/Debug.vue' import Notifications from '@/components/utilities/Notifications.vue' import { useGameStore } from '@/stores/gameStore' -import { useMapEditorStore } from '@/stores/mapEditorStore' +import { useMapEditorComposable } from '@/composables/useMapEditorComposable' import { computed, watch } from 'vue' const gameStore = useGameStore() -const mapEditorStore = useMapEditorStore() +const mapEditor = useMapEditorComposable() const currentScreen = computed(() => { if (!gameStore.game.isLoaded) return Loading if (!gameStore.connection) return Login if (!gameStore.token) return Login if (!gameStore.character) return Characters - if (mapEditorStore.active) return MapEditor + if (mapEditor.active.value) return MapEditor return Game }) -// Watch mapEditorStore.active and empty gameStore.game.loadedAssets +// Watch mapEditor.active and empty gameStore.game.loadedAssets watch( - () => mapEditorStore.active, + () => mapEditor.active.value, () => { gameStore.game.loadedTextures = [] } diff --git a/src/components/gameMaster/GmPanel.vue b/src/components/gameMaster/GmPanel.vue index 0854219..c71ceda 100644 --- a/src/components/gameMaster/GmPanel.vue +++ b/src/components/gameMaster/GmPanel.vue @@ -6,7 +6,7 @@ - +