Made save async.
This commit is contained in:
parent
2d7d598c94
commit
db650449ac
@ -33,11 +33,10 @@ import TileList from '@/components/gameMaster/mapEditor/partials/TileList.vue'
|
|||||||
import Toolbar from '@/components/gameMaster/mapEditor/partials/Toolbar.vue'
|
import Toolbar from '@/components/gameMaster/mapEditor/partials/Toolbar.vue'
|
||||||
import { useMapEditorComposable } from '@/composables/useMapEditorComposable'
|
import { useMapEditorComposable } from '@/composables/useMapEditorComposable'
|
||||||
import { loadAllTileTextures } from '@/services/mapService'
|
import { loadAllTileTextures } from '@/services/mapService'
|
||||||
import { CharacterHairStorage, MapStorage } from '@/storage/storages'
|
import { MapStorage } from '@/storage/storages'
|
||||||
import { Game, Scene } from 'phavuer'
|
import { Game, Scene } from 'phavuer'
|
||||||
import { ref, toRaw, useTemplateRef } from 'vue'
|
import { ref, toRaw, useTemplateRef } from 'vue'
|
||||||
|
|
||||||
const mapStorage = new MapStorage()
|
|
||||||
const mapEditor = useMapEditorComposable()
|
const mapEditor = useMapEditorComposable()
|
||||||
|
|
||||||
const mapModal = useTemplateRef('mapModal')
|
const mapModal = useTemplateRef('mapModal')
|
||||||
@ -83,7 +82,7 @@ const preloadScene = async (scene: Phaser.Scene) => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function save() {
|
async function save() {
|
||||||
const currentMap = toRaw(mapEditor.currentMap.value)
|
const currentMap = toRaw(mapEditor.currentMap.value)
|
||||||
if (!currentMap) return
|
if (!currentMap) return
|
||||||
|
|
||||||
@ -92,9 +91,9 @@ function save() {
|
|||||||
mapId: currentMap.id
|
mapId: currentMap.id
|
||||||
}
|
}
|
||||||
|
|
||||||
socketManager.emit(SocketEvent.GM_MAP_UPDATE, data, (response: MapT) => {
|
socketManager.emit(SocketEvent.GM_MAP_UPDATE, data, async (response: MapT) => {
|
||||||
if (!response.id) return
|
if (!response.id) return
|
||||||
downloadCache('maps', new MapStorage())
|
await downloadCache('maps', new MapStorage())
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user