1
0
forked from noxious/client

Walk improvement

This commit is contained in:
2025-02-06 13:46:21 +01:00
parent 2a2841cf16
commit 15b212160d
2 changed files with 19 additions and 13 deletions

View File

@ -41,12 +41,12 @@
</template>
<script setup lang="ts">
import type { Map as MapT, MapObject, PlacedMapObject } from '@/application/types'
import type { MapObject, Map as MapT, PlacedMapObject } from '@/application/types'
import Modal from '@/components/utilities/Modal.vue'
import { onMounted, ref } from 'vue'
import { useMapEditorComposable } from '@/composables/useMapEditorComposable'
import { MapObjectStorage } from '@/storage/storages'
import { useGameStore } from '@/stores/gameStore'
import { useMapEditorComposable } from '@/composables/useMapEditorComposable'
import { onMounted, ref } from 'vue'
const props = defineProps<{
placedMapObject: PlacedMapObject
@ -77,7 +77,7 @@ const handleDelete = () => {
emit('delete', props.placedMapObject.id, props.map)
}
async function handleUpdate () {
async function handleUpdate() {
if (!mapObject.value) return
gameStore.connection?.emit(
@ -86,8 +86,9 @@ async function handleUpdate () {
id: props.placedMapObject.mapObject as string,
name: mapObjectName.value,
originX: mapObjectOriginX.value,
originY: mapObjectOriginY.value,
}, async (response: boolean) => {
originY: mapObjectOriginY.value
},
async (response: boolean) => {
if (!response) return
// Update mapObject in storage
await mapObjectStorage.update(mapObject.value!.id, {