Map editor teleport enhancements

This commit is contained in:
2025-02-16 21:18:06 +01:00
parent af5a97f66d
commit bfb2bcb939
6 changed files with 12 additions and 16 deletions

View File

@ -26,7 +26,7 @@
</div>
<div class="form-field-full">
<label for="toMap">Map to teleport to</label>
<select v-model="toMapId" class="input-field" name="toMap" id="toMap">
<select v-model="toMap" class="input-field" name="toMap" id="toMap">
<option :value="null">Select map</option>
<option v-for="map in mapList" :key="map.id" :value="map.id">{{ map.name }}</option>
</select>
@ -55,7 +55,7 @@ defineExpose({
open: () => modalRef.value?.open()
})
const { toPositionX, toPositionY, toRotation, toMapId } = useRefTeleportSettings()
const { toPositionX, toPositionY, toRotation, toMap } = useRefTeleportSettings()
function useRefTeleportSettings() {
const settings = mapEditor.teleportSettings.value
@ -63,18 +63,18 @@ function useRefTeleportSettings() {
toPositionX: ref(settings.toPositionX),
toPositionY: ref(settings.toPositionY),
toRotation: ref(settings.toRotation),
toMapId: ref(settings.toMapId)
toMap: ref(settings.toMap)
}
}
watch([toPositionX, toPositionY, toRotation, toMapId], updateTeleportSettings)
watch([toPositionX, toPositionY, toRotation, toMap], updateTeleportSettings)
function updateTeleportSettings() {
mapEditor.setTeleportSettings({
toPositionX: toPositionX.value,
toPositionY: toPositionY.value,
toRotation: toRotation.value,
toMapId: toMapId.value
toMap: toMap.value
})
}