Showing placed map object works in both game and map editor, updated types, cleaned some logic
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="flex justify-center items-center h-dvh relative">
|
||||
<Game :config="gameConfig" @create="createGame">
|
||||
<Scene name="main" @preload="preloadScene" @create="createScene">
|
||||
<Scene name="main" @preload="preloadScene">
|
||||
<Menu />
|
||||
<Hud />
|
||||
<Hotkeys />
|
||||
@ -29,7 +29,6 @@ import Menu from '@/components/game/gui/Menu.vue'
|
||||
import Map from '@/components/game/map/Map.vue'
|
||||
import { useGameStore } from '@/stores/gameStore'
|
||||
import { Game, Scene } from 'phavuer'
|
||||
import { onBeforeUnmount } from 'vue'
|
||||
|
||||
const gameStore = useGameStore()
|
||||
|
||||
@ -62,8 +61,4 @@ function preloadScene(scene: Phaser.Scene) {
|
||||
scene.load.image('blank_tile', '/assets/map/blank_tile.png')
|
||||
scene.load.image('waypoint', '/assets/waypoint.png')
|
||||
}
|
||||
|
||||
function createScene(scene: Phaser.Scene) {}
|
||||
|
||||
onBeforeUnmount(() => {})
|
||||
</script>
|
||||
|
@ -104,7 +104,7 @@ function save() {
|
||||
pvp: currentMap.pvp,
|
||||
mapEffects: currentMap.mapEffects,
|
||||
mapEventTiles: currentMap.mapEventTiles,
|
||||
placedMapObjects: currentMap.placedMapObjects.map(({ id, mapObject, depth, isRotated, positionX, positionY }) => ({ id, mapObject: { ...mapObject }, depth, isRotated, positionX, positionY })) ?? []
|
||||
placedMapObjects: currentMap.placedMapObjects.map(({ id, mapObject, depth, isRotated, positionX, positionY }) => ({ id, mapObject, depth, isRotated, positionX, positionY })) ?? []
|
||||
}
|
||||
|
||||
gameStore.connection?.emit('gm:map:update', data, (response: MapT) => {
|
||||
|
Reference in New Issue
Block a user