diff --git a/src/components/gameMaster/mapEditor/partials/ListPanel.vue b/src/components/gameMaster/mapEditor/partials/ListPanel.vue index a739330..23cb2bc 100644 --- a/src/components/gameMaster/mapEditor/partials/ListPanel.vue +++ b/src/components/gameMaster/mapEditor/partials/ListPanel.vue @@ -8,14 +8,14 @@ </div> <div class="flex"> <select class="input-field w-full" name="lists" v-model="lists"> - <option value="tiles">Tiles</option> - <option value="objects">Objects</option> + <option value="tile">Tiles</option> + <option value="map_object">Objects</option> </select> </div> </div> <div class="h-full overflow-auto relative border-0 border-t border-solid border-gray-500 p-2.5"> - <TileList v-if="lists === 'tiles'" /> - <ObjectList v-if="lists === 'objects'" /> + <TileList v-if="mapEditor.drawMode.value === 'tile'" /> + <ObjectList v-if="mapEditor.drawMode.value === 'map_object'" /> </div> <div class="flex flex-col h-40 gap-2.5 p-3.5 border-t border-0 border-solid border-gray-500"> <span>Tags:</span> @@ -41,7 +41,7 @@ const isOpen = ref(false) const tileStorage = new TileStorage() const searchQuery = ref('') const tiles = ref<Tile[]>([]) -const lists = ref<'tiles' | 'objects'>('tiles') +const lists = ref<string>(mapEditor.drawMode.value) defineExpose({ open: () => (isOpen.value = true), @@ -50,19 +50,11 @@ defineExpose({ }) watch(lists, (list) => { - if (list === 'tiles') { - mapEditor.setDrawMode('tile') - } else if (list === 'objects') { - mapEditor.setDrawMode('map_object') - } + mapEditor.setDrawMode(list) }) -watch(() => mapEditor.drawMode.value, (list) => { - if (list === 'tile') { - lists.value = 'tiles' - } else if (list === 'map_object') { - lists.value = 'objects' - } +watch(mapEditor.drawMode, (list) => { + lists.value = list }) let subscription: any = null