Live dialogue preview in the editors (reuses the real DialoguePlayer)
- DialoguePlayer gains an `inline` mode (fills its container, no window key capture) and a `startId` to jump the walk to a given utterance. - New DialoguePreview: a scaled-down mini player that fetches the resolved tree from GET /api/admin/story-nodes/:id/dialogue (same resolver as playback). - Mystery graph: preview appears next to a selected dialogue node. - Utterance editor: docked preview that jumps to the clicked/selected utterance and refreshes after each edit. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -289,6 +289,10 @@ app.post('/api/admin/mysteries/:id/graph', requireAdmin, async (req, res, next)
|
||||
app.get('/api/admin/story-nodes/:id/utterances', requireAdmin, async (req, res, next) => {
|
||||
try { res.json(await storyGraph.listUtterances(String(req.params.id))) } catch (error) { next(error) }
|
||||
})
|
||||
// Resolved runtime dialogue tree for the editor's live preview (same resolver as play).
|
||||
app.get('/api/admin/story-nodes/:id/dialogue', requireAdmin, async (req, res, next) => {
|
||||
try { res.json(await narrative.resolveDialogue(String(req.params.id))) } catch (error) { next(error) }
|
||||
})
|
||||
app.post('/api/admin/story-nodes/:id/utterances', requireAdmin, async (req, res, next) => {
|
||||
try {
|
||||
if (!requireEditing(res)) return
|
||||
|
||||
Reference in New Issue
Block a user