diff --git a/web/app.py b/web/app.py index 5c40fa9..c14b4ff 100644 --- a/web/app.py +++ b/web/app.py @@ -163,9 +163,21 @@ async def pointsets(): try: with open(os.path.join(_POINTSETS_DIR, fn), encoding="utf-8") as f: ps = json.load(f) + pts = ps.get("points", []) out[name] = { "mapId": ps.get("mapId", ""), - "points": [p.get("name") for p in ps.get("points", [])], + "points": [p.get("name") for p in pts], # 名字数组:兼容现有表单下拉 + # 含坐标的锚点:白模演出预览用(map-local pos[x,y,z] + rot) + "anchors": [ + { + "name": p.get("name"), + "pos": p.get("pos") or [0, 0, 0], + "rot": p.get("rot", 0), + "kind": p.get("kind", ""), + "npc": p.get("npc", ""), + } + for p in pts + ], } except Exception as e: out[name] = {"error": str(e)} diff --git a/web/static/app.js b/web/static/app.js index 1d1dd9b..d95cd83 100644 --- a/web/static/app.js +++ b/web/static/app.js @@ -80,7 +80,7 @@ App.current = group; App.ir = JSON.parse(JSON.stringify(d.ir)); App.status = d.status; App.selectedNode = null; App.dirty = false; $("graph-empty").style.display = "none"; - ["btn-save", "btn-validate", "btn-playtest", "btn-confirm", "btn-discard", "btn-addnode", "btn-autolayout", "btn-addsucc"].forEach(b => $(b).disabled = false); + ["btn-save", "btn-validate", "btn-playtest", "btn-timeline", "btn-confirm", "btn-discard", "btn-addnode", "btn-autolayout", "btn-addsucc"].forEach(b => $(b).disabled = false); renderAll(true); GraphUI.focusStart(App.ir); // 定位到开头节点 snapReset(); // 初始化撤销栈 @@ -194,6 +194,9 @@ // ---------- 试走 ---------- $("btn-playtest").onclick = () => Playtest.open(App.ir, App.dict); + // ---------- 演出预览(白模时间线)---------- + $("btn-timeline").onclick = () => Timeline.open(App.ir, App.dict, App.pointsets); + // ---------- 导入 ---------- let importFiles = []; // 当前已选文件 function renderImportFiles() { diff --git a/web/static/index.html b/web/static/index.html index 22bcc1c..c519fe4 100644 --- a/web/static/index.html +++ b/web/static/index.html @@ -26,6 +26,7 @@ + @@ -115,10 +116,28 @@ + +
+ +