From ab2062698e80faec5ecec4ade1c2a6aeea64dd74 Mon Sep 17 00:00:00 2001 From: "Fabian @ Blax Software" Date: Thu, 29 Oct 2026 01:57:00 +0100 Subject: [PATCH] feat: pick a start direction when joining a world Co-Authored-By: Claude Opus 5.5 --- app/composables/useWorld.ts | 8 ++++---- app/pages/worlds.vue | 30 +++++++++++++++++++++++++++--- app/types/game.ts | 5 ++++- i18n/locales/en.ts | 1 + i18n/pages/worlds.ts | 4 ++++ 5 files changed, 40 insertions(+), 8 deletions(-) diff --git a/app/composables/useWorld.ts b/app/composables/useWorld.ts index 07c1f03..42ac82a 100644 --- a/app/composables/useWorld.ts +++ b/app/composables/useWorld.ts @@ -1,4 +1,4 @@ -import type { WorldSummary } from '~/types/game' +import type { StartDirection, WorldSummary } from '~/types/game' export function useWorld() { const worlds = useState('worlds', () => null) @@ -20,9 +20,9 @@ export function useWorld() { const refresh = () => run(async () => (worlds.value = await ws.send('world.index'))) - /** Joins (or re-enters) a world and returns the player's village there. */ - const join = (worldId: number) => - run(async () => (await ws.send<{ village_id: number }>('world.join', { world_id: worldId })).village_id) + /** Joins (or re-enters) a world, starting in the given quarter of the map, and returns the player's village there. */ + const join = (worldId: number, direction: StartDirection = 'random') => + run(async () => (await ws.send<{ village_id: number }>('world.join', { world_id: worldId, direction })).village_id) return { worlds, error, busy, refresh, join } } diff --git a/app/pages/worlds.vue b/app/pages/worlds.vue index a419d86..f8350f5 100644 --- a/app/pages/worlds.vue +++ b/app/pages/worlds.vue @@ -1,15 +1,21 @@