diff --git a/src/components/gameMaster/mapEditor/partials/Toolbar.vue b/src/components/gameMaster/mapEditor/partials/Toolbar.vue index e1661b2..6b4b68b 100644 --- a/src/components/gameMaster/mapEditor/partials/Toolbar.vue +++ b/src/components/gameMaster/mapEditor/partials/Toolbar.vue @@ -68,7 +68,7 @@
- +
@@ -100,7 +100,7 @@ import Modal from '@/components/utilities/Modal.vue' import { useMapEditorComposable } from '@/composables/useMapEditorComposable' import { onClickOutside } from '@vueuse/core' -import { onBeforeUnmount, onMounted, ref } from 'vue' +import { computed, onBeforeUnmount, onMounted, ref } from 'vue' const mapEditor = useMapEditorComposable() @@ -112,7 +112,7 @@ const isMapEditorSettingsModalOpen = ref(false) const selectPencilOpen = ref(false) const selectEraserOpen = ref(false) const checkboxValue = ref(false) -const listOpen = ref(false) +const listOpen = computed(() => mapEditor.tool.value ==='pencil' && (mapEditor.drawMode.value === 'tile' || mapEditor.drawMode.value === 'map_object')) // drawMode function setDrawMode(value: string) { @@ -142,18 +142,7 @@ function handleModeClick(mode: string, type: 'pencil' | 'eraser') { } function handleClick(tool: string) { - if (tool === 'mapEditorSettings') { - isMapEditorSettingsModalOpen.value = true - listOpen.value = false - } else if (tool === 'settings') { - listOpen.value = false - } else if (tool === 'move') { - listOpen.value = false - mapEditor.setTool(tool) - } else { - mapEditor.setTool(tool) - } - + mapEditor.setTool(tool) selectPencilOpen.value = tool === 'pencil' ? !selectPencilOpen.value : false selectEraserOpen.value = tool === 'eraser' ? !selectEraserOpen.value : false } @@ -171,7 +160,7 @@ function initKeyShortcuts(event: KeyboardEvent) { // Check if map is set if (!mapEditor.currentMap.value) return - // prevent if focused on composables + // prevent if focused on inputs if (document.activeElement?.tagName === 'INPUT') return if (event.ctrlKey) return