Minor improvements

This commit is contained in:
2025-02-12 21:11:17 +01:00
parent e6412d8a65
commit 41e7832cbe
4 changed files with 8 additions and 59 deletions

View File

@ -30,13 +30,12 @@
<script setup lang="ts">
import { SocketEvent } from '@/application/enums'
import type { Map, UUID } from '@/application/types'
import type { Map } from '@/application/types'
import CreateMap from '@/components/gameMaster/mapEditor/partials/CreateMap.vue'
import Modal from '@/components/utilities/Modal.vue'
import { useMapEditorComposable } from '@/composables/useMapEditorComposable'
import { MapStorage } from '@/storage/storages'
import { useGameStore } from '@/stores/gameStore'
import { useMapEditorStore } from '@/stores/mapEditorStore'
import { onMounted, ref, useTemplateRef } from 'vue'
const gameStore = useGameStore()
@ -61,14 +60,14 @@ async function fetchMaps() {
mapList.value = await mapStorage.getAll()
}
function loadMap(id: UUID) {
function loadMap(id: string) {
gameStore.connection?.emit(SocketEvent.GM_MAP_REQUEST, { mapId: id }, (response: Map) => {
mapEditor.loadMap(response)
})
modalRef.value?.close()
}
async function deleteMap(id: UUID) {
async function deleteMap(id: string) {
gameStore.connection?.emit(SocketEvent.GM_MAP_DELETE, { mapId: id }, async (response: boolean) => {
if (!response) {
gameStore.addNotification({

View File

@ -47,6 +47,7 @@ import { useMapEditorComposable } from '@/composables/useMapEditorComposable'
import { MapObjectStorage } from '@/storage/storages'
import { useGameStore } from '@/stores/gameStore'
import { onMounted, ref } from 'vue'
import {SocketEvent} from "@/application/enums";
const props = defineProps<{
placedMapObject: PlacedMapObject
@ -81,7 +82,7 @@ async function handleUpdate() {
if (!mapObject.value) return
gameStore.connection?.emit(
'gm:mapObject:update',
SocketEvent.GM_MAPOBJECT_UPDATE,
{
id: props.placedMapObject.mapObject as string,
name: mapObjectName.value,

View File

@ -59,9 +59,9 @@ defineExpose({
onMounted(fetchMaps)
function fetchMaps() {
gameStore.connection?.emit(SocketEvent.GM_MAP_LIST, {}, (response: Map[]) => {
mapList.value = response
})
// gameStore.connection?.emit(SocketEvent.GM_MAP_LIST, {}, (response: Map[]) => {
// mapList.value = response
// })
}
const { toPositionX, toPositionY, toRotation, toMap } = useRefTeleportSettings()