diff --git a/runner.go b/runner.go index d65c89e..ab81e30 100644 --- a/runner.go +++ b/runner.go @@ -34,7 +34,9 @@ type DialogueRunner struct { // DialogueElement represents a step of a dialogue as it is presented in a game. // Either Line or Options holds a value. +// Node holds the name of the dialogue node that contains the element. type DialogueElement struct { + Node string Line *markup.ParseResult Options []DialogueOption } @@ -118,6 +120,7 @@ func (dr *DialogueRunner) Next(choice int) (*DialogueElement, error) { return nil, fmt.Errorf("failed to prepare line: %w", err) } return &DialogueElement{ + Node: dr.currentNode, Line: markupResult, }, nil case nextStatement.ShortcutOptionStatement != nil: @@ -143,6 +146,7 @@ func (dr *DialogueRunner) Next(choice int) (*DialogueElement, error) { }) } return &DialogueElement{ + Node: dr.currentNode, Options: options, }, nil case nextStatement.SetStatement != nil: diff --git a/snapshot.go b/snapshot.go index d826946..ba9a502 100644 --- a/snapshot.go +++ b/snapshot.go @@ -2,7 +2,7 @@ package ysgo import "github.com/remieven/ysgo/variable" -// Snapshot holds data that represents the current state of a dialogue, so it can be restored later +// Snapshot holds data that represents the current state of a dialogue, so it can be restored later. type Snapshot struct { Variables map[string]variable.Value