From e74f24d943eebb675739c3b16bb2d426309d1863 Mon Sep 17 00:00:00 2001 From: hyoseung Date: Fri, 29 May 2026 15:07:02 +0900 Subject: [PATCH] feat: minimap overlay, fix dialog scroll, remove name plate --- src/views/GameView.vue | 187 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 179 insertions(+), 8 deletions(-) diff --git a/src/views/GameView.vue b/src/views/GameView.vue index a5af62b..4a16fd8 100644 --- a/src/views/GameView.vue +++ b/src/views/GameView.vue @@ -10,6 +10,7 @@
+
{{ username }}
@@ -18,6 +19,36 @@
+
+
+ {{ savedMapData.areaName }} + +
+
+ + + +
+ {{ loc.emoji }} + {{ loc.name }} +
+
+
+
{{ statusText || 'λΆˆλŸ¬μ˜€λŠ” 쀑...' }}
@@ -91,9 +122,6 @@
-
- {{ speakerName }} -
{{ displayText }}
@@ -150,8 +178,23 @@ const statusText = ref('') const resetConfirm = ref(false) const logRef = ref() const mapData = ref(null) +const savedMapData = ref(null) +const showMinimap = ref(false) const HISTORY_KEY = `rpg_history_${username.value}` +const MINIMAP_KEY = `rpg_minimap_${username.value}` + +function saveMinimapData(data: RpgResult['mapData']) { + localStorage.setItem(MINIMAP_KEY, JSON.stringify(data)) + savedMapData.value = data +} + +function loadMinimapData() { + try { + const saved = localStorage.getItem(MINIMAP_KEY) + if (saved) savedMapData.value = JSON.parse(saved) + } catch { savedMapData.value = null } +} function saveHistory() { localStorage.setItem(HISTORY_KEY, JSON.stringify(history.value)) @@ -242,6 +285,25 @@ const mapConnections = computed(() => { .map(l => ({ id: `${current.id}-${l.id}`, x1: current.x, y1: current.y, x2: l.x, y2: l.y })) }) +const minimapConnections = computed(() => { + if (!savedMapData.value) return [] + const locs = savedMapData.value.locations + const seen = new Set() + const lines: { id: string; x1: number; y1: number; x2: number; y2: number }[] = [] + for (const loc of locs) { + for (const other of locs) { + if (loc.id === other.id) continue + const key = [loc.id, other.id].sort().join('-') + if (seen.has(key)) continue + if (loc.isConnected && other.isCurrent || other.isConnected && loc.isCurrent) { + seen.add(key) + lines.push({ id: key, x1: loc.x, y1: loc.y, x2: other.x, y2: other.y }) + } + } + } + return lines +}) + function onMapNodeClick(loc: MapLocation) { if (loc.isCurrent || loading.value) return if (!loc.isConnected) return @@ -257,6 +319,7 @@ function scrollLog() { function applyResult(result: RpgResult, skipDuplicate = false) { mapData.value = result.mapData || null + if (result.mapData) saveMinimapData(result.mapData) if (skipDuplicate && history.value.length > 0) { const last = history.value[history.value.length - 1]! if (last.type === 'story' && last.text === result.text) { @@ -348,11 +411,15 @@ function logout() { router.push('/login') } -onMounted(resumeGame) +onMounted(() => { + loadMinimapData() + resumeGame() +})