From caa42b84ed5871f66d6b8f1bbcfb618b128bced0 Mon Sep 17 00:00:00 2001 From: CAtlas0784 Date: Fri, 18 Sep 2026 21:37:36 +0700 Subject: [PATCH] fix(ui): remove manual cutscene buttons from debug panel (cutscenes play automatically upon transit) --- .../Ananta.App/DebugPanel/index.html | 156 ++++-------------- 1 file changed, 30 insertions(+), 126 deletions(-) diff --git a/Ananta.Server/Ananta.App/DebugPanel/index.html b/Ananta.Server/Ananta.App/DebugPanel/index.html index d388bcc..0af539f 100644 --- a/Ananta.Server/Ananta.App/DebugPanel/index.html +++ b/Ananta.Server/Ananta.App/DebugPanel/index.html @@ -249,7 +249,6 @@
-
@@ -316,50 +315,6 @@ - - - - - -
-

🎬 3D Cinematics & Story Timelines (ฉากคัทซีนเนื้อเรื่อง)

-
- - -
-
สั่งเล่นฉาก Cinematic Timeline 3D ภายใน Engine ของเกมทันทีแบบเรียลไทม์
@@ -910,53 +865,6 @@ async function toggleClothes() { log('toggle clothes: ' + JSON.stringify(r)); } -async function loadCutsceneCatalog() { - const sel = document.getElementById('cutsceneSelect'); - if (!sel) return; - try { - const res = await api('/api/cutscene/catalog'); - if (res && res.items && res.items.length > 0) { - const groups = { - story: { label: '🎬 เนื้อเรื่องหลัก & เควสต์ (Main Story & Quests)', items: [] }, - character: { label: '🌟 แอนิเมชันเปิดตัวตัวละคร (Character Entrances & Specials)', items: [] }, - urban: { label: '🏙️ ฉากชีวิตเมือง & กิจกรรม (Urban Life & Activities)', items: [] }, - transit: { label: '✈️ ทรานซิชันโลก & ยานพาหนะ (World & Vehicle Transitions)', items: [] } - }; - res.items.forEach(it => { - const cat = groups[it.category] ? it.category : 'character'; - groups[cat].items.push(it); - }); - let html = ''; - for (const k in groups) { - const g = groups[k]; - if (g.items.length > 0) { - html += ``; - g.items.forEach(it => { - html += ``; - }); - html += ``; - } - } - sel.innerHTML = html; - } - } catch (err) { - console.error('Failed to load cutscene catalog:', err); - } -} - -async function playSelectedCutscene() { - const sel = document.getElementById('cutsceneSelect'); - const opt = sel ? sel.options[sel.selectedIndex] : null; - const name = sel ? sel.value : 'TL_SEYM_010_Q010_S01'; - const configId = opt ? parseInt(opt.getAttribute('data-config-id') || '0', 10) : 0; - const r = await api('/api/timeline/play', { - method: 'POST', - headers: { 'Content-Type': 'application/json' }, - body: JSON.stringify({ name, configId }) - }); - log('play cutscene: ' + JSON.stringify(r)); -} - async function launchSelectedMinigame() { const sel = document.getElementById('minigameSelect'); const game = sel ? sel.value : 'KOF97'; @@ -986,24 +894,49 @@ async function launchArcadeMinigame() { await launchSelectedMinigame(); } -async function warpSubway(x, y, z, facing) { +async function warpSubway(x, y, z, facing, stationName, endTimeline) { + const autoCutscene = document.getElementById('autoSubwayCutscene')?.checked ?? true; + if (autoCutscene) { + const sName = stationName || 'สถานีปลายทาง'; + log(`🚇 กำลังเดินทางด้วยรถไฟไปยัง ${sName}... (ระบบกำลังเล่นคัทซีนรถไฟอัตโนมัติ)`); + await api('/api/timeline/play', { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ name: 'loading_metro_normal01_m' }) + }); + setTimeout(async () => { + await api('/api/player/teleport', { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ x: parseFloat(x), y: parseFloat(y), z: parseFloat(z), facing: parseFloat(facing || 0) }) + }); + await api('/api/timeline/play', { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ name: endTimeline || 'loading_metro_end_1' }) + }); + log(`🚇 รถไฟเทียบชานชาลาสถานี ${sName} และเดินออกจากอุโมงค์เรียบร้อยแล้ว`); + refresh(); + }, 1800); + return; + } const r = await api('/api/player/teleport', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ x: parseFloat(x), y: parseFloat(y), z: parseFloat(z), facing: parseFloat(facing || 0) }) }); - log(`🚇 Warp to Subway (${x}, ${y}, ${z}): ` + JSON.stringify(r)); + log(`🚇 วาร์ปไปยังสถานี (${x}, ${y}, ${z}): ` + JSON.stringify(r)); refresh(); } async function teleportToBowling() { - await warpSubway(1090.8, 6.5, 2083.7, 0); + await warpSubway(1090.8, 6.5, 2083.7, 0, 'Bowling Alley'); log('🎳 Warped to Bowling Alley at (1090.8, 6.5, 2083.7)'); } // --- TRANSIT & METRO TRACKER --- function switchTransitTab(tab) { - const tabs = ['live', 'stations', 'cinematic']; + const tabs = ['live', 'stations']; tabs.forEach(t => { const pane = document.getElementById('transitPane_' + t); const btn = document.getElementById('tabBtn_' + t); @@ -1015,33 +948,6 @@ function switchTransitTab(tab) { }); } -async function playCutsceneDirect(tlName) { - const r = await api('/api/timeline/play', { - method: 'POST', - headers: { 'Content-Type': 'application/json' }, - body: JSON.stringify({ name: tlName }) - }); - log(`🎬 Played Metro Cutscene (${tlName}): ` + JSON.stringify(r)); -} - -async function rideMetroWithCinematic(x, y, z, stationName) { - log(`🚇 กำลังขึ้นรถไฟเพื่อมุ่งหน้าไปยังสถานี ${stationName}... เริ่มเล่นคัทซีนเดินทาง`); - await api('/api/timeline/play', { - method: 'POST', - headers: { 'Content-Type': 'application/json' }, - body: JSON.stringify({ name: 'loading_metro_normal01_m' }) - }); - setTimeout(async () => { - await warpSubway(x, y, z, 0); - await api('/api/timeline/play', { - method: 'POST', - headers: { 'Content-Type': 'application/json' }, - body: JSON.stringify({ name: 'loading_metro_end_1' }) - }); - log(`🚇 เดินทางถึงสถานี ${stationName} เรียบร้อยแล้ว! (ชานชาลาเปิดประตู)`); - }, 2500); -} - const RAIL_LINES = [ { id: 1, @@ -1165,8 +1071,7 @@ function onSelectRailLine() { ${isHub ? 'GRAND INTERCHANGE' : ''}
- - +
`; @@ -1448,7 +1353,6 @@ async function equipSelected() { loadFleet(); loadScenes(); loadNpcCatalog(); -loadCutsceneCatalog(); loadCatalogs(); refresh(); setInterval(refresh, 2000);