1
0
forked from noxious/client

Separated Game and ZoneEditor screens

This commit is contained in:
2024-10-16 16:04:43 +02:00
parent 13be1a38fa
commit e56e078042
2 changed files with 161 additions and 27 deletions

View File

@ -3,31 +3,22 @@
<GmTools v-if="gameStore.character?.role === 'gm'" />
<GmPanel v-if="gameStore.character?.role === 'gm'" />
<div v-if="!zoneEditorStore.active">
<Game :config="gameConfig" @create="createGame">
<Scene name="main" @preload="preloadScene" @create="createScene">
<div v-if="isLoaded">
<Menu />
<Hud />
<Keybindings />
<Minimap />
<Zone />
<Chat />
<ExpBar />
<Game :config="gameConfig" @create="createGame">
<Scene name="main" @preload="preloadScene" @create="createScene">
<div v-if="isLoaded">
<Menu />
<Hud />
<Keybindings />
<Minimap />
<Zone />
<Chat />
<ExpBar />
<Inventory />
<Effects />
</div>
</Scene>
</Game>
</div>
<div v-if="zoneEditorStore.active">
<Game :config="gameConfig" @create="createGame">
<Scene name="main" @preload="preloadScene" @create="createScene">
<ZoneEditor v-if="isLoaded" :key="JSON.stringify(`${zoneEditorStore.zone?.id}_${zoneEditorStore.zone?.createdAt}_${zoneEditorStore.zone?.updatedAt}`)" />
</Scene>
</Game>
</div>
<Inventory />
<Effects />
</div>
</Scene>
</Game>
</div>
</template>
@ -51,9 +42,7 @@ import Effects from '@/components/Effects.vue'
import { loadAssets } from '@/composables/zoneComposable'
import Minimap from '@/components/gui/Minimap.vue'
const gameStore = useGameStore()
const zoneEditorStore = useZoneEditorStore()
const isLoaded = ref(false)
const gameConfig = {
@ -154,7 +143,6 @@ const createScene = async (scene: Phaser.Scene) => {
onBeforeUnmount(() => {
isLoaded.value = false
gameStore.disconnectSocket()
})
</script>